uiviewcontroller

Closing only the ImagePicker and passing image to ScrollViewController

瘦欲@ 提交于 2020-01-07 02:16:32
问题 I have an ImagePicker that is displayed after a ScrollViewController is presented (1). Question: Once the image is picked from the ImagePicker , how do I dismiss just the ImagePicker so that the ScrollViewController is displayed and then pass the image picked to the ScrollViewController ? (1) Presenting ScrollViewController and ImagePicker let storyboard = UIStoryboard(name: "Main", bundle: nil) let vc = storyboard.instantiateViewControllerWithIdentifier("ScrollViewControllerID") as!

Move UIView up when keyboard appears

吃可爱长大的小学妹 提交于 2020-01-07 02:01:56
问题 Ok so I have gone through almost all questions on SO and tutorials. I am now able to move my UIView up so that it is visible while typing. However the problem is, I want to move the UIView ONLY if the UITextField gets covered by the keyboard, because if it is not, then there is no point in moving the UIView . My code so far: - (void)viewDidLoad { [super viewDidLoad]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name

Intercepting didAddSubview

穿精又带淫゛_ 提交于 2020-01-06 20:07:43
问题 I hope this is a simple question. I need to intercept didAddSubview , but will I need to subclass the UIView in order to override that method? The UIView that I want to override is the UIViewController 's view property, so I just want to know how to go about working with this. Thanks! 回答1: From Apple UIView documentation (see Methods to Override ): When subclassing UIView, there are only a handful of methods you should override and many methods that you might override depending on your needs.

Adding Navigation Item in UIViewController

时光怂恿深爱的人放手 提交于 2020-01-06 19:05:12
问题 I'm trying to add UINavigationItem to my UIViewController as mentioned this answer. However the Navigation bar is not showing in my view. I tried even adding an outlet and setting the title programmatically and also adding the NavigationItem in two different places. Still it doesn't show. This view controller is embedded in a TabBarController. WHat am I missing here? Thanks is advance. 回答1: This view controller is embedded in a TabBarController But is it embedded, first and foremost, in a

equivalent of startactivity & finish in ios?

半腔热情 提交于 2020-01-06 14:46:51
问题 I'd like to replace viewcontroller (same as startactivity & finish or window.location.replace) How do I replace viewcontroller instead of push? 回答1: There's multiple ways to implement this based on your view controller containments. If you have the current view controller on top of the stack of a UINavigationController , then below is one solution: UINavigationController -- root view controller -- view controller 2 -- view controller 3 -- other view controllers in stack -- view controller n -

How to solve a delegate that is still nil

时光总嘲笑我的痴心妄想 提交于 2020-01-06 14:06:04
问题 I am concerned with my 4 view controllers. The first one is the CardWalletViewController which is a table view that is populated by Card Objects that the user has created (the card creation is OK so I won't post the code regarding that). Now, given that this table view is already populated with Card Objects, once the user clicks on a cell, another view controller, named CardDetailsViewController will show up. This will display the current points that the Card has and also the perks. Note that

How to solve a delegate that is still nil

孤人 提交于 2020-01-06 14:05:08
问题 I am concerned with my 4 view controllers. The first one is the CardWalletViewController which is a table view that is populated by Card Objects that the user has created (the card creation is OK so I won't post the code regarding that). Now, given that this table view is already populated with Card Objects, once the user clicks on a cell, another view controller, named CardDetailsViewController will show up. This will display the current points that the Card has and also the perks. Note that

Hiding a UINavigationController on start page

会有一股神秘感。 提交于 2020-01-06 13:57:51
问题 Hi I have a navigationController that starts with a view controller in which in viewDidLoad has: self.navigationController.navigationBarHidden = YES; I click a button on that page and it transitions to a second view controller in which I put: self.navigationController.navigationBarHidden = NO; This works fine until I click the Back button in the navigation bar. How do I keep the navigation bar permanently off the start page but not the transitioned one? 回答1: Add self.navigationController

How to make a PFQueryTableView work inside a UIViewController

冷暖自知 提交于 2020-01-06 12:47:39
问题 I'm trying to figure out how to get the benefits of the PFQueryTableViewController to work inside of a a regular UIViewController that has a TableView embedded in it. Because apparently I can't load data from parse onto my TableView. It just pops up as a blank tableView with none of my information from Parse in it unless the code is ran on a UITableViewController, then it has no problems. But I'm trying to get my program to run on a Table View thats in a UIViewController. And whenever I

UIViewController not being dealloc-ed under the new ARC memory management

≯℡__Kan透↙ 提交于 2020-01-06 08:58:08
问题 I am pushing my UIViewController subclass onto the navigation stack; however, since it is being retained by the navigationController, I 'release' my pointer to it after pushing it onto the stack so that when it is eventually popped the viewController will be dealloc-ed. However, it's not working, the dealloc method for the viewController is never called. The code looks something like this: MyViewController *newViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"foo"];