-
Notifications
You must be signed in to change notification settings - Fork 16
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
Problem when using PBRVC in single side view context (i.e. a single left side menu) #32
Comments
Hi @pgmassari , thanks a lot for revealing this issue and for your great comment! Fixed in 1.2.4 |
Thanks @iDevelopper for the fast fix. Very good: confirmed working in 1.2.4, with just No subclassing of PBRVC is necessary, unless customization is needed (i.e. |
I like subclassing for the delegate functions but they should be in AppDelegate or elsewhere... Properties for customisation can be set in the main view controller also. |
I'm fairly new to iOS development... is there a specific reason on why the delegate method should be in the AppDelegate class? I liked the idea of having the "reveal vc stuff" in a respective subclass. |
No reason, but you said "No subclassing of PBRVC is necessary". I personally like subclassing my PBRevealViewController Class. All customisations and delegate implementations can be done in this subclass in rapport. (Note that you cannot subclass a Swift Class in Objective-C, for developers working in Objective-C and using Swift libairies). |
I'm using the latest Pod spec (1.2.3) in a Swift project. In this project i need just one main VC and a single side VC as menu.
In the storyboard set up the PBRVC to have only
pb_main
andpb_left
set.So far, so good: the app behaves as expected.
The problem appears when i try to transition from an orientation to another (say, portrait to landscape or viceversa, depending on the initial orientation of the device/simulator). On transition, i get a runtime error due to this forced unwrap:
PBRevealViewController/PBRevealViewController/Classes/PBRevealViewController.swift
Line 2464 in 20a7559
Possibly some other lines might cause unwrap problems too (although, I've been heavily using it with no other kinds of crash)
To @iDevelopper: great work on this Swift reveal view controller. I tried many others (even with many more github stars) but this is simple, clear, efficient and really working out of the box without having to hack around too much
To those who need to have PBRVC working in a single side menu context anyway (say, a left menu), I did the following: a) setup a dummy reference to
pb_right
and b) avoid the right side to appear when swiping from right to left, but only when the left side is not present (note: the right menu now show the same of the left side)pb_right
to the same VC aspb_left
(so that the aforementioned unwrap wont be nil)PBRevealViewControllerDelegate
alpha
value)Probably there could be other faster & dirtier ways, like just setting
self.righViewRevealWidth = 0
The text was updated successfully, but these errors were encountered: