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 9198941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:24:29+00:00 2026-06-17T22:24:29+00:00

The problem that I have is that I want to display a map of

  • 0

The problem that I have is that I want to display a map of the world. I want the user to be able to click on a specific country. I know that I can make my UIImages(the pictures of the countries) the images of UIButtons but this does not work in my case because even if a UIButton is a custom button it is in a rectangular shape. Since countries on maps are not rectangular, the buttons will overlap and then when you are trying to click on one country you end up clicking on another. What is the best way to recognize a click from the user and then figure out which image they were intending to click on?

EDIT: I forgot to mention this but if I was able to get the coordinates of a user’s tap, is there a way I could check if the pixel tapped on was a blank/transparent pixel in my UIImage?

  • 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-17T22:24:30+00:00Added an answer on June 17, 2026 at 10:24 pm

    You can add a UITapGestureRecognizer to your UIImageView, which will return both when a user taps the image and the coordinates of the tap itself. From the coordinates you can establish which country the user is clicking.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

with my RCP program I have the problem that I want to have more
I have the following problem that I want to solve in awk. I have
My problem is that I want to have a tab bar view with its
My problem is simple: I have a long list of elements that I want
I have problem with fancybox. I want to write a function that will run
I have a big problem. I want to extract text from html table that
I have the following problem. I want to check that the item clicked on
I have a problem with my site. I want that the shadow stops at
The problem that I have is somehow very specific. I have to implement a
I have a simple problem that I have not been able to find an

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.