i want some help in this two things please

+1 mahmoud ahmed · July 31, 2014
hiii hello everyone i want your help guys in this   \/ \/

1- i wanna make pause button for snake i succeeded in stopping the snake with this
"-(IBAction)Play:(id)sender{
Play.hidden = YES;
Pause.hidden = NO;
SnakeMovement = [NSTimer scheduledTimerWithTimeInterval:0.3 target:self
selector:@selector(SnakeMoving) userInfo:nil repeats:YES];
}

-(IBAction)Pause:(id)sender{
Pause.hidden = YES;
Play.hidden = NO;
[SnakeMovement invalidate];
}


but when i swipe he saves the swipe and when i resume he start making the swipes that he saved which lead to gameover


2-i wanna a good code for sharing the result on social media/network like facebook and twitter and instagram i use this
- (IBAction)PostToTwitter:(id)sender {

NSString *message = @"My New Result On Flappy Bat is.... ";
UIImage *imageToShare = [UIImage imageNamed:@"BatUP 2.png"];

NSString *message2 = @"'There is a ScreenShot for your Score in album attach it if you want'";

NSArray *postItems= @[message,imageToShare, message2];

UIActivityViewController *activityVX = [[UIActivityViewController alloc]initWithActivityItems:postItems applicationActivities:nil];

[self presentViewController:activityVX animated:YES completion:nil];

}

-(IBAction)ScreenShot {

UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenshotImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

UIImageWriteToSavedPhotosAlbum(screenshotImage, nil, nil, nil);

}


and connect both of them into one button but the problem is that the user have to search and add the screenshot of the score by himself


i want a buttons connected to facebook, twitter and instagram once the user press it the screenshot of the result be selected and ready for sharing it with some words like "my high score is %i try to beat me if you can"

and btw all this is on single view application

Post a Reply

Replies

Oldest  Newest  Rating
0 mahmoud ahmed · August 9, 2014
about the pause button Xcode dont consider it as an error the problem is that when the player press pause and makes some swaps and then press play the snake will move according to the swaps that the player done while he paused the game which lead to game over for them,,,, and about the score button i kust want it to share the score with screenshot of his score to help in marketing it on facebook, twitter and instgram
  • 1

iOS Development / Swift

126,609 followers
About

This forum is for questions, comments, and general discussion about iOS Development and Swift.

Links
Moderators
Bucky Roberts Administrator