Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8599681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:26:56+00:00 2026-06-12T01:26:56+00:00

I have been trying for a few days now to figure this out –

  • 0

I have been trying for a few days now to figure this out – I know it is something simple that I have probably missed but being new to iOS I think I missed something somewhere.

I have an array of image views in XCode and each image view is assigned a frame, what I cant seem to get to work is I want to compare each frame in each object from the array in an if else if statement sort of thing… I can’t figure out how to make the system do something like this…

if frame in the array object at index 0 is (0,0) (90,90) then do something
or if it is (90,90) (90,90) do this instead
otherwise do this…

I know how the if else statements work – I guess my main question is how do I access the frame part of the object in the array for comparison?

I am confused. Please help. I appreciate it. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:26:57+00:00Added an answer on June 12, 2026 at 1:26 am

    I guess you’ll have to compare for each of the attributes in CGRect separately.

    CGRect aRect = [[array objectAtIndex:0] frame];
    if (aRect.origin.x == 0 && aRect.origin.y == 0 && aRect.size.width == 90 && aRect.size.height == 90){
        //do something
    }
    else if (aRect.origin.x == 90 && aRect.origin.y == 90 && aRect.size.width == 90 && aRect.size.height == 90){
        //do something else 
    }
    

    It could be that only the origin.x that you are concerned in your conditional statement, then you can simply to

    CGRect aRect = [[array objectAtIndex:0] frame];
    if (aRect.origin.x == 0){
        //do something
    }
    else if (aRect.origin.x == 90){
        //do something else 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to figure this out for a few days now and
I've been trying to figure this out for a few days now. Could someone
I have been trying to figure out for a few days now why my
I have been trying to do this for a few days now using AVFoundation
I've been trying to figure this for a few days now, with no luck.
I have been struggling for a few days trying to find out how come
So I have been trying and battling with this for a few hours now.
I have been stuck on this for a few days now and it is
I've been hunting around the net now for a few days trying to figure
I've been trying to get this working for a few days now.. flabbergasted. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.