RxAppState icon indicating copy to clipboard operation
RxAppState copied to clipboard

UIViewController+Rx.swift:50:57: error: type 'UIViewController' has no member 'viewIsAppearing'

Open bimawa opened this issue 1 year ago • 3 comments

After update start catch subj error while build time. Maybe we something missing? p.s. ios14+

bimawa avatar Jan 29 '24 23:01 bimawa

Hi @bimawa Thanks for the feedback. Unfortunately I cannot reproduce this error on my side. Do you have more details? Are you using viewIsAppearing in your code?

pixeldock avatar Feb 01 '24 07:02 pixeldock

No, we don't use this method. I just resolved SPM deps. And can't compile with this version anymore. Currently change on exact: 1.7.1 - this compiled perfect. I can try to reproduce it later, currently busy.

bimawa avatar Feb 01 '24 08:02 bimawa

Please also let me know if there are any updates on this, since I am the one who is works on the PR of viewIsAppearing.

tommyming avatar Feb 15 '24 10:02 tommyming

I am also stuck in this issue please any one can help, I am blocked due to this in ios 14, previously I have solved by installing carthage but again don't know it's showing error

piyushdscg avatar Mar 26 '24 06:03 piyushdscg

previously I have solved by installing carthage

Hey can you provide a sample app with that issue? For Tonny. I'm still busy ...

bimawa avatar Mar 26 '24 06:03 bimawa

yes, I am working on one project in xcode 14.3, but I can also provide one demo app I have also downloaded, in that app also showing error, https://github.com/pixeldock/RxAppState?tab=readme-o Uploading RxappstateIssue.png…

v-file, in that same app showing this error

piyushdscg avatar Mar 26 '24 06:03 piyushdscg

I think this method not available in older sdk.

bimawa avatar Mar 26 '24 06:03 bimawa

@bimawa @piyushdscg @tommyming

Hi guys, I think I found the reason for this issue. Apparently you need Xcode 15 to use viewIsAppearing. The reason for this is that while viewIsAppearing was already added in iOS 13 it was only made public in iOS 17. (Checkout this article for a more detailed explanation)

The easiest solution for this issue would be to use Xcode 15. If for some reason you cannot do that, I added the fix suggested in the article to a separate branch fix/xcode14-viewIsAppearing. I could not test this fix, because I cannot run Xcode 14 on my machine.

Could you please test if this fixes the issue for you?

pixeldock avatar Mar 26 '24 17:03 pixeldock

@pixeldock Thanks for checking out this issue. I agree with your investigation that the method is only public since iOS 17, which is available starting from iOS 15.

I haven't tested on it below Xcode 15 when I create the PR, since it is not available on my Mac anymore.

tommyming avatar Mar 27 '24 00:03 tommyming

I think we may close this issue. I think no reason to fix it. All my users will move on Xcode 15 very soon too.

bimawa avatar Mar 27 '24 05:03 bimawa

Thanks for support, you can close this, I am compelled due to some reason, So can not move to xcode 15, last time I fixed this issue in xcode 14.3 by installing some libraries like carthage etc., but don't know in just 3-4 days this issue again triggered without doing any thing.

Thanks again for the support and for quick response.

piyushdscg avatar Mar 27 '24 05:03 piyushdscg

I found the problem again. It was built in version 15.2 of XCode

'viewIsAppearing' is only available in iOS 13.0 or newer The error occurs in line 47 of the UIView Controller+Rx.Swift.

The error I think is in Package.swift platforms: [ .iOS(.v10) ],

I said that, so I need to modify it to iOS 13 In the code above, I think I need to make an exception that I have to do it on iOS13 or later.

greatsk55 avatar Mar 27 '24 06:03 greatsk55

Hi @greatsk55 thanks for your comment! Have you found ".iOS(.v10)" in the 1.8.0 release of RxAppState? Or are you talking about an older version?

pixeldock avatar Mar 27 '24 08:03 pixeldock

I found it in the master branch. Probably 1.8.0.

greatsk55 avatar Mar 27 '24 08:03 greatsk55

Thanks @greatsk55 for your fix! I'll release a 1.8.1 patch release.

pixeldock avatar Mar 27 '24 09:03 pixeldock