Xcode 8 :function types cannot have argument label breaking my build

后端 未结 5 920
有刺的猬
有刺的猬 2020-11-29 04:41

It seems that for some reason Swift have chosen to make coding in it less readable by forcing users to remove completion handler parameter labels. I have read the Swift dis

5条回答
  •  春和景丽
    2020-11-29 04:58

    Based on the information above - it appears that the only way to really fix this and ensure that its performant is to raise a proposal to Make argument labels optional with a view to :

    1. improving the speed of development ( without argument labels it requires us to scroll up to the top of the method each time we put in the completion handler.
    2. Reduce Errors : ( I have already had several errors caused due to incorrect completion handler entries especially with those that expect boolean values)
    3. Make code more readable across team members. Not everyone has only one team member and thus being able to easily pick up other peoples code is a must have.
    4. Lastly good programming practice means that the solution should look as much like the actual item being developed. completionhandler: (newvalues, nil) looks less like the item being managed than completionhandler(results: newValue, error:nil)

    I would love for people reading this to share their feedback/ comments on this below before I submit it so I can show there are others that support this.

    Edit: I have submitted the pitch here : https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20161010/028083.html which appears to have been agreed. It looks like its going to happen, however the discussion is whether this is submitted as a Swift 4 improvement ( highly probable)

提交回复
热议问题