i can't apply curl animation on image - objective-c

How to apply curl animation on Image.( i want animation like Books page turn from left to right or vice versa. so anyone know about it please help me for this.

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[oldView removeFromSuperview];
[UIView commitAnimations];
This thread may be a valuable resource:
http://www.iphonedevsdk.com/forum/iphone-sdk-development/18548-pagecurl-animation-os-3-0-a.html

Related

How to flip two views Objective C iOS 13

I have two views that flip (like Turing over a card horizontally). iOS 13 has depreciated the begin animations code and I'm trying to figure out how to use [UIView animateWithDuration:delay:options:animations:completion:]
CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView:self.ABCard cache:YES];
[self.ABCard exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
[UIView setAnimationDelegate:self];
[UIView commitAnimations];
I'm trying to do the following but the animation just switches views instantly with no flip action.
[UIView animateWithDuration:1.0 delay:1.0
options: UIViewAnimationCurveEaseInOut | UIViewAnimationTransitionFlipFromLeft
animations:^{
[self.ABCard exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
} completion:^(BOOL finished){
}];
exchangeSubviewAtIndex doesn't change the look of the animation so it's won't result in an animation, which is why you just see it flip.
Results from this answer may help you with a proper solution: iPhone Flip Animation using UIViewAnimationTransitionFlipFromLeft in landscape mode

I am making an app and I put an iAd but I want it to hide when not available

I am making an application, that has iAd, but when I am not connected to the internet the space where the iAd is supposed to be, is a white empty space, how do I make it so the iAd space is not white, and is the same color as the background
If you could give me some code, that will be nice.
Thanks in advance!
Add this in your .m file. This method checks if an Ad can be loaded. If it can't, it uses a nice animation to make the white space disappear. I'm also a noob to iOS programming, but this is how I did it in one app that I have in the App Store. I'm not sure if this is the best way but it works.
-(void)bannerViewDidLoadAd:(ADBannerView *)banner
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[banner setAlpha:1];
[UIView commitAnimations];
}
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[banner setAlpha:0];
[UIView commitAnimations];
}
Check this
iAd sample code
iAd Example
Shared iAd example

Can I horizontal filp the UIButton?

I've some problem with UIButton.
In my case I have to flip the button horizontally.
I tried it's width to minus value. But it doesn't work.
How can I do this?
Simply set its transform to CGAffineTransformMakeScale(-1.0, 1.0).
If you want it to rotate 360 degrees horizontally:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.75]; // transition speed
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.YourButton cache:NO];
[UIView commitAnimations];

Stop user interaction on view

My code does an animation that flips from right to left. The problem is while its switching, only a .75 second animation, the user is still able to interact with the program. I dont want them to be able to, is there a way to stop all user interaction for a short time, or just a way to stop it completely, then i can just use a timer to put it back on. here is my code for the animation:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight
forView:[self view]
cache:YES];
[UIView commitAnimations];
Thanks, Jacob
Try:
[self.view setUserInteractionEnabled:NO];

UIButton Buy Now effect

I want to make a "Buy Now" button in my Application, which should work the same way as the one in the App Store, but I dont know how to resize the UIButton with an animation.
I have tried the following, but it resized the button at once and not as an animation:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:10.5];
[buyButton setFrame:CGRectMake(20, 115, 70, 21)];
[UIView commitAnimations];
Where the "buyButton" is a UIButton.
I've checked ou this post UIButton AppStore buy button animation, but is does not seem to work.
Try this:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:duration];
CGAffineTransform scale = CGAffineTransformMakeScale(scalingFactorX, scalingFactorY);
buyButton.transform = scale;
[UIView commitAnimations];
Using CGAffineTransform may help. I have not tried this, however, it should work.
the sample code on theapptree.com for the inapp purchase should do what you want.
http://www.theapptree.com/samples