从:
func removeTeam(var toRemoveTeamItemList:[TeamItem]) {
根据提示:
变成:
func removeTeam( toRemoveTeamItemList:[TeamItem]) {
结果又出错:
Cannot use mutating member on immutable value: ‘toRemoveTeamItemList’ is a ‘let’ constant
‘var’ parameters are deprecated and will be removed in Swift 3
xcode – ‘var’ parameters are deprecated and will be removed in Swift 3 – Stack Overflow
swift3 – ‘var’ parameters are deprecated and will be removed in Swift 3 UIimage Gif – Stack Overflow
swift-evolution/0003-remove-var-parameters.md at master · apple/swift-evolution
改为:
func removeTeam(teamItemListToRemove:[TeamItem]) { var toRemoveTeamItemList = teamItemListToRemove if existedTeamItem(gCurUserItem.curTeamId, teamItemList: toRemoveTeamItemList) { //TODO: need notify user, then begin to switch to remaining some team if available // SingletonRootNC().showViewController(alertCtrl, sender: self) switchToFirstAvailableTeam() for (curIdx, eachTeamItem) in toRemoveTeamItemList.enumerate(){ } |
即可。
转载请注明:在路上 » 【已解决】swift 3出错:’var’ parameters are deprecated and will be removed in Swift 3