John-Lluch / SWRevealViewController

A UIViewController subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right !
Other
4.52k stars 989 forks source link

Xcode 9 Error #738

Open jehartley opened 7 years ago

jehartley commented 7 years ago

At this line: BOOL adjust = controller.Use UIScrollViews contentInsetAdjustmentBehavior instead;

"Use" is problem and xcode gives the error: "Property 'Use' not found on object of type 'UIViewController *'"

This issue didn't't exist on Xcode 8

iDevelopper commented 7 years ago

BOOL adjust = controller.Use UIScrollViews contentInsetAdjustmentBehavior instead;

There is not a such instruction in SW!

    BOOL adjust = controller.automaticallyAdjustsScrollViewInsets;
jehartley commented 7 years ago

Okay. I don't know why it was like that. However, putting what you have, Xcode nows says that is deprecated.

jehartley commented 7 years ago

I found out why it said that. Xcode changed it to that because BOOL adjust = controller.automaticallyAdjustsScrollViewInsets; was deprecated. However, after Xcode changes it, then it gives the error that "Use" is problem and xcode gives the error: "Property 'Use' not found on object of type 'UIViewController *'"

iDevelopper commented 7 years ago

Read the Xcode warning and fix it by yourself. It is a bug!

    BOOL adjust = ((UIScrollView *)controller).contentInsetAdjustmentBehavior;

It will work only for iOS 11.0+, so if you want modify this and target your application for iOS 11-, you have to test the version.

jehartley commented 6 years ago

iDevelepor, there is no reason to be rude.

iDevelopper commented 6 years ago

Sorry? Xcode is rude!!!

kristijanexads commented 6 years ago

@jehartley try like this

        BOOL adjust = false;
        if (@available(iOS 11.0, *)) {
            adjust = ((UIScrollView *)controller).contentInsetAdjustmentBehavior;
        } else {
            adjust = controller.automaticallyAdjustsScrollViewInsets;
        }
Simeryn commented 5 years ago

@kristijanexads thank you. This worked for me.