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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:34:55+00:00 2026-05-22T15:34:55+00:00

hi friend i created this method for image select it working proper but i

  • 0

hi friend i created this method for image select it working proper but i am facing problem on image when i touch the image i cant see image click or not i want highlight the image when i touch on it how can i do this

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    UITouch *touch = [[event allTouches] anyObject];
    CGPoint location= [touch locationInView:self.view];
    if(CGRectContainsPoint(firstImage.frame, location)) 
    {
        //  flag like
        select=1;        
    }
    else if(CGRectContainsPoint(secImage.frame, location))
    {
        select=2;        
    }
    [mComment resignFirstResponder];

}

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

    UITouch  *touch = [[event allTouches] anyObject]; 
    CGPoint location = [touch locationInView:self.view];

    if(CGRectContainsPoint(firstImage.frame, location)) {   
        if(select==1) {

            var=1;
        }}
    else if(CGRectContainsPoint(secImage.frame, location))  { 

        if(select==2) {
            vars=1;
        }}
    select=0; 
}
  • 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-05-22T15:34:56+00:00Added an answer on May 22, 2026 at 3:34 pm

    One thing you can do for highlight the image when you touch on it. When you touch on image you should change the alpha of selected image in touch began method and reset the image alpha in touch ended method. So its look like button.

    For Ex.

    -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
        UITouch *touch = [[event allTouches] anyObject];
        CGPoint location= [touch locationInView:self.view];
        if(CGRectContainsPoint(firstImage.frame, location)) 
        {
            //  flag like
            select=1;        
            firstImage.alpha = 0.5;
        }
        else if(CGRectContainsPoint(secImage.frame, location))
        {
            select=2;        
            secImage.alpha = 0.5;
        }
        [mComment resignFirstResponder];
    
    }
    
    - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { 
    
        UITouch  *touch = [[event allTouches] anyObject]; 
        CGPoint location = [touch locationInView:self.view];
    
        if(CGRectContainsPoint(firstImage.frame, location)) {   
            if(select==1) {
                firstImage.alpha = 1.0;
                var=1;
            }}
        else if(CGRectContainsPoint(secImage.frame, location))  { 
    
            if(select==2) {
                secImage.alpha = 1.0;
                vars=1;
            }}
        select=0; 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using this: Can I use Facebook's fb:friend-selector in an iframe? I created a multi-friend
I have this code I been working on but I'm having a hard time
This problem must have been solved a million times, but Google has not been
I created a simple PHP site for a friend last year. I went to
I've created a site for an artist friend of mine, and she wants the
I just created an iPhone app and am having friends try it out, but
I need to create a url scheme like this friend/{userid}/wishlist where friend is the
redirect_to :controller=>'groups',:action=>'invite' but I got error because redirect_to send GET method I want to
I have this code to represent bank: class Bank { friend class InvestmentMethod; std::vector<BaseBankAccount*>
I have created an advent calendar for the blog of a friend, and to

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.