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

  • Home
  • SEARCH
  • 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 8485551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:40:49+00:00 2026-06-10T20:40:49+00:00

Initialization : Let’s say that I have 5 labels, tagged 1-5. These 5 labels

  • 0

Initialization:

Let’s say that I have 5 labels, tagged 1-5. These 5 labels are attached to an IBOutletCollection initialized with

 @property (nonatomic, retain) IBOutletCollection(UILabel) NSMutableSet* myLineCollection;

What I want to do:

When my finger touches and moves across the screen, I want to receive which label my finger is over in myLineCollection.

I want to receive this because my end goal is to change the color of the label my finger is currently over from red to blue. But when my finger moves away it should go back to its original color, blue.

I was thinking I should use

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

and / or

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event

and / or

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

I’ve been trying:

To use touches, and and if statement for if the touch was in the label.window, or maybe even c if the touch point is label.frame.length away from label.frame.center.

How can i receive the tag of the current one being touch, and then do something to that tag.
thats all i need

  • 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-10T20:40:50+00:00Added an answer on June 10, 2026 at 8:40 pm

    Hope this would helps you:

    - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
        UITouch *touch = [touches anyObject];
        CGPoint touchPoint = [touch locationInView:self.view];
        //here loops all labels
        for(){
            if (CGRectContainsPoint([lable frame],touchPoint)) {
                //change label's background color
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

let's say I have an instance variable MyObject* test; @property(nonatomic, retain) MyObject* test; .m
Let's say I have a class that needs to do some initialization work in
Let's say I have class that acts as a smart pointer and releases some
I have a producer method that creates instances of—let's say— Person . The instance
Does Java guarantee array initialization? Let's say I use the code char[] uuid =
I have a class (let's name it TheClass ) that is quite often used
Let's say I have some class called loopObject and I initialize every object through
Let's say I have my own elisp code in ~/bin/hello.el . The ~/.emacs file
Let's say I have the following structure declaration (simple struct with no constructor). struct
Let's say i have created myTableViewCell class: #import MyTableViewCell.h @implementation MyTableViewCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString

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.