You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But using UIImage(named:... , or with Data from bundle
else if key =="image"{
if let path =Bundle.main.path(forResource:"first", ofType:"jpg"){leturl=URL(fileURLWithPath: path)letdata=try!Data(contentsOf: url)letvalue=UIImage(data: data)
view.setValue(value, forKey: viewKey)}}
EDIT: I think the bundle must be change to something like that let myBundle = Bundle(forClass: self.dynamicType)
some other code to do advanced code
override func prepareForInterfaceBuilder() {
let processInfo = NSProcessInfo.processInfo()
let environment = processInfo.environment
let projectSourceDirectories : AnyObject = environment["IB_PROJECT_SOURCE_DIRECTORIES"]!
let directories = projectSourceDirectories.componentsSeparatedByString(":")
if directories.count != 0 {
let firstPath = directories[0] as String
let imagePath = firstPath.stringByAppendingPathComponent("PrepareForIBTest/Test.jpg")
let image = UIImage(contentsOfFile: imagePath)
self.image = image
}
}
Photos must be categorized
The user defined properties could be xxx.image.category
For each categories we must find free-to-use images
Framework could load
UIImage
orNSImage
, compute the name using pattern and random numbersThe text was updated successfully, but these errors were encountered: