Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Genady Novak](https://secure.gravatar.com/avatar/12dc9c5e35f37eaa08e0819e207c8c2f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Genady Novak
5,164 PointsUIImagePickerController
I'm trying to present UIimageController with animation. The default animation present the UIimageController from bottom to top. How to present UIimageController from top to bottom
(I'm using swift)
Thanks!!
4 Answers
![Noah Hanover](https://secure.gravatar.com/avatar/86e22b066831b926fd104b92f6a1f7a3?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Noah Hanover
13,272 PointsUse the self.dismissViewController function. It took me FOREVER to find this out. I hope it works!
![Genady Novak](https://secure.gravatar.com/avatar/12dc9c5e35f37eaa08e0819e207c8c2f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Genady Novak
5,164 PointsI have UItabBarViewController with bar button that should activate the camera (the same as Instagram). if I will dismiss the view controller it will not present me the camera
![Noah Hanover](https://secure.gravatar.com/avatar/86e22b066831b926fd104b92f6a1f7a3?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Noah Hanover
13,272 PointsI'm not sure that I follow what you are saying. Can you post some of the code up, so that I can take a look?
![Genady Novak](https://secure.gravatar.com/avatar/12dc9c5e35f37eaa08e0819e207c8c2f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Genady Novak
5,164 PointsThe following UIViewController Class is one to the views that loads from my UITabBarController
import Foundation import MobileCoreServices
class CameraView: UIViewController , UINavigationControllerDelegate, UIImagePickerControllerDelegate { var image : UIImage! var imagePicker : UIImagePickerController!
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
self.showCamera()
}
func showCamera(){
if self.image == nil{
self.imagePicker = UIImagePickerController()
self.imagePicker?.delegate = self
self.imagePicker?.allowsEditing = false
if (UIImagePickerController.isSourceTypeAvailable(.Camera)){
self.imagePicker?.sourceType = .Camera
}
self.imagePicker?.mediaTypes = [kUTTypeImage!]
self.presentViewController(self.imagePicker!, animated: false, completion: nil)
}
}
func imagePickerControllerDidCancel(picker: UIImagePickerController) {
self.tabBarController?.selectedIndex = 0
self.dismissViewControllerAnimated(false, completion: nil)
}
}
![Noah Hanover](https://secure.gravatar.com/avatar/86e22b066831b926fd104b92f6a1f7a3?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Noah Hanover
13,272 PointsI understand, you are trying to Present the ViewContoller, but with the same animation as dismissViewControllerAnimated has. I'm sorry, but I'm not sure how to do this. If you look at maybe some stackOverFlow questions, you may be able to find out. If not, try finding a different way to present a view controller
![Genady Novak](https://secure.gravatar.com/avatar/12dc9c5e35f37eaa08e0819e207c8c2f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Genady Novak
5,164 PointsOk thanks for the help