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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:24:10+00:00 2026-06-08T18:24:10+00:00

i’ve been looking through loads of tutorials and questions about this but can’t seem

  • 0

i’ve been looking through loads of tutorials and questions about this but can’t seem to find what I’m looking for and I have a feeling I’m just missing a simple step.. I’m still learning the ropes so bear with me on this one..

I’m making an image randomizer on xcode 4.3.3 and i have been able to do it with a button to randomize the images, but i want it to respond to a swipe gesture. the whole window is covered by a UIImageView object so i just want an app that randomizes images by swiping so i want to be able to swipe the UIImageview. this is what I have:

in my .h file:

@interface ViewController : UIViewController <UIGestureRecognizerDelegate> {
IBOutlet UIImageView *quotePage;

}

-(IBAction)random;
-(void)screenWasSwiped;

@end

and in my .m file:

@interface ViewController ()

@end

@implementation ViewController

-(IBAction)random {
int image = rand() % 4;
switch (image) {
    case 0:
        quotePage.image = [UIImage imageNamed:@"Quote1.png"];
        break;
    case 1:
        quotePage.image = [UIImage imageNamed:@"Quote2.png"];
        break;
    case 2:
        quotePage.image = [UIImage imageNamed:@"Quote3.png"];
        break;
    case 3:
        quotePage.image = [UIImage imageNamed:@"Quote4.png"];
        break;
    default:
        break;
}
}


-(void)viewDidLoad {
UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc]         initWithTarget:self action:@selector(screenWasSwiped)];
swipeLeft.numberOfTouchesRequired = 1;
swipeLeft.direction=UISwipeGestureRecognizerDirectionLeft;
[self.view addGestureRecognizer:swipeLeft];
quotePage.userInteractionEnabled = YES;

}

@end

I thought it would be possible to connect the ‘random’ action to a swipe gesture in storyboard, but it hasn’t worked. the thread 1 message is:

2012-07-27 15:04:32.012 QuoteRandom[1057:c07] -[ViewController screenWasSwiped]: unrecognized selector sent to instance 0x6868210

so i think i have to connect ‘screenWasSwiped’ to the image randomizer and also apply the swipe gesture to the UIImageView but I am struggling to figure it out. I would appreciate any guidance! thanks in advance!

  • 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-08T18:24:11+00:00Added an answer on June 8, 2026 at 6:24 pm

    You can call your -(IBAction)random method in your UISwipeGestureRecognizer changing it init method to:

    UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(random)];
    

    This way, every time you swipe you will get a new random image.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
I am trying to loop through a bunch of documents I have to put

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.