presentviewcontroller

Using presentViewController from UIView

北城余情 提交于 2019-12-29 17:43:00
问题 I am creating a title bar for my iOS application and I am making this inside a UIView. The only issue I am having is with the "home button". When the home button is pressed, it needs to go to the home page, which is ViewController. However, it doesn't look as if [self presentViewController:vc animated:NO completion:NULL]; works for UIView. How do I work around this problem ? - (void) createTitlebar { CGRect titleBarFrame = CGRectMake(0, 0, 320, 55); //Create the home button on the top right

Using presentViewController from UIView

两盒软妹~` 提交于 2019-12-29 17:41:52
问题 I am creating a title bar for my iOS application and I am making this inside a UIView. The only issue I am having is with the "home button". When the home button is pressed, it needs to go to the home page, which is ViewController. However, it doesn't look as if [self presentViewController:vc animated:NO completion:NULL]; works for UIView. How do I work around this problem ? - (void) createTitlebar { CGRect titleBarFrame = CGRectMake(0, 0, 320, 55); //Create the home button on the top right

How to dismiss own view controller and present another view controller in a button tap?

怎甘沉沦 提交于 2019-12-29 04:51:14
问题 Let's say I have 3 view controller labeled "A","B" and "C". Right now, "A" is the rootViewController of the window and it presents "B" modally when a button is tapped. In "B", when a button is tapped it is supposed to be dismissed by "A" and then "A" will present C modally immediately.How can one do that? Here's my code in hope of achieving this goal but I was unsuccessful in doing so. At "A" viewController, I declared a property to hold a block at the header file to be called when "B"

Swift 3 present view from appdelget when application was off

断了今生、忘了曾经 提交于 2019-12-25 18:36:26
问题 when the user opening the push notification i present view from appdelget by this code func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { application.applicationIconBadgeNumber = 0; // Clear badge when app is launched if UserDefaults.standard.bool(forKey: "PushOFF") == false { registerForRemoteNotification() } else { UIApplication.shared.unregisterForRemoteNotifications() } return true } func

Warning when Attempting to Dismiss View Controller (Modal within a Modal)

笑着哭i 提交于 2019-12-24 16:35:22
问题 When my iOS app launches for the first time, I automatically open a "welcome" modal like this: UIViewController *intro = [self.storyboard instantiateViewControllerWithIdentifier:@"intro"]; intro.modalPresentationStyle = UIModalPresentationFullScreen; //Show the modal [self presentViewController:intro animated:NO completion:nil]; Inside that modal, the user is instructed to link the app to Dropbox. They tap a button that fires this: [[DBSession sharedSession] linkFromController:self]; This is

ios present view controller immediately after dismissing a previous one

别来无恙 提交于 2019-12-24 16:13:23
问题 In my ios app lets say I have three ViewControllers : A , B , and C . From A I present B and assign A as a delegate. After an action is done on B I want to then dismiss B and present C from A . However, I want to do this without A showing up on the screen at all. This is my code right now, inside class A : -(void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; B *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"B-identifier"]; vc.delegate = self; [self

iOS - get document's URL when QLPreviewController is closed

旧时模样 提交于 2019-12-24 14:12:43
问题 I have this code which previews the PDF file: QLPreviewController *previewController=[[QLPreviewController alloc]init]; previewController.delegate=self; previewController.dataSource=self; [self presentModalViewController:previewController animated:YES]; Now, when I close QLPreviewController or previewController this method is called: - (void)previewControllerDidDismiss:(QLPreviewController *)controller { NSLog(@"You closed the document"); } Now, how I can return the document's or Pdf's URL

How to handle Menu Button action in tvOS remote

最后都变了- 提交于 2019-12-23 18:24:23
问题 I am facing the strange problem with my application. Actually when i am presenting a view controller for play the video. At the video load time user press the menu button the application goes to background. While i have overwrite the Menu Button Action. This is my code. override func viewWillAppear(animated: Bool) { let menuPressRecognizer = UITapGestureRecognizer() menuPressRecognizer.addTarget(self, action: #selector(VideoPlayerViewController.menuButtonAction(_:))) menuPressRecognizer

How to dismiss a stack of modal view controllers with animation without flashing on screen any of the presented VCs between the top and bottom?

梦想与她 提交于 2019-12-23 11:39:12
问题 UPDATED: Fixed via "screenshot" method outline below. This works but is there a more elegant way? How would I go about dismissing a stack of modal view controllers with animation without flashing on screen any of the presented VCs between the top and bottom? Trying to do this with animation isn't working. See code below and inline comments describing my issue. You can copy/paste this code into a new project in Xcode to see for yourself if you'd like! // // ViewController.m // MultipleModals /

Dismiss and present modal view controller with one animation

狂风中的少年 提交于 2019-12-22 05:59:47
问题 The problem is that I don't know how to dismiss and present a view controller with only one transition animation. My storyboard structure is: We can say that A controller is what follows the NavigationController, B is the Startup reference and C is the TabBar ViewController. Both B and C are presented modally with a Cross Dissolve transition. When a user logins into the app (from B ), C controller is presented modally with a Flip horizontal transition. And when a user logouts (from C ), B is