Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

PanelContentDelegate not being called #24

Open
sriteja25 opened this issue May 3, 2018 · 1 comment
Open

PanelContentDelegate not being called #24

sriteja25 opened this issue May 3, 2018 · 1 comment

Comments

@sriteja25
Copy link

Hello first of all thanks for this project. I am trying to integrate this into my Objective C project using swift extensions as you mentioned in some other issue. But Panel Delegate is not being called.

here is the method I am calling in my Objective C class

self.webBroserVc.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController * popoverVc = self.webBroserVc.popoverPresentationController;
popoverVc.sourceView = self.browserButton;
popoverVc.sourceRect = CGRectMake(self.browserButton.bounds.size.width/2, self.browserButton.bounds.size.height/2, 0, 0);
//popoverVc.preferredContentSize = CGSizeMake(250, 250);
[self presentViewController:self.webBroserVc animated:YES completion:nil];

Now I am using an extension to call the Panel Kit methods for PanelManager and PanelControlDelegate

extension CanvasViewController : PanelManager{

public var panels: [PanelViewController] {
    let mapPanelVC = PanelViewController(with: self.webBroserVc, in: self)
    return [mapPanelVC]
}

public var panelContentWrapperView: UIView {
    return self.view
}

public var panelContentView: UIView {
    return scrollViewContainer
}

}
extension WebBrowserViewController : PanelContentDelegate {
public var preferredPanelContentSize: CGSize {
return CGSize(width: 320, height: 500)
}

public var maximumPanelContentSize: CGSize {
    return CGSize(width: 512, height: 600)
}

public var preferredPanelPinnedWidth: CGFloat {
    return 500
}

But the PanelContentDelegate is not being called, can you please tell me what I am doing wrong @louisdh

@wowlocal
Copy link

you should initialize PanelViewController(with: self.webBroserVc, in: self) panels in viewDidLoad() after return it in delegate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants