https://kotlinlang.org logo
#ios
Title
# ios
j

JoakimForslund

05/28/2019, 1:04 PM
Why is shouldAutorotate missing from UIViewController? Is there another way to tell a viewcontroller written in kotlin how rotation should behave?
s

svyatoslav.scherbina

05/28/2019, 2:39 PM
It is not missing. This category member is naturally imported as an extension.
j

JoakimForslund

05/28/2019, 2:53 PM
Hmm, is there an example for this?
s

svyatoslav.scherbina

05/28/2019, 3:09 PM
Example for what?
j

JoakimForslund

05/28/2019, 3:21 PM
On how to setup a shouldAutorotate override
for a viewcontroller
s

svyatoslav.scherbina

05/28/2019, 3:25 PM
This category member is naturally imported as an extension.
You can’t override an extension in Kotlin.
j

JoakimForslund

05/28/2019, 3:41 PM
Allright, so there is no way to implement so that a view controller is locked into for example portrait in kotlin? Sorry I'm not really getting it
s

svyatoslav.scherbina

05/29/2019, 8:10 AM
There is no way to override
shouldAutorotate
in Kotlin. Not sure whether it is the same. Likely depends on your particular use case.
26 Views