i new xcode , swift, , have been displaying images using
uiimage(named: "")
instead of contentsoffile. want switch contentsoffile avoid image cacheing. (i have hundreds of images).
i have looked @ questions such one: uiimage using contentsoffile , dozens others recommend following code:
var bundlepath = nsbundle.mainbundle().pathforresource("imagename", oftype: "jpg") var image = uiimage(contentsoffile: bundlepath!)
however code has not been working me. answer in linked question mentions creating group , adding images there, copying "copy bundle resources). i'm afraid don't know means or how this. tried bundling resources in finder .bundle , adding xcode assets, did not work.
could guide me step step on how contentsoffile work? keep in mind new xcode in answers.
thanks in advance! sorry if question poorly written/ improperly formatted, brand new stack overflow.
Comments
Post a Comment