push uiviewcontroller to another viewcontroller with animation from Top - bottom
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
In my project there is feature when user swipe on top bar one screen will appear with top to bottom animation
There are two view controller
oneviewcontroller.m
- (void)swipe
{
listViewController *list_obj=[[listViewController alloc] initWithNibName:@"listViewController" bundle:NULL];
UIViewAnimationTransition trans = UIViewAnimationTransitionCurlUp;
[UIView beginAnimations: nil context: nil];
[UIView setAnimationTransition: trans forView: [self.view window] cache: YES];
[self.navigationController pushViewController:list_obj animated:YES];
[UIView commitAnimations];
}
But this does not give the animation from top-bottom
I want to implement the navigation from
Push := top - bottom
Pop : = bottom - top
please help me
Thank you
ios transition uianimation uinavigation
add a comment |
In my project there is feature when user swipe on top bar one screen will appear with top to bottom animation
There are two view controller
oneviewcontroller.m
- (void)swipe
{
listViewController *list_obj=[[listViewController alloc] initWithNibName:@"listViewController" bundle:NULL];
UIViewAnimationTransition trans = UIViewAnimationTransitionCurlUp;
[UIView beginAnimations: nil context: nil];
[UIView setAnimationTransition: trans forView: [self.view window] cache: YES];
[self.navigationController pushViewController:list_obj animated:YES];
[UIView commitAnimations];
}
But this does not give the animation from top-bottom
I want to implement the navigation from
Push := top - bottom
Pop : = bottom - top
please help me
Thank you
ios transition uianimation uinavigation
add a comment |
In my project there is feature when user swipe on top bar one screen will appear with top to bottom animation
There are two view controller
oneviewcontroller.m
- (void)swipe
{
listViewController *list_obj=[[listViewController alloc] initWithNibName:@"listViewController" bundle:NULL];
UIViewAnimationTransition trans = UIViewAnimationTransitionCurlUp;
[UIView beginAnimations: nil context: nil];
[UIView setAnimationTransition: trans forView: [self.view window] cache: YES];
[self.navigationController pushViewController:list_obj animated:YES];
[UIView commitAnimations];
}
But this does not give the animation from top-bottom
I want to implement the navigation from
Push := top - bottom
Pop : = bottom - top
please help me
Thank you
ios transition uianimation uinavigation
In my project there is feature when user swipe on top bar one screen will appear with top to bottom animation
There are two view controller
oneviewcontroller.m
- (void)swipe
{
listViewController *list_obj=[[listViewController alloc] initWithNibName:@"listViewController" bundle:NULL];
UIViewAnimationTransition trans = UIViewAnimationTransitionCurlUp;
[UIView beginAnimations: nil context: nil];
[UIView setAnimationTransition: trans forView: [self.view window] cache: YES];
[self.navigationController pushViewController:list_obj animated:YES];
[UIView commitAnimations];
}
But this does not give the animation from top-bottom
I want to implement the navigation from
Push := top - bottom
Pop : = bottom - top
please help me
Thank you
ios transition uianimation uinavigation
ios transition uianimation uinavigation
edited Apr 14 '16 at 10:40


itsji10dra
3,60933053
3,60933053
asked Apr 14 '16 at 10:35
iOS developeriOS developer
5618
5618
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can push a view controller top to bottom like follows:
Obj-C:
- (void) pushVC:(UIViewController )dstVC {
CATransition transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromTop;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController pushViewController:dstVC animated:NO];
}
Use the below code to pop view controller from Bottom to Top:
- (void) popVC {
CATransition transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
transition.subtype = kCATransitionFromBottom;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController popViewControllerAnimated:NO];
}
Swift 3:
func open() {
let settingsVC = SettingsVC()
let transition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromTop
navigationController?.view.layer.add(transition, forKey: kCATransition)
navigationController?.pushViewController(settingsVC, animated: false)
}
func close() {
let transition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionFade
transition.subtype = kCATransitionFromBottom
navigationController?.view.layer.add(transition, forKey:kCATransition)
let _ = navigationController?.popViewController(animated: false)
}
I had accepted the answers. It works fine.Thank you
– iOS developer
Apr 14 '16 at 11:04
@iOSdeveloper Thanks :-)
– Dinesh
Apr 14 '16 at 11:09
I would have upvoted but i am not eligible to up-vote yet.But i will definitely do that once i earn that reputation.
– iOS developer
Apr 14 '16 at 11:36
@iOSdeveloper Thanks :-) ... Thats so nice of you :-)
– Dinesh
Apr 14 '16 at 11:59
@iOSdeveloper I will upvote it no problem. :)
– Bhavin Ramani
Apr 14 '16 at 12:00
|
show 6 more comments
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f36620532%2fpush-uiviewcontroller-to-another-viewcontroller-with-animation-from-top-bottom%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can push a view controller top to bottom like follows:
Obj-C:
- (void) pushVC:(UIViewController )dstVC {
CATransition transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromTop;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController pushViewController:dstVC animated:NO];
}
Use the below code to pop view controller from Bottom to Top:
- (void) popVC {
CATransition transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
transition.subtype = kCATransitionFromBottom;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController popViewControllerAnimated:NO];
}
Swift 3:
func open() {
let settingsVC = SettingsVC()
let transition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromTop
navigationController?.view.layer.add(transition, forKey: kCATransition)
navigationController?.pushViewController(settingsVC, animated: false)
}
func close() {
let transition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionFade
transition.subtype = kCATransitionFromBottom
navigationController?.view.layer.add(transition, forKey:kCATransition)
let _ = navigationController?.popViewController(animated: false)
}
I had accepted the answers. It works fine.Thank you
– iOS developer
Apr 14 '16 at 11:04
@iOSdeveloper Thanks :-)
– Dinesh
Apr 14 '16 at 11:09
I would have upvoted but i am not eligible to up-vote yet.But i will definitely do that once i earn that reputation.
– iOS developer
Apr 14 '16 at 11:36
@iOSdeveloper Thanks :-) ... Thats so nice of you :-)
– Dinesh
Apr 14 '16 at 11:59
@iOSdeveloper I will upvote it no problem. :)
– Bhavin Ramani
Apr 14 '16 at 12:00
|
show 6 more comments
You can push a view controller top to bottom like follows:
Obj-C:
- (void) pushVC:(UIViewController )dstVC {
CATransition transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromTop;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController pushViewController:dstVC animated:NO];
}
Use the below code to pop view controller from Bottom to Top:
- (void) popVC {
CATransition transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
transition.subtype = kCATransitionFromBottom;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController popViewControllerAnimated:NO];
}
Swift 3:
func open() {
let settingsVC = SettingsVC()
let transition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromTop
navigationController?.view.layer.add(transition, forKey: kCATransition)
navigationController?.pushViewController(settingsVC, animated: false)
}
func close() {
let transition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionFade
transition.subtype = kCATransitionFromBottom
navigationController?.view.layer.add(transition, forKey:kCATransition)
let _ = navigationController?.popViewController(animated: false)
}
I had accepted the answers. It works fine.Thank you
– iOS developer
Apr 14 '16 at 11:04
@iOSdeveloper Thanks :-)
– Dinesh
Apr 14 '16 at 11:09
I would have upvoted but i am not eligible to up-vote yet.But i will definitely do that once i earn that reputation.
– iOS developer
Apr 14 '16 at 11:36
@iOSdeveloper Thanks :-) ... Thats so nice of you :-)
– Dinesh
Apr 14 '16 at 11:59
@iOSdeveloper I will upvote it no problem. :)
– Bhavin Ramani
Apr 14 '16 at 12:00
|
show 6 more comments
You can push a view controller top to bottom like follows:
Obj-C:
- (void) pushVC:(UIViewController )dstVC {
CATransition transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromTop;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController pushViewController:dstVC animated:NO];
}
Use the below code to pop view controller from Bottom to Top:
- (void) popVC {
CATransition transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
transition.subtype = kCATransitionFromBottom;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController popViewControllerAnimated:NO];
}
Swift 3:
func open() {
let settingsVC = SettingsVC()
let transition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromTop
navigationController?.view.layer.add(transition, forKey: kCATransition)
navigationController?.pushViewController(settingsVC, animated: false)
}
func close() {
let transition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionFade
transition.subtype = kCATransitionFromBottom
navigationController?.view.layer.add(transition, forKey:kCATransition)
let _ = navigationController?.popViewController(animated: false)
}
You can push a view controller top to bottom like follows:
Obj-C:
- (void) pushVC:(UIViewController )dstVC {
CATransition transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromTop;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController pushViewController:dstVC animated:NO];
}
Use the below code to pop view controller from Bottom to Top:
- (void) popVC {
CATransition transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
transition.subtype = kCATransitionFromBottom;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController popViewControllerAnimated:NO];
}
Swift 3:
func open() {
let settingsVC = SettingsVC()
let transition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromTop
navigationController?.view.layer.add(transition, forKey: kCATransition)
navigationController?.pushViewController(settingsVC, animated: false)
}
func close() {
let transition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionFade
transition.subtype = kCATransitionFromBottom
navigationController?.view.layer.add(transition, forKey:kCATransition)
let _ = navigationController?.popViewController(animated: false)
}
edited Jan 3 at 3:08


