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

后端 未结 6 1837
佛祖请我去吃肉
佛祖请我去吃肉 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:46

    This are the differences between Swift 1.2 and 2:

    // swift 1.2
    view.autoresizingMask = .FlexibleWidth | .FlexibleTopMargin
    
    // swift 2
    view.autoresizingMask = [.FlexibleWidth, .FlexibleTopMargin]
    

提交回复
热议问题