ios - Swift 2 upgrade Swift 3 compile error in many method such as willTransitionToTraitCollection:newCollection:withTransitionCoordinator -
when used swift 3 run old code, , convert them newest swift 3. found method compile error
override func willtransitiontotraitcollection( newcollection: uitraitcollection, withtransitioncoordinator coordinator: uiviewcontrollertransitioncoordinator) { }
and compiler told me "method not override method superclass"
should import modules?
in swift editor of xcode 8 beta 3:
class myviewcontroller: uiviewcontroller { //wait hear ↓ willtransition }
i have got suggestion:
class viewcontroller: uiviewcontroller { //wait hear ↓ override func willtransition(to newcollection: uitraitcollection, coordinator: uiviewcontrollertransitioncoordinator) { <#code#> } }
(you need remove other syntax errors better suggestions.)
anyway, should not yourself. make swift it.
new documentation willtransitiontotraitcollection:withtransitioncoordinator:
here:
Comments
Post a Comment