How to access the image from the Images.xcassets folder

Here is my code that doesn't work. At first I tried to load an image from a file, now I use a named image:

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UIImage *imageYouWantToPass = [UIImage imageNamed:@"bl_5_00"];

    self.mainImage.image = imageYouWantToPass;
}

If I put the image in the Images.xcassets folder, should the above code work? In other words, if the image does not appear, is it due to an error elsewhere in my code?

+4
source share
1 answer

, "Images.xcassets". . , . .xcassets XCode, .

+3

Source: https://habr.com/ru/post/1531413/


All Articles