-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assertion failure in iOS 15 #89
Comments
It is probably a bug that will be fixed in later Xcode versions - some problems with the initializers not visible to objc. However, for now, I got it resolved using this: https://stackoverflow.com/questions/69092599/xcode-13-beta-5-error-uiviewcontroller-is-missing-its-initial-trait-collection I will try to put this into a PR |
Ok, so I tried my solution, but it turned out that your last convenience initializer that finally calls super.init(style:) uses an array of Acknow, which is a struct. Therefore, this initializer cannot be exposed to The solution would be to expose all convenience initializers to
And then calling
It seems to be your only solution for now is to remove the above convenience initializer, which means acknowledgements have to be set after initialization. Or hope that Apple fixes this annoying bug anytime soon. Something really hacky might work too: Something like this:
|
On iOS 15 using Xcode 13 RC, the initializer will crash unless the init(style:) initializer is overridden. Solution taken from https://stackoverflow.com/questions/69092599/xcode-13-beta-5-error-uiviewcontroller-is-missing-its-initial-trait-collection
On iOS 15 using Xcode 13 RC, the initializer will crash unless the init(style:) initializer is overridden. Solution taken from https://stackoverflow.com/questions/69092599/xcode-13-beta-5-error-uiviewcontroller-is-missing-its-initial-trait-collection As I describe in the issue, the struct Acknow cannot be exposed to @objc. Therefore, a class AcknowClass was specified that is used in the initializer and then transformed into the Acknow struct. This is really hacky and breaks all projects using the init(acknowledgements:style:) initializer directly, but it solves the crash in iOS 15 when using Xcode 13 RC.
So this actually works. I'll create a PR for you to test and then you can decide whether you want this hacky and breaking change or wait until Apple fixes this bug (hopefully...) |
@psalzAppDev - used your code/fork and confirmed it works here also. TY so much! iOS 15 is coming bugs or not! :) |
Thank you so much for reporting this issue, and for preparing the pull request! I’m not sure we should merge it as-is, though. Is it really just a bug, or just how the latest Swift compiler works? I would love to better understand the issue before touching the initializers interface. Any indication about what is going on exactly? But in the meantime, I’m glad we have your workaround for folks who would need it. |
I agree, this is a messy fix and I hope that this is an internal bug that will soon be fixed. There is not much information around about it though. I can't believe that this behavior is intended. On the downside, anyone who uses your framework will notice that the app crashes on iOS 15. So hopefully they find their way to this thread and can decide whether to use my PR for now to keep their app working. That's what I did when I noticed that my app crashed on my iOS15 test device. When new Xcode versions arrive, I will test for this bug and report back to you. |
My $0.02 - this will be the shipping iOS 15 and the impact is that AcknowList will fail on open every time - so the impact to AcknowList is as major as it gets, starting next week when iOS 15 drops. I'd implement the workaround unless & until Apple's build allows the current initializer code to function without failure. Considering the length of the iOS 15 beta I'd suggest it won't be anytime soon... :/ |
@jminutaglio Agreed, we should address that as soon as possible. I have found a different solution, though. The problem somehow comes from the interoperability between Swift and Objective-C code. If we remove the What do you think? |
@vtourraine - makes sense to me. I'd guess most projects have moved from Obj-C to Swift at this point, so the impact to folks using AcknowList may be minor/none... |
@vtourraine - AcknowList 2.0.2 is still throwing the assertion failure on iOS 15 - FYI. :( |
Hum, it gets weirder indeed. The crash is fixed for the “AcknowExampleManual” project, but not for the “AcknowExampleCocoaPods”. 😞 Looking into it... |
Alright, I reimplemented the |
@vtourraine - looks good here. Confirmed fixed! TY! |
@jminutaglio Glad to hear it, thanks for the feedback 👍 |
Using:
On Xcode 13 RC (Version 13.0 (13A233)) ->
On Simulator iOS 14.5 -> expected behavior (AcknowList viewController shows)
On Simulator iOS 15.0:
Same codeline, just an error on iOS 15...
Any ideas? ty in advance. AcknowList is awesome btw!
The text was updated successfully, but these errors were encountered: