Variable 'xxx' was never mutated, consider changing to 'let'

前端 未结 5 1102
北荒
北荒 2020-12-17 10:40

Updated to xcode7-beta I run across a new kind of warning. Here is my code

override func layoutAttributesForElementsInRect(rect: CGRect) -&g         


        
5条回答
  •  悲&欢浪女
    2020-12-17 11:31

    You have created that object as var object but value of that object not changing then after better to make it let. That's it.

    As per Apple Developer Guidelines, create var object if value of that object is going to change else create let variable. Best practise

提交回复
热议问题