Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
Coordinate Dependent If Statements
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Mark FX" data-source="post: 1579212" data-attributes="member: 211556"><p>What are you trying to check for in your IF conditional statement ?</p><p></p><p>To get the x and y coordinates of your image view within it's superview, you would retrieve it's frame origin, or center origin like this.</p><p></p><p>[CODE]</p><p> CGPoint myImageViewsbottomLetfPoint = myImageView.frame.origin;</p><p> </p><p> CGPoint myImageViewsCenterPoint = [myImageView center];</p><p></p><p> NSLog(@"myImageView's bottom left coordinates x = %f y = %f", myImageViewsbottomLetfPoint.x, myImageViewsbottomLetfPoint.y);</p><p> </p><p> NSLog(@"myImageView's center coordinates x = %f y = %f", myImageViewsCenterPoint.x, myImageViewsCenterPoint.y);</p><p>[/CODE]</p><p></p><p>then you would check the x and y coordinates for a specific value, if that's what you're trying to achieve.</p><p></p><p>Be more specific about what you want to know.</p><p></p><p>Regards Mark</p></blockquote><p></p>
[QUOTE="Mark FX, post: 1579212, member: 211556"] What are you trying to check for in your IF conditional statement ? To get the x and y coordinates of your image view within it's superview, you would retrieve it's frame origin, or center origin like this. [CODE] CGPoint myImageViewsbottomLetfPoint = myImageView.frame.origin; CGPoint myImageViewsCenterPoint = [myImageView center]; NSLog(@"myImageView's bottom left coordinates x = %f y = %f", myImageViewsbottomLetfPoint.x, myImageViewsbottomLetfPoint.y); NSLog(@"myImageView's center coordinates x = %f y = %f", myImageViewsCenterPoint.x, myImageViewsCenterPoint.y); [/CODE] then you would check the x and y coordinates for a specific value, if that's what you're trying to achieve. Be more specific about what you want to know. Regards Mark [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
Coordinate Dependent If Statements
Top