Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Hit Test Function on Image without transparency (swift)

spoot088spoot088 New YorkPosts: 2New Users Noob
I am trying to do a hit test on a image I have loaded into an UIimageView. the image is one object about 50x50 inside of a 300x300 frame. so essentially, its a 300x300 transparent png file with the an object in the middle.

I only want a touch or tap to be registered when the user touches the object. not the actual transparent parts of the image.

how can this be done in swift?

Replies

  • dev666999dev666999 Posts: 3,605New Users @ @ @ @ @
    I can't imagine it's that hard.

    In objective C, you can define a rect, and test for hits within that rect.

    You can assume the same command exists in Swift.
Sign In or Register to comment.