[view interaction] Question

Discussion in 'iOS Development' started by JoshuaCaputo, Dec 15, 2008.

  1. JoshuaCaputo

    JoshuaCaputo New Member

    Joined:
    Aug 2, 2008
    Messages:
    605
    Likes Received:
    0
    Device:
    iPod touch
    I basically want to have something happen when I have one view (ello) come withing 15px in any direction of another view (hospital),

    I have this
    Code:
    if (ello.center.x == hospital.center.x){
    }
    Obviously its not correct but how would i do this because they will almost never be at the same coordinate.
  2. darc10222

    darc10222 Banned

    Joined:
    Dec 24, 2007
    Messages:
    749
    Likes Received:
    0
    No idea. I would've said:
    Code:
    if (ello.center.x - hospital.center.x <= 15){
    }
    
    But I'm sure that's wrong.

Share This Page