Why can't I use the new inline #imageLiteral syntax in Xcode 8? “Expected expression in return result”

前端 未结 2 2043
暖寄归人
暖寄归人 2021-01-18 06:43

I\'m trying to use the new #imageLiteral inline image assignment from your assets folder in Xcode 8, where instead of the whole UIImage(named: \"\")

2条回答
  •  广开言路
    2021-01-18 06:56

    You should check Swift Version.

    Build Settings > Use Legacy Swift Language Version = NO
    

    Image Literal is only supported on Swift3.0, not Swift2.3.

提交回复
热议问题