Panels icon indicating copy to clipboard operation
Panels copied to clipboard

Panels Programmatically

Open mmdock opened this issue 5 years ago • 8 comments

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

mmdock avatar Feb 03 '19 18:02 mmdock

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

antoniocasero avatar Feb 05 '19 06:02 antoniocasero

but I'm working to make Panelable nicer :)

antoniocasero avatar Feb 05 '19 07:02 antoniocasero

"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!

Savyalov avatar Apr 12 '19 23:04 Savyalov

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.

antoniocasero avatar Apr 24 '19 14:04 antoniocasero

Thank! Already figured out.

Savyalov avatar Apr 26 '19 13:04 Savyalov

Thank! Already figured out.

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

erniela avatar Jun 04 '19 03:06 erniela

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

Savyalov avatar Jun 04 '19 04:06 Savyalov

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)

shchoi82-robotcode avatar Jul 23 '19 10:07 shchoi82-robotcode