Comments (22)
I wrote this sample:
If you want some more features in this project (as push etc...), tell me.
from pbrevealviewcontroller.
Thanks for your support, You save my lot of time. I tested sample code and it is as per my requirement. Now i am going to integrate in my project. Definitely i will tell if anything more needed.
Thanks a lot Patric.
from pbrevealviewcontroller.
Hi Patric , One problem i am facing. I want to disable main view touch action if left or right side view open. I tried with this but not getting work.
if (self.revealViewController.isLeftViewOpen || self.revealViewController.isRightViewOpen)
[self.revealViewController.mainViewController.view setUserInteractionEnabled:NO];
else
[self.revealViewController.mainViewController.view setUserInteractionEnabled:YES];
Any suggestion.
Thanks
from pbrevealviewcontroller.
Hello,
Adopt PBRevealViewControllerDelegate and use some delegate methods as willShowLeft or didShowLeft... and willHideRight or didHideRight:
example:
PBRevealTabObj 2.zip
#pragma mark - PBRevealViewController delegate
- (void)revealController:(PBRevealViewController *)revealController willShowLeftViewController:(UIViewController *)controller
{
revealController.mainViewController.view.userInteractionEnabled = NO;
revealController.mainViewController.view.alpha = 0.8;
}
- (void)revealController:(PBRevealViewController *)revealController willHideLeftViewController:(UIViewController *)controller
{
revealController.mainViewController.view.userInteractionEnabled = YES;
revealController.mainViewController.view.alpha = 1.0;
}
- (void)revealController:(PBRevealViewController *)revealController didShowRightViewController:(UIViewController *)controller
{
revealController.mainViewController.view.userInteractionEnabled = NO;
revealController.mainViewController.view.alpha = 0.8;
}
- (void)revealController:(PBRevealViewController *)revealController didHideRightViewController:(UIViewController *)controller
{
revealController.mainViewController.view.userInteractionEnabled = YES;
revealController.mainViewController.view.alpha = 1.0;
}
from pbrevealviewcontroller.
Can i restrict user for specific right and left dragging. In my app if user is in english language then right dragging not possible. Currently i tried with setting this self.revealViewController.rightViewRevealWidth = 0; . But some how it opening few portion of right view.
This was i achived using velocity using SWRevealviewcontroller.
from pbrevealviewcontroller.
Setting rightViewRevealWidth to 0.0 normally works. But you can achieve with this delegate method (example):
- (BOOL)revealControllerPanGestureShouldBegin:(PBRevealViewController *)revealController direction:(PBRevealControllerPanDirection)direction
{
NSLocale *currentLocale = [NSLocale currentLocale];
NSString *countryCode = [currentLocale objectForKey:NSLocaleCountryCode];
if (direction == PBRevealControllerPanDirectionLeft && [countryCode isEqualToString:@"US"]) {
return NO;
}
return YES;
}
from pbrevealviewcontroller.
Thanks lot, finally i replaced SWReveal with PBReveal and achieved all featured that was implemented with SWReveal. I will give this library 5 star.
from pbrevealviewcontroller.
Welcome, with pleasure! Don't hesitate if you have any questions. And if you can tell me what is the application on the store, I could have a look of your work and mine!
from pbrevealviewcontroller.
My app is under development for new version, so it is not released yet. I will let you know once pushed to store.
Thanks
from pbrevealviewcontroller.
@iDevelopper Can you please give sample code in swift 3 also with menu covering entire screen including top navigation bar and bottom tab bar?
i need the arrangement exactly like
https://github.com/John-Lluch/SWRevealViewController/files/275828/SWTabBarSwift2.zip
but i need that side menu over the viewcontroller.please help @iDevelopper
from pbrevealviewcontroller.
Can you upload a screenshot please?
from pbrevealviewcontroller.
thanks for the response @iDevelopper . im attaching the design i want to achieve
i want to show menu comes over top navigation and bottom Tabbar also..at the sametime i want to show the bottom tabbar in all pages navigating from this sidemenu. (The side menu has viewcontrollers in bottom tapbar and also viewcontrollers not in tabbar.i want to show the bottam tab bar in every page)
https://github.com/John-Lluch/SWRevealViewController/files/275828/SWTabBarSwift2.zip
The above one is exact item i want,but i want the menu come over the viewcontrollers.
from pbrevealviewcontroller.
Ok for menu, no problem. If you want to present the others views and keep the tab bar items visibles I think you have to add the subview of the controller that is not part of tab bar controller to the active view.
from pbrevealviewcontroller.
Revisited sample with PBRevealViewController. In the sample it is not a UITabBarController but a UITabBar in a container view controller. Because if you want to present views with tab bar items visibles you have to dehighlight them...
from pbrevealviewcontroller.
@iDevelopper ,thanks a lotttt man..you saved me.Great thanks to you.Love you.
from pbrevealviewcontroller.
@iDevelopper ,im facing an issue ,how can i load the page, i mean the ContainerViewController in the above sample from appdelegate ?
from pbrevealviewcontroller.
I don't understand the question. ContainerViewController is the main view controller of PBRevealViewController. Do you want to create the reveal controller programmatically from AppDelegate and not from storyboard?
from pbrevealviewcontroller.
@iDevelopper ..no sir.First of all thanks for your reply sir.Actually ContainerViewController is home page in my project.After login ,its loading this main viewController (ContainerViewController). Once successfully login,next time when opening the app,no need to show the login page know? so im storing a bool value in user defaults and checking if it is true in didFinishlaunching func in app delegate..
Im using this code with didFinishLaunchingWithOptions.
let isLoggedIn = UserDefaults.standard.bool(forKey: "isLoggedIn")
if isLoggedIn{
loggedUserId = UserDefaults.standard.value(forKey: "userId") as! String
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let containerViewController = storyboard.instantiateViewController(withIdentifier: "RevealViewController") as UIViewController
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = containerViewController
self.window?.makeKeyAndVisible()
}
But it is giving crash all time. fatal error: unexpectedly found nil while unwrapping an Optional value.
Please help
from pbrevealviewcontroller.
The root view controller must be the reveal view controller not the container view controller.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let isLoggedIn = UserDefaults.standard.bool(forKey: "isLoggedIn")
if isLoggedIn {
loggedUserId = UserDefaults.standard.value(forKey: "userId") as! String
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let revealController = storyboard.instantiateViewController(withIdentifier: "RevealViewController") as! PBRevealViewController
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = revealController
self.window?.makeKeyAndVisible()
}
return true
}
But I think it will be better to always load the Login view controller and perform the segue to reveal if the user is already logged in. And implement a Logout to come back in Login view controller.
from pbrevealviewcontroller.
@iDevelopper ,thank you sir.it works
from pbrevealviewcontroller.
Hi Patric,
As you know i am using "PBRevealViewController" to use side menu in my app. Suddenly i came with one requirement. My main view has collection view that is scrollable left right. And my requirement is like if user drag side menu from divce edge where scrollable collection view. Currently no side menu appears due to scrollable collection view. Any work around for that.
Thanks
Subodh
from pbrevealviewcontroller.
You could use the panFromLeftBorderWidth property, for example set it to 50. The left side will open only if the user pan from less or equal than 50 points from the left border.
And you have to implement the delegate function:
// MARK: - SWRevealViewController delegate
func revealController(_ revealController: PBRevealViewController, panGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer, direction: PBRevealControllerPanDirection) -> Bool
{
return true
}
from pbrevealviewcontroller.
Related Issues (20)
- didShowLeft delegate called when left view not open HOT 4
- SWRevealViewController to PBRevealViewController "FrontViewPosition" HOT 2
- Is there a way to enable/disable the menu from opening? HOT 7
- Do you have plans to update to Swift 5? HOT 3
- PBRevealViewController and using IB Traits Variations HOT 2
- MenuController with menu button. Without Storyboards. Need Help ! HOT 6
- Equivalent code SWRevealViewController in PBRevealViewController HOT 3
- Slider menu is not working when jump from appDelegate to ViewController HOT 2
- Question HOT 2
- Dismiss keyboard when menu button pressed HOT 2
- Swipe to delete UITableView HOT 4
- Dismiss left view HOT 2
- revealViewController() is coming back nil HOT 1
- Warning: Attempt to present <UINavigationController: 0x7c284400> on <PBRevealViewController HOT 3
- How to create dynamic menu items in swrevealviewcontroller objective c
- Is there any way to cache the MainViewControllers? HOT 8
- How to enable disable opening Left menu feature on UIViewControllers. HOT 1
- How to fade FrontViewcontroller on swipe or Pangesture. HOT 1
- How can i show a AlertView on Tap or pangesture for Left menu opening on each specific viewcontroller HOT 1
- Difference between SWRevealViewController & PBRevealViewController, and migration path HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pbrevealviewcontroller.