I need a corner like in the Maps app.
I tried this code but nothing happens:
- (IBAction) performCurl {
// Curl the image up or down
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:1.0f];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
[animation setType:(notCurled ? #"mapCurl" : #"mapUnCurl")];
[animation setRemovedOnCompletion:NO];
[animation setFillMode: #"extended"];
[animation setRemovedOnCompletion: NO];
notCurled = !notCurled;
[[topView layer] addAnimation:animation forKey:#"pageFlipAnimation"];
}
This my test-project: http://isolute.de/downloads/cornertest2.zip
This was made available in iOS 3.2 and later
UIModalTransitionStylePartialCurl
When the view controller is presented, one corner of the current view curls up to reveal the modal view underneath. On dismissal, the curled up page unfurls itself back on top of the modal view. A modal view presented using this transition is itself prevented from presenting any additional modal views.
This transition style is supported only if the parent view controller is presenting a full-screen view and you use the UIModalPresentationFullScreen modal presentation style. Attempting to use a different form factor for the parent view or a different presentation style triggers an exception.
Available in iOS 3.2 and later.
Declared in UIViewController.h.
See the answer to another question for one solution.
Note however that this answer uses [animation setRemovedOnCompletion: NO]. According to a forum post, apps have been rejected for using this undocumented API method.
Also, the mapCurl animation type is undocumented, and apps have been rejected for using it as well.
Related
I'm new to iOS. I've read lot of tutorial and I see that all most of example using NavigationController in multiple view. We always force to use NavigationController?
If I have a single view, on my view I have a button1, and when I click on that button it's will open a new view. I also have another button2, when I click on button2, a dialog display on original view. So in this case, I still have to use NavigationController? Another controller I can use?
Thanks in advance!
Navigation controller is not an only option... If u made the flow of your app in such a way that it requires navigation,then only u should use navigation controller.. otherwise there is an another option like presentModalViewController,and u can also use hide/show view while showing dialog in your original view. If you can elaborate your question ,then i might help you.
It's mainly for aesthetic reasons and continuity of user experience that you use navigation controller. You of course can use buttons, but navigation controller is more like the standard for multiple views.
It is not necessary to use the Navigation controller..You can give similar kind of side transition(LEFT to Right or right to left) using Quartz-core animation effect.
Home *homeObject=[[Home alloc] init];
CATransition *animation = [CATransition animation];
[self presentModalViewController:homeObject animated:NO];
[animation setDuration:0.40];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromLeft];
[[homeObject.view layer] addAnimation:animation forKey:#"SwitchToView1"];
[homeObject release];
I want to create an 'unfold' animation to a UIView that appears on the screen.
An example of the animation can be viewed in this YouTube video that reviews the SuperList app (Another example of the animation can be viewed in the app's App Store page in the screenshots section).
I have quite good understanding of Core Animation and Objective C, so as with Cocoa and Cocoa Touch. The app will support versions 5.x and 4.x of iOS so, if it is possible, I would prefer a solution that suits both cases.
Moreover, I have googled this question about a thousand times and failed to get any answers, so help will be much appreciated. Thanks ahead, iLyrical.
Apparently, the 'UnCurl' effect is built-in with the framework and is your to use!
All you have to do, is use the animateWithDuration: animation: method of the UIView class and include the animation as follows:
[UIView animateWithDuration:1.0
animations:^{
CATransition *transition = [CATransition animation];
[transition setDelegate:self];
[transition setDuration:0.7];
[transition setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
[transition setType:#"pageUnCurl"];
[self.view.layer addAnimation:transition forKey:#"pageUnCurl"];
[self.view addSubview:someView.view];
}];
The note image (white page) in this case has transparent section (all side) and thus when uncurl happens it looks like only the white part is uncurling.
I have implemented camera in iPhone and taking images and save it in PhotoAlbum.
Now what i want is when i save one image and make button enable for taking second image i want iris to be shown in between.So that it feels excatly like Camera functionality of iPhone.
How i do that please give some suggestion.
Thanks
Apps like Stachematic and Zombiematic actually got away with using this private API ...
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:0.3];
animation.timingFunction = UIViewAnimationCurveEaseInOut;
[animation setType:#"cameraIris"];
[cameraView.layer addAnimation:animation forKey:nil];
I have a CATransition (code below) that moves a view down. How can I specify a location for the animation to start, for example 60, 30.
Here's the code I'm currently using:
CATransition *animation = [CATransition animation];
[animation setDuration:0.5];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromBottom];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
Write your own timing function that does what you want?
EDIT: I was originally suggesting that you subclass CAMediaTimingFunction, but it looks like that might not do the right thing. Instead, try experimenting with setting CATransition.startProgress, though it's a value in [0,1], not a number of pixels (if you're using a linear animation then it should be easy to convert).
I'm still not entirely sure what you mean by "a location for the animation to start", though — transitions apply to the entire view bounds. Normal UIView animations may be more likely to do what you want. If you give more details, it's easier to figure out what the problem you're trying to solve is.
CATransition *animation = [CATransition animation];
[animation setDuration:0.5];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromBottom];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[animation setDelegate:self];
[[self layer] addAnimation:animation forKey:#"popUpAni"];
The above code (contained within an object of UIView class) fades the view in. I want it to slide in, not fade.
No matter what I try:
[animation setType:kCATransitionMoveIn];
[animation setSubtype:kCATransitionFromTop];
The result remains the same. Am I doing something wrong?
EDIT: Sorry, I had that backwards, I meant to say the curlup animation shows as a fade animation on the simulator...
I know for sure the slide animation, just as you've written it, works on the simulator and of course the device. The code in my project is practically verbatim to yours.
Try changing the key you specify in the addAnimation method from "popUpAni" to something else. If that key is used somewhere else in your project, it may be causing this issue.
Also, have you confirmed you are using the correct version of the CoreAnimation Framework? You should be referencing and the QuartzCore.framework reference should be looking within the iPhoneOS frameworks folder.