how to persuade xCode7.2 Swift2.0 to @ 2x and @ 3x senior forum and Apple_ looked ...

var imBackGroundView: UIImageView! func run0002() { self.view.backgroundColor = UIColor(patternImage: UIImage(named: background[Int(arc4random_uniform(UInt32(background.count)))])!) } // bk0001@2x.png = 750x1334 px xCode согласился...на iPhone 6 // bk0001@3x.png = 1242x2208 px xCode тоже не возражает...на iPhone 6+ все хорошо... 

however = would like to ...

  var tele : UIImageView! tele = UIImageView(frame:CGRectMake(0, 510, 375, 160)) // tele0001b@2x.png = 750x320 px признает...на iPhohe 6 tele = UIImageView(frame:CGRectMake(0, 510, 414, 225)) // tele0001b@3x.png = 414x450 px признает...на iPhone 6+ // tele0001b@3x.png = 1242x450 px признает ...на iPhone 6 + // а можно и 1080x450 им все равно...frame есть frame... // но только если присвоение по очереди закомментировать...для своего экрана // т.е. графика в px признается как подходящая tele.image = UIImage(named: "tele0001b.png") self.view.addSubview(tele) // конечно что frame_у скажешь то и будет...но все-таки - не вручную же переключать под свое разрешение... // а без frame = идет Thread 1 : bad instruction... 
  • can you clarify what you want? @2x and @3x system substitutes itself. Do you want the frame to change itself? - Max Mikheyenko
  • the question was resolved through the UIScreen (with gadgets), though in a purely experimental way - to count in any way ... it was necessary that the picture on iPhone6 ​​and iPhone6 ​​+ loaf remained in the same place, although the pictures are different in size - thanks for your attention ... @MaxMikheyenko - user198638
  • Well, post your answer - Max Mikheyenko

1 answer 1

Somehow you are too strange to add a picture. In general, add all the pictures in Assets.xcassets , then ...

 tele.image = UIImage(named: "tele0001b") 

And everything, the picture of the necessary size itself will be tightened.