Interesting, and subtle note. If the views have already been added in an .xib file, the views are "weak" and you need to swap with a temp variable. Also some simple math to get the coordinates to match those that you set in your view:
@property (weak, nonatomic) IBOutlet UIImageView *imageView1;
@property (weak, nonatomic) IBOutlet UIImageView *imageView2;
CGRect tempFrame;
tempFrame = self.imageView1.frame;
CGRect tempFrame; // use bounds instead
tempFrame = self.imageView2.frame;
__strong UIImageView * tempView = self.imageView2;
[self.imageView2 willMoveToSuperview: nil];
[self.imageView2 removeFromSuperview];
[self.imageView2 willMoveToSuperview: self.imageView1];
[self.imageViewSkate addSubview: self.imageViewBall];
self.imageView2.frame = CGRectMake(tempFrame.origin.x - self.imageView1.frame.origin.x,
tempFrame.origin.y - self.imageView1.frame.origin.y,
tempFrame.size.width, tempFrame.size.height);
tempView = nil;
catView
has a zero frame so won't display too well – Pinprick[catView.view addSubview:imageView];
needs to be[catView addSubview:imageView];
. And you need to set the frame ofcatView
. – Dunt