Reputation: 83
Previous developer using R.swift
to load resources.
And I delete it from Cocoapods, then I using
let image = UIImage.init(named: "testimage")
to load image from xcassets, and it return nil
.
And I load testimage in xib, it works.
I have no idea why I can't load resources from xcassets by using code.
Upvotes: 0
Views: 191
Reputation: 310
First of all check Your assests file - make sure your given image name is same as store in assests..
second way..
either You can use the image literal easily...
let image = image literal (select Your image)
Upvotes: 1