uiviewcontroller

iOS 9 custom transition - animationControllerForDismissedController not called

孤街浪徒 提交于 2019-12-24 00:35:27
问题 I am a newbee in iOS development and recently run into this problem with customized transition in iOS 9. I have an object conforms to UIViewControllerTransitioningDelegate protocol and implements animationControllerForDismissedController , something like: @implementation MyCustomizedTransitioningDelegate #pragma mark - UIViewControllerTransitioningDelegate - (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {

UIViewController as a singleton

♀尐吖头ヾ 提交于 2019-12-24 00:16:22
问题 I have a UIViewController in a tab bar application. I've added the controller from the MainWindow.nib file (i.e. not programatically). My question is how can I make my view controller a singleton? (To resolve the Facebook delegate issue). 回答1: You probably want to make your "Facebook connection code" a singleton (or part of the app delegate), but not the view controller itself. Then just wire up the FB thing with any view controller that needs it. 回答2: If you really want to create singletons

UIAccessibilityContainer in child view controllers?

限于喜欢 提交于 2019-12-23 22:04:43
问题 I have a parent UIViewController to which I add four child view controllers. I’m trying to manage accessibility throughout those controllers. I have a status enum which keeps track of which of those children are visible on-screen, so when that changes, I’m updating the accessibilityElementsHidden of the children as appropriate, and sending a LayoutChanged notification. My question relates to implementing the UIAccessibilityContainer protocol in both the parent view controller, and inside each

Modal UIViewController always coming out full screen on iPad. WHY?

柔情痞子 提交于 2019-12-23 20:50:24
问题 I am trying to create a simple modal dialog on the iPad, in either the small (UIModalPresentationFormSheet) or the larger (UIModalPresentationPageSheet) settings, but they come out full screen (with a title bar) no matter what I do. The modal UIViewController was created in interface builder where I can't seem to specify a size for it. Specifying a smaller size for the UIView contained within the UIViewController has no effect. What am I doing wrong? What would possibly affect this issue?

Difference between navigation controller and viewcontroller?

拥有回忆 提交于 2019-12-23 19:51:54
问题 Difference between navigation controller and viewcontroller? I mean how can we decide when to use navigation controller or a normal view controller? 回答1: Just my two cents: A UIViewController represents a single view and you can put buttons in this view controller to segue to another UIViewController. If you want to segue back to the first UIViewController, you will have to worry about putting a button in the second view controller that leads back to the first. If you are drilling down into

Load ViewController Swift - Black Screen

泪湿孤枕 提交于 2019-12-23 19:07:40
问题 Im trying to simply load a new ViewController and its associated xib when a button is clicked, but the screen becomes black after the new view is loaded. When the button is clicked the following method is called: let vc = MainViewController() self.showViewController(vc, sender: nil) I am able to debug and see that we are jumping into the viewDidLoad method of the new "MainViewController" class, but the UI is not rendering and the screen is black. I have set the File's Owner of

iOS willRotateToInterfaceOrientation proper usage

时光怂恿深爱的人放手 提交于 2019-12-23 18:32:24
问题 I have a very simply UIViewController, and I'm trying to figure out how to use willRotateToInterfaceOrientation. my UIViewController has a very simple viewDidLoad method: -(void)viewDidLoad { [super viewDidLoad]; theBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 48.0f)]; theBar.tintColor = [UIColor orangeColor]; UINavigationItem *item = [[UINavigationItem alloc] initWithTitle:@"The Title"]; item.hidesBackButton = YES; [theBar pushNavigationItem:item animated:YES];

Change label from a different view [closed]

感情迁移 提交于 2019-12-23 18:16:38
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . This is mainly a delegation question because I'm still learning and don't get it. I don't know how to go about creating the delegate I need. I know similar questions have been asked but the solutions don't help

Segue Unwind back to the last specific View controller

妖精的绣舞 提交于 2019-12-23 16:30:46
问题 Is there a way to have one button unwind back to a specific view controller? For example suppose I have ViewController A and B. Both modally segue to ViewController C. Now I understand how to segue unwind back to one of the previous view controllers (As was explained here) but how do I go back to the specific view controller that presented VC C? So to sum it up, what I'm trying to figure out is... If A segued to C then I want to unwind back to A when the button is selected. If B segued to C

iOS Swift: UIViewControllerAnimatedTransitioning end frame in wrong position

元气小坏坏 提交于 2019-12-23 15:45:03
问题 I have a Swift project, learning a weather API and also trying to get a better handle on the AnimatedTransitions. I have a UITableView using a custom UITableViewCell with images and text. Tapping a cell in the tableView transitions to a new UIViewController as a Show (push), with the whole thing embedded in a UINavigationController . When the transition is invoked, the image from the cell is supposed to move to the final location of the UIImageView on the destination viewController. However,