Try something like this:
UIImage *image = [UIImage imageNamed:@"1.jpg"];
[image drawInRect:CGRectMake(0, 0, 30, 30)];
frist.tabBarItem.image = image;
Question
I have this code who, put an image inside a barItem:
frist.tabBarItem.image = [UIImage imageNamed:@"1.jpg"];
It works perfectly, but the image does not appear, because the image have 256x256 pixels, I've heard that the image must have a 30x30 pixels, but I don't wanna to change resolution manually, I want to change this per code, is possible?
Solution
Try something like this:
UIImage *image = [UIImage imageNamed:@"1.jpg"];
[image drawInRect:CGRectMake(0, 0, 30, 30)];
frist.tabBarItem.image = image;
OTHER TIPS
let moreVC = storyboard.instantiateViewController(withIdentifier: "MoreVC")
moreVC.tabBarItem = UITabBarItem(title: "More", image: UIImage(named: "fifth"), tag: 5)
moreVC.tabBarItem.imageInsets.top = 7
moreVC.tabBarItem.imageInsets.bottom = 7