antoniocasero / Panels

Panels is a framework to easily add sliding panels to your application
MIT License
1.5k stars 89 forks source link

Panels Programmatically #13

Open mmdock opened 5 years ago

mmdock commented 5 years ago

Is there a way to build Panels without the need for Storyboard?

antoniocasero commented 5 years ago

Of course, as long your VC conforms the protocol Panelable, you can inject it to the method 'show'.

antoniocasero commented 5 years ago

but I'm working to make Panelable nicer :)

Savyalov commented 5 years ago

"Trying to instantiate something that does not conform Panelable :("

import UIKit import AVFoundation import Panels

class ViewController12: UIViewController, Panelable { @IBOutlet var headerHeight: NSLayoutConstraint! @IBOutlet var headerPanel: UIView! } My storyboard name is "Main". Help me, I do not understand what the problem is. Thank!

antoniocasero commented 5 years ago

Hi @Savyalov, sorry for the late response. Are you still having problems? There is an extension included in the framework to instantiate Panels from the storyboard, maybe it helps.

Savyalov commented 5 years ago

Thank! Already figured out.

erniela commented 5 years ago

Thank! Already figured out.

What was your solution? I have the same problem doing programmatically. Please help.

Savyalov commented 5 years ago

Good morning! I just deleted and installed again Panelable. Nothing else helped.

shchoi82-robotcode commented 5 years ago

Hi, I'm trying to implement without storyboard. Its my code.. what is the problem?

let panelManager = Panels(target: self) let panelConfiguration = PanelConfiguration(size: .oneThird) panelManager.show(panel: self, config: panelConfiguration, view: myView)

myVIew is just existing UIView self is UIController & Panelable

runtime error
EXC_BAD_ACCESS Panels.swift: 38 Line parentViewController?.addContainer(container: panel)