Closed psalzAppDev closed 2 years ago
Alright, I’ve just published a new version, 2.0.2
, that rolls back the Objective-C compatibility (we’ll try to find a nicer solution to bring it back with a later version). I hope that completely fixes the Xcode 13 issue.
I'm still getting a crash after presenting Acknowlist. It was working fine in iOS 14. I'm using Xcode 13 final & iOS 15 final.
@lukemmtt Thanks for the feedback. I’ve just tried with the latest Xcode release, but I can no longer see the crash. Could you share the piece of code you use to present/configure your controller?
2.0.3 fixed the issue for me. Thanks for creating this great little tool and for fixing the Xcode 13 issues so promptly!
@lukemmtt Good to hear, thanks for the confirmation 👍
I described my changes in detail in https://github.com/vtourraine/AcknowList/issues/89.
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
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
@objc
.The solution is to expose all convenience initializers to
@objc
and then overridinginit(style:)
, like this:And then calling
self.init(style: style)
in the convenience initializer instead ofsuper.init(style: style)
: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.
I fixed the problem, but it is hacky and breaks the standard initializer, so all projects using it have to be updated slightly:
Duplicate
Acknow
as a class inheriting fromNSObject
, thus exposing it to@objc
. Then replace thestruct Acknow
array in the initializer with theclass Acknow
array and create astruct Acknow
array by copying the values.