The OptionSetType
got an updated syntax for Swift 2.x and another update for Swift 3.x
Swift 3.x
view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
Swift 2.x
view.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
This are the differences between Swift 1.2 and 2:
// swift 1.2
view.autoresizingMask = .FlexibleWidth | .FlexibleTopMargin
// swift 2
view.autoresizingMask = [.FlexibleWidth, .FlexibleTopMargin]
Try with xcode7-b6:
view.autoresizingMask = UIViewAutoresizing.FlexibleWidth.union(UIViewAutoresizing.FlexibleHeight)
For Swift 3
Xcode 8 b1
:
view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
actual for swift 3.0.2:
view.autoresizingMask = [.layerWidthSizable, .layerHeightSizable]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With