Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Request) FAPanelDelegate #11

Closed
droni89 opened this issue Aug 20, 2017 · 4 comments
Closed

(Request) FAPanelDelegate #11

droni89 opened this issue Aug 20, 2017 · 4 comments

Comments

@droni89
Copy link

droni89 commented Aug 20, 2017

Might be useful to create a delegate for FAPanelController:

public protocol FAPanelControllerDelegate: class{

func centerPanelWillBecomeActive()
func leftPanelWillBecomeActive()
func rightPanelWillBecomeActive()

func centerPanelDidBecomeActive()
func leftPanelDidBecomeActive()
func rightPanelDidBecomeActive()

}

@fahidattique55
Copy link
Owner

Hi droni89,

I will add it soon.

Thanks & regards

@fahidattique55
Copy link
Owner

Hi droni89,

The requested feature has been added. Please have a look into it and let me know in case you have any query.

I always welcome the new feature requests.

Thanks & Regards

@droni89
Copy link
Author

droni89 commented Aug 27, 2017

Thanks for that!

Having a few Issues:

  1. The delegate var in your FAPanelController class needs to be an open var because when the delegate is implemented in another class the delegate variable needs do be initialised such that
    panel?.delegate = self

This currently raises an error that FAPanelController has no such variable

  1. Implementing the delegate requires stubs for each of the delegate methods to be added, even if they are not being used. A way around this is to write an extension (this creates a default implementation):

public Extension FAPanelStateDelegate{

func centerPanelWillBecomeActive(){}
func leftPanelWillBecomeActive(){}
func rightPanelWillBecomeActive(){}

func centerPanelDidBecomeActive(){}
func leftPanelDidBecomeActive(){}
func rightPanelDidBecomeActive(){}

}

3.For the _state WillSet observer, the switch statment needs to be changed to
switch newValue{
....
}
As the current implementation incorrectly triggers centerPanelWillBecomeActive() instead of leftPanelWillBecomeActive() etc, because it is basing it on the current value and not the value it will change to

@fahidattique55
Copy link
Owner

Hi droni89,

Thanks for letting me know about the issues. I appreciate you kind concerns. The issue is fixed as you have suggested.

Thanks & Regards

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

No branches or pull requests

2 participants