uiviewcontroller

Use initWithNibName with a storyboard

烈酒焚心 提交于 2019-12-22 10:44:12
问题 Below is an example of using initWithNibName with separate xib views: TerminalViewController *ctrl = [[TerminalViewController alloc] initWithNibName:@"ControllerView" bundle:[NSBundle mainBundle]]; ctrl.appDelegate = self; viewCtrl = ctrl; However i need to implement it with a storyboard UI layout. For 'initWithNibName' how can i point to a View in my storyboard: i.e. : TerminalViewController *ctrl = [[TerminalViewController alloc] initWithNibName:@"STORYBOARD.ControllerView" bundle:[NSBundle

How to remove UIParallaxDimmingView in pop UIViewController?

心已入冬 提交于 2019-12-22 10:36:42
问题 I have a UIViewController vc1 which is pushed after UIViewController vc2 . Both vc1 and vc2 are with transparent background. Problem: When I try to pop vc2 with interactive pop gesture (pan from edge), in my view stack appears mysterious UIParallaxDimmingView which darkens my stack (under transparent view controllers there is a background image). As soon as I release finger, cancel or finish transition it becomes clear/transparent again. How can i disable/remove UIParallaxDimmingView or set

UISplitViewController for iphone

你说的曾经没有我的故事 提交于 2019-12-22 10:10:16
问题 I want to create an iPhone (not iPad) app with a split screen view that shows two view controllers on the same screen, one on the left and one on the right of the screen (landscape only). Is there a way to make UISplitViewController work for iPhone, or is there an open source library i can use to achieve this look? 回答1: As said, you can not use a split view controller. However, I dont think you need it anyway. Its a little cumbersome and restrictive. You can achieve the effect of the split

Add UIView on UIViewController

拟墨画扇 提交于 2019-12-22 10:07:03
问题 I want to add a "custom" uiview onto a uiviewcontroller, this custom view i created with xib and its a seperate from the view controller, does anyone know how to add a uiview with a xib into a uiviewcontroller? Many thanks in advance 回答1: You mean an additional view, not the main controller view? In that case you can declare a property for the view and load the NIB by hand: @interface Controller {} @property(retain) IBOutlet UIView *extraView; @end … - (void) viewDidLoad // or anywhere else {

Swift Reference Variable from Specific Instance of Different Class

落花浮王杯 提交于 2019-12-22 09:51:37
问题 I'm new to Swift and iOS in general. I'm using Swift to write an app. This app has two files, ViewController.swift and BTService.swift . ViewController.swift has a class ViewController of type UIViewController , and BTService.swift has a class BTService of types NSObject and CBPeripheralDelegate . I have a slider set up in the UIViewController class, and its value is assigned to variable currentValue . Now, I want to be able to reference currentValue from within the BTService class. How can I

want to call a method in the presentingViewController after user has clicked done

我的梦境 提交于 2019-12-22 09:37:41
问题 Noobie iOS developer with an adopted iOS app here. I have a settings piece of an iOS app and when the user clicks done, I want the modal view controller (which it currently does) and I want to call a function called updateMainUI in the presentingViewController. Here's the method I am calling: - (void)done:(id)sender { [[self presentingViewController] dismissViewControllerAnimated:YES completion:nil]; // works [[self presentingViewController updateMainUI]; //doesn't work But I get the

Add objects to an Array from another View Controller

巧了我就是萌 提交于 2019-12-22 09:28:50
问题 I have a HomeViewController which has a tableView populated with the array tableViewArray (originally empty). When I tap on a barButton, I segue modally to another View Controller called OutsideViewController which has another tableView populated by a different array. What I would like to do is the following: When I tap on a row in my OutsideViewController , I would like to add the selected string value to the tableViewArray so that when I go back to HomeViewController , the tableView has

Changing tintColor of UISearchBar inside ABPeoplePickerNavigationController

爷,独闯天下 提交于 2019-12-22 08:07:26
问题 I am tyring to customize the colors a bit in a ABPeoplePickerNavigationController below is my complete code: ABPeoplePickerNavigationController *objPeoplePicker = [[ABPeoplePickerNavigationController alloc] init]; [objPeoplePicker setPeoplePickerDelegate:self]; objPeoplePicker.topViewController.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0.294 green:0.278 blue:0.247 alpha:1.0]; objPeoplePicker.topViewController.searchDisplayController.searchBar.tintColor = [UIColor

Creating a view controller without a nib

旧时模样 提交于 2019-12-22 07:59:31
问题 In AppDelegate, I want to create a UIViewController subclass and add it's view. The viw itself will be specified in code - there is no nib. Based on the apple docs, I should use initWithNibName:nil bundle:nil]; and then in loadView of the controller, I add my subviews etc. However, the follwing test code below does not work for me. I modelled the AppDelegate code on Apple's PageControl demo, simply because my app will implement a similar structure (specifically a base controller to manage a

How to present a ViewController with a UIImagePickerController

无人久伴 提交于 2019-12-22 06:49:28
问题 I'm attempting to present an ImagePicker , and there after the user has selected an image, present an image editing ViewController where the user can manipulate the image and then send the edited image back to the original ViewController . Question: Is there a standard or best practice approach starting with an initial ViewControlle, then present an ImagePicker there after another ViewController to do the imaging editing, and then display it all back in the initial ViewController, all while