Is there anyway I can sort a NSMutableArray that contains UIImageView by the UIImageView's frame.origin.y value?
Trying to do the sort before adding the view to make sure the stacking order is correct.
Thank you,
Tee
iphoneobjective-c
Is there anyway I can sort a NSMutableArray that contains UIImageView by the UIImageView's frame.origin.y value?
Trying to do the sort before adding the view to make sure the stacking order is correct.
Thank you,
Tee
Best Solution
You could provide a compare selector:
This method compares NSNumber objects.
You would need to change it to change your view controller coordinates.
To set this compare selector:
This is an example from the Apple documentation.
Here is a similar (but for alphabetical sorting) question.