tdios
1501112
1501112
answered Apr 14 '16 at 10:43
DineshDinesh
917611
917611
I had accepted the answers. It works fine.Thank you
– iOS developer
Apr 14 '16 at 11:04
@iOSdeveloper Thanks :-)
– Dinesh
Apr 14 '16 at 11:09
I would have upvoted but i am not eligible to up-vote yet.But i will definitely do that once i earn that reputation.
– iOS developer
Apr 14 '16 at 11:36
@iOSdeveloper Thanks :-) ... Thats so nice of you :-)
– Dinesh
Apr 14 '16 at 11:59
@iOSdeveloper I will upvote it no problem. :)
– Bhavin Ramani
Apr 14 '16 at 12:00
|
show 6 more comments
I had accepted the answers. It works fine.Thank you
– iOS developer
Apr 14 '16 at 11:04
@iOSdeveloper Thanks :-)
– Dinesh
Apr 14 '16 at 11:09
I would have upvoted but i am not eligible to up-vote yet.But i will definitely do that once i earn that reputation.
– iOS developer
Apr 14 '16 at 11:36
@iOSdeveloper Thanks :-) ... Thats so nice of you :-)
– Dinesh
Apr 14 '16 at 11:59
@iOSdeveloper I will upvote it no problem. :)
– Bhavin Ramani
Apr 14 '16 at 12:00
I had accepted the answers. It works fine.Thank you
– iOS developer
Apr 14 '16 at 11:04
I had accepted the answers. It works fine.Thank you
– iOS developer
Apr 14 '16 at 11:04
@iOSdeveloper Thanks :-)
– Dinesh
Apr 14 '16 at 11:09
@iOSdeveloper Thanks :-)
– Dinesh
Apr 14 '16 at 11:09
I would have upvoted but i am not eligible to up-vote yet.But i will definitely do that once i earn that reputation.
– iOS developer
Apr 14 '16 at 11:36
I would have upvoted but i am not eligible to up-vote yet.But i will definitely do that once i earn that reputation.
– iOS developer
Apr 14 '16 at 11:36
@iOSdeveloper Thanks :-) ... Thats so nice of you :-)
– Dinesh
Apr 14 '16 at 11:59
@iOSdeveloper Thanks :-) ... Thats so nice of you :-)
– Dinesh
Apr 14 '16 at 11:59
@iOSdeveloper I will upvote it no problem. :)
– Bhavin Ramani
Apr 14 '16 at 12:00
@iOSdeveloper I will upvote it no problem. :)
– Bhavin Ramani
Apr 14 '16 at 12:00
|
show 6 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f36620532%2fpush-uiviewcontroller-to-another-viewcontroller-with-animation-from-top-bottom%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown