iDevelopper / PBRevealViewController

A UIViewController subclass for revealing a left and/or right view controller above or below a main view controller.
MIT License
80 stars 16 forks source link

want to change from sw to pb reveal controller #38

Closed gramueller closed 6 years ago

gramueller commented 6 years ago

i want to change because it does not work the same way in swift 4 as it has in swift 3 (for example the tableview has a huge gap above it. see the picture down below for reference). if anyone knows a fix for this problem i would be happy if not how can i change as fast as possible ? simulator screen shot - iphone 8 - 2017-12-02 at 12 52 16

iDevelopper commented 6 years ago

I do not think it has anything to do with Swift's version. But maybe with iOS 11 new version and safe area and your constraints. Could you provide a sample here?

gramueller commented 6 years ago

Sure in this swift file is only my basic navigation. it is already half a year old but i haven't changed anything when it comes to swreveal. 0.1 Navigation.zip

iDevelopper commented 6 years ago

This project do not use PBRevealViewController but SW.

gramueller commented 6 years ago

i know. i want to change to pbrevealcontroller with as less issues and as fast as possible or someone can help me with swreveal than i do not have to change :D

iDevelopper commented 6 years ago

I don't know but there is no gap with PBRevealViewController:

Calimba.zip

iDevelopper commented 6 years ago

The modified sample use PBRevealViewController version ObjC but you can use the Swift version.

graycampbell commented 6 years ago

I came across the same problem as @Wapasha. When revealController.isLeftPresentViewOnTop is set to false and the leftViewController is simply a UITableViewController with no navigation bar, there is a space between the top of the view and the status bar.

It happens on devices running iOS 11. It may also be a problem with earlier versions of iOS, but I haven't had a chance to check yet.

graycampbell commented 6 years ago

The gap also appears to always have a height of 20. Perhaps it's because of this method?

https://github.com/iDevelopper/PBRevealViewController/blob/88a85c2002233e8c2c264131ba1674ecbc2ab1cd/PBRevealViewController/Classes/PBRevealViewController.swift#L2440-L2457

graycampbell commented 6 years ago

Never mind. It was a problem with how I was implementing the leftViewController and my constraints, so you can ignore my comments above. Sorry about that!

iDevelopper commented 6 years ago

Ok no problem, I was about to answer.

gramueller commented 6 years ago

I'm sry. I didn't have any time to answer lately. the version you send me still has a white bar on top. is there any way to remove this ?

iDevelopper commented 6 years ago

This is the status bar. You can delete your first cell and embed your table view controller in a navigation controller.

iDevelopper commented 6 years ago

If you want otherwise change the status bar background color you can use:

        guard  let statusBar = (UIApplication.shared.value(forKey: "statusBarWindow") as AnyObject).value(forKey: "statusBar") as? UIView else {
            return
        }
        statusBar.backgroundColor = yourColor
gramueller commented 6 years ago

this is awesome! thank you very much. i will try it later and tell you if it worked.

iDevelopper commented 6 years ago

This an example with navigation controller. And the customisation of nav bar is done in AppDelegate.swift.

Calimba-2.zip