Giter Site home page Giter Site logo

Comments (22)

iDevelopper avatar iDevelopper commented on July 3, 2024

I wrote this sample:

PBRevealTabObj.zip

If you want some more features in this project (as push etc...), tell me.

from pbrevealviewcontroller.

SubodhBQT avatar SubodhBQT commented on July 3, 2024

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.

SubodhBQT avatar SubodhBQT commented on July 3, 2024

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.

iDevelopper avatar iDevelopper commented on July 3, 2024

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.

SubodhBQT avatar SubodhBQT commented on July 3, 2024

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.

screen shot 2017-08-01 at 3 08 27 pm

from pbrevealviewcontroller.

iDevelopper avatar iDevelopper commented on July 3, 2024

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.

SubodhBQT avatar SubodhBQT commented on July 3, 2024

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.

iDevelopper avatar iDevelopper commented on July 3, 2024

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.

SubodhBQT avatar SubodhBQT commented on July 3, 2024

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.

jaisan123 avatar jaisan123 commented on July 3, 2024

@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.

iDevelopper avatar iDevelopper commented on July 3, 2024

Can you upload a screenshot please?

from pbrevealviewcontroller.

jaisan123 avatar jaisan123 commented on July 3, 2024

thanks for the response @iDevelopper . im attaching the design i want to achieve
sidemenu 2

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.

iDevelopper avatar iDevelopper commented on July 3, 2024

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.

iDevelopper avatar iDevelopper commented on July 3, 2024

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...

SWTabBarSwift2.zip

from pbrevealviewcontroller.

jaisan123 avatar jaisan123 commented on July 3, 2024

@iDevelopper ,thanks a lotttt man..you saved me.Great thanks to you.Love you.

from pbrevealviewcontroller.

jaisan123 avatar jaisan123 commented on July 3, 2024

@iDevelopper ,im facing an issue ,how can i load the page, i mean the ContainerViewController in the above sample from appdelegate ?

from pbrevealviewcontroller.

iDevelopper avatar iDevelopper commented on July 3, 2024

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.

jaisan123 avatar jaisan123 commented on July 3, 2024

@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.

iDevelopper avatar iDevelopper commented on July 3, 2024

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
    }

SWTabBarSwift2-2.zip

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.

jaisan123 avatar jaisan123 commented on July 3, 2024

@iDevelopper ,thank you sir.it works

from pbrevealviewcontroller.

SubodhBQT avatar SubodhBQT commented on July 3, 2024

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.

iDevelopper avatar iDevelopper commented on July 3, 2024

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
    }

SimpleCollectionView.zip

from pbrevealviewcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.