SWRevealViewController icon indicating copy to clipboard operation
SWRevealViewController copied to clipboard

Xcode 9 issues after update project settings to recommended

Open abara-kedavra opened this issue 8 years ago • 9 comments

After I updated to recommended project settings, I saw a list of issues looks like: "Possible misuse of comma operator here - SWRevealViewController.m" and "This block declaration is not a prototype" in the same file. I'm not an Objective-C programmer and I'm afraid to make mistakes. Should I fix these issues just like Xcode recommend me? 2017-09-29 12 40 51 2017-09-29 12 41 08

abara-kedavra avatar Sep 29 '17 05:09 abara-kedavra

And one more question: I have app in AppStore (it was compile in Xcode 8) and when I first time open side menu - the content of this menu (menu list) appears directly from left to right. But when I make the build of the same project in Xcode 9 and open side menu - first time it looks like what menu list appears from left top corner (small jump from the top), but second and other times it appears strong from the left. That is so strange. The same code, but El Capitan + Xcode 8 and Sierra + Xcode 9.

abara-kedavra avatar Sep 29 '17 07:09 abara-kedavra

It would be very interesting to know how do you open your side menu!

iDevelopper avatar Sep 29 '17 17:09 iDevelopper

OpenSideMenu - it's UIBarButtonItem. I use this code in ViewDidLoad:

        OpenSideMenu.target = self.revealViewController()
        OpenSideMenu.action = #selector(SWRevealViewController.revealToggle(_:))
        self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
        revealViewController().delegate = self

And use button or swipe to open sideMenu

abara-kedavra avatar Sep 30 '17 06:09 abara-kedavra

I did not well understand your problem. Got it now. You don't have a navigation bar on the left and the first time you swipe (not tap the button) to open the menu the table view has a gap of 20 px. It was always the case with SW, even with Xcode 8.

iDevelopper avatar Sep 30 '17 08:09 iDevelopper

Thank you! Maybe I didn't saw it before because it was too fast.

Do you know what it will be better to do with first issue ("Possible misuse of comma..." and etc.)?

abara-kedavra avatar Sep 30 '17 12:09 abara-kedavra

In your rear view controller:

    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        
        tableView.contentOffset = CGPoint(x: 0, y: -20)
    }

For SWRevealViewController.m, there are two solutions:

  1. Add the brackets ans separate the instructions by comma (;) Done in the sample:

SWHomePushSwift 3.zip

  1. Change this library by https://github.com/iDevelopper/PBRevealViewController one with is very similar but maintained . There is a Swift version.

iDevelopper avatar Sep 30 '17 14:09 iDevelopper

Thank you very much!

abara-kedavra avatar Sep 30 '17 16:09 abara-kedavra

If you want some help for https://github.com/iDevelopper/PBRevealViewController open an issue.

iDevelopper avatar Sep 30 '17 20:09 iDevelopper

I recommend that you don't do anything with the warnings about possible misuse etc. Those warnings should be fixed but the code appears to be valid. If you really want to fix it you should add braces and change the commas to semicolons. IMO it's not worth the effort if you're not a C programmer.

phoney avatar Dec 28 '17 20:12 phoney