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:

willtransitiontotraitcollection:withtransitioncoordinator:


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -