Camera in a Container view - ios

I am making an app in Xcode 8 using swift 3. Its a tabbed view application. For one of its tab I want a camera interface. so whenever that tab loads I need to show the camera. I want tab bar to stay there permanent, so I took a container view. I am using ImagepickerController and loading the Camera in ViewDidAppear method. so camera loads along with tab click. The problem is I wanted camera in that specific container size. But UIImageviewcontroller is making the interface in a full screen. Is there any way to force it to that container size or custom camera is the only option?

This is not possible using UIImagePickerController. From the documentation:
Present the user interface.
On iPhone or iPod touch, do this modally (full-screen) by calling the present(_:animated:completion:) method of the currently active view controller, passing your configured image picker controller as the new view controller.
I'm afraid you need to read this:
Fully-Customized Media Capture and Browsing
To perform fully-customized image or movie capture, instead use the AV Foundation framework as described in Still and Video Media Capture. Camera access using the AV Foundation framework is available starting in iOS 4.0.

Try to not use ImagepickerController as the tabbarController's item, just use a UIViewController as item, and the ImagepickerController's view added to the UIViewController's view. so that you can controll the contain size by you self.
[self addChildViewController:self.imagepickerController];
[self.view addSubview:self.imagepickerController.view];
//do something like layout the self.imagepickerController.view at here
[self.imagepickerController didMoveToParentViewController:self];

Related

3D touch implement pop without peek

I want to use 3D touch to navigate to a menu like in the contacts app or apple music. I have created a custom view controller for this however I don't want to use
-(UIViewController *)previewingContext:(id)previewingContext viewControllerForLocation:(CGPoint)location;
because the buttons won't be available to click until I pop into the ViewController.
I guess the alternative is to use
-(void)previewInteraction:(UIPreviewInteraction *)previewInteraction didUpdatePreviewTransition:(CGFloat)transitionProgress ended:(BOOL)ended
and navigate to the ViewController when I get the ended parameter is true.
However I am unsure how to create the blurring and scaling effects manually.

Camera freezes when I come back to viewcontroller containing ARSCNView

I am working on ARKit where I save a video during an ARSession. I present another view controller where I can watch my video. When I come back to my first view controller, the camera seems to be frozen although session delegates are called. I cannot add nodes either.

How to pre-load a camera in a PageViewController so that there is no loading animation?

My app uses three view controllers in a Page View Controller. The user swipes left to access a camera. When the user navigates to the camera view, there is a clunky default camera loading animation. I would like the camera to be pre-loaded so that the user sees a fully active camera the moment they swipe left and by doing so eliminate the loading animation.
The app is fully in Swift and the camera uses AVFoundation with a custom camera switcher and a label.
You can use a shared or global variable for the capture session and initiate/start the capture session when your main VC loads. Then when your user swipes yo the other VC the session will already be in memory and you just need to set the frame.

XCode: MasterDetailsView - DetailsView without Splitscreen in Landscape?

actually I'm quite new with Xcode and couldn't find the answer to the following two questions by a google search:
to make it short: I'm working on an iPad app that displays proposals. For this purpose you should choose a proposal from the table in MasterView and then see the details in the DetailsView in landscape mode (but without the MasterView on the Spitscreen).
So when the app starts in landscape mode, I wanna see directly the first proposal full screen on the DetailsView. And when I tap onto the screen the MasterView should popup/unhide with the other proposals in the table. Is this possible?
I wanna display the PDFs in a WebView like in iBooks. That means that the navigation bar is hidden and only when I tap onto the screen the navigation bar should appear at the top of the screen.
I'm kind of sure this questions have been solved somewhere but I couldn't find anything by search so I hope you can help me anyway :-)
Thanks in Advance!
Q1: Use can use one of many methods to present a view (look up under Apple's doc on UIViewController under "Presenting Another View Controller's Content" heading). Two that I have used are: – presentModalViewController:animated: and – presentViewController:animated:completion: (the latter is the latest addition in iOS 5.0)
So let's say you have a detail controller called MyDetailViewController, in your Master View Controller's implementation file (the .m file), under viewDidLoad method, you would do some thing like this to present it as a full screen view.
MyDetailViewController *myDetailViewController = [[MyDetailViewController alloc] initWithNibName:#"MyDetailViewController" bundle:nil];
[myDetailViewController.view setFrame:CGRectMake(0, 0, 1024, 768)]; //might not need this
[self presentViewController:newDetailViewController animated:YES completion:^{
NSLog(#"complete"); //optional
} ];
To dismiss or hide this MyDetailViewController with a tap or touch, you can use UITapGestureRecognizer or touchesEnded method and using one of the dismiss methods (refer back to Apple's UIViewController again for this).
Q2: I personally have not used UIWebView to display PDF and not sure if iBooks is using UIWebview to do it. But to display a varieties of popular documents formats, you can use either the QLPreviewController class or UIDocumentInteractionController. You can hide the toolbar while the document is displayed.
Good luck.

ios Programming, using UIImagePicker inside UINavigation controller

I want to implement the following type of UI flow in my project
http://imgur.com/77pK3
So, basically the following option, I have to show in popover, and on the basis of user selection, I have to navigate to next view, and then can come back to my main view.
My approach so far is in my main view, i m creating a popover with a navigation controller. The navigation controller root view controller is a subclass of UITableView controller. In UITableView Controller, I am presenting the following two options, and when user selects the "Photo Roll" in table view delagate tableVIewDidSelectROw, I am pushing like this
UIImagePickerController *imgPicker = [[UIImagePickerController alloc] init]]
impgPicker.source = // source type to camera roll
[self.navigationController pushViewController:imgPicker animation:YES]
but after this line I am getting the crash, I even tried using
[self prsentViewController]
but same result.
Any help will be greatly appreciated, and I am running on iOS 5 simulator.
UIImagePickerController is meant to be used as a modal view controller and displayed using the presentModalViewController:animated: method.
You will likely need to define your own view controllers to implement the interface as designed. You can get access to the albums and photos through the ALAssetsLibrary class.

Resources