Binary operator '|' cannot be applied to two UIViewAutoresizing operands

后端 未结 6 1819
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-22 23:02

Getting this error in Swift 2.0.

Binary operator \'|\' cannot be applied to two UIViewAutoresizing operands

Here is the code:

6条回答
  •  情话喂你
    2020-12-22 23:44

    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]
    

提交回复
热议问题