Swift playgrounds with UIImage

前端 未结 11 1869
轻奢々
轻奢々 2020-12-01 01:36

I am working with Xcode 6, and I\'m trying to recreate the code demoed during session 401 \"What\'s new in Xcode 6\". I\'ve added an image to Images.xcassets (called Sample)

11条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-01 02:34

    For Xcode 9:

    • Select Resources folder
    • Right click then "Add files to "Resources""
    • Use it like: let image = UIImage(named: "no")

提交回复
热议问题