Crash on iOS 13: UIImageView setSelected no longer supported
skuske opened this issue · comments
The old versions of this library don't work in iOS 13. Use the latest version.
Hmmm, I installed through Cocoapods...
Then time to update:
$ pod update MultiSelectSegmentedControl
I did that...
And you got version 2.2.0 of MultiSelectSegmentedControl?
If not, maybe try to update again, or:
$ pod repo update
The code you showed in from an old version of the pod. Check your Podfile.lock
to see what version you have.
Will do in about 2 hours - will let you know. Thanks!
OK, mostly this is because by project is an Obj-C project. Any chance to get the Obj-C version of your component to work on iOS 13?
Nothing planned, but you can use the Swift code from Objective-C. It works just fine.
Ok, but then I must add it manually and not through Cocoapods, right?
Not at all, you can use it through Cocoapods. Just try and see.
Well, that is what I did, but then it shows that error and the podfile.lock file says it has v1.2.1 installed... pod update does not install v2
Try this:
$ pod repo update
$ pod update MultiSelectSegmentedControl
Don't know why it wouldn't work, since I have it working from an Objective-C project on my machine.
No luck - I tried all that but it simply does not update. It stays with v1.2.1. I also tried
pod deintegrate
and
pod install
after the above, but still v1.2.1...
I think I will just give up. Many thanks for your rapid help! Much appreciated!
What is your deployment target? Maybe it's a very old iOS version?
Yes, iOS 8.2. Increasing this might help?
Yes. I support iOS 9 in 2.2.0, and iOS 11 in 2.3.0.
That did it! :o) Many thanks!
Glad to hear!
Hi Yonat, great plugin here. Much nicer than stringing together on/off buttons.
I came across the bug report of the older version of your lib not working after updating to IOS 13.
I too have an objective c project and was wondering why I cannot get my storyboard to recognize MultiSelectSegmentedControl as a subclass of UISegmentedControl (as a swift pod).
It seems to find it, but then won't compile with the message "Unknown class MultiSelectSegmentedControl in Interface Builder file ... -[UISegmentedControl setSelectedSegmentIndexes:]"
The builtin UISegmentedControl
changed too much in iOS 13, so I had to rewrite MultiSelectSegmentedControl
as a UIControl
.
This means that in your storyboard you should add a plain UIView
, and then set its class to MultiSelectSegmentedControl
.
Thanks! I am now able to move forward. I totally didn't get that the superclass changed even though I see now that it's the first thing you say in the Usage section.
Out of curiosity, will you angling to get the code to work with UISegmentedControl as the parent ever again?
While it's straightforward to map display settings in the code it was super convenient to have apples presets just by choosing/sublcassing that control.
Thanks again and keep up the great work!
Implementing multiple selection on top of the builtin UISegmentedControl
became close to impossible in iOS 13. I tried it at first, but then it became clear that the implementation would have to be both complicated and brittle. That's why I needed to rewrite the whole thing.
So no, no plans to squeeze this round peg into the square hole. :-)