попробуйте этот код в вашем проекте
NSArray * myArray = @[
[[UIImageView alloc] initWithFrame:CGRectMake(0, 50, 200, 100)],
[[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 200, 100)],
[[UIImageView alloc] initWithFrame:CGRectMake(50, 40, 50, 100)],
[[UIImageView alloc] initWithFrame:CGRectMake(30, 30, 200, 100)],
[[UIImageView alloc] initWithFrame:CGRectMake(10, 50, 200, 67)]
];
myArray = [myArray sortedArrayUsingComparator:^NSComparisonResult(UIImageView * view1, UIImageView * view2) {
if (! CGRectIntersectsRect(view1.frame, view2.frame)) {
return NSOrderedAscending;
} else {
return NSOrderedDescending;
}
}];