viewcontroller

How to Pop stack in IOS?

旧时模样 提交于 2019-12-13 04:55:37
问题 I am building an iOS application. What I am doing is explained below - There are 3 ViewControllers named as A, B, C. I go to A to B and then to C on button click function. I have to Implement Navigation controller on all three ViewController (A, B, C). Now, when I press back of navigation controller the stack that is followed is C -> B -> A. This is the default behavior. What I need is the stack operation should be perform like - C -> A. For this I have to Pop B from the stack. How can I Pop

Update the data of a TableViewController after add item

人走茶凉 提交于 2019-12-13 00:48:31
问题 I have tableView (A) responsible for listing items CoreData and viewController (B) to add new item. To create a ViewController (B) custom, they chose to use the following Present Modally to use presentation Over Current Context to enable transparent background and be able to apply the blur. From tableView (A) press the button to add a new item, the viewController (B) appears. Add a new item and saved in CoreData The viewController (B) execute self.dismissViewControllerAnimated(true,

How to pass data backwards to a view controller after passing forward?

ぐ巨炮叔叔 提交于 2019-12-12 23:46:51
问题 Im developing a quiz app and there is a second view controller that appears after the initial view controller where you are asked to answer a question. On the second view controller you the user must press a button to return to the initial view controller to be asked another question. However when I segue back from the second view controller I believe a new instance of the initial view controller is being created and the user is asked questions they have already answered. The code in the

Passing values between ViewControllers based on list selection in Swift

爱⌒轻易说出口 提交于 2019-12-12 17:24:30
问题 I'm trying to pass the selected index number of a listView selection from one ViewController to another but am running into an issue with the tableView didSelectRowAtIndexPath delegate runs slightly later than the prepareForSegue function. Basically, in didSelectRowAtIndexPath, I seta variable, which is then picked up in the prepareForSegue. The issue is that prepareForSegue seems to run the second that the cell is selected and before the didSelectRowAtIndexPath function is called so my

“Present as Popover” segues and view size

强颜欢笑 提交于 2019-12-12 11:29:50
问题 Can anyone point to any guidance/documentation on how items should be placed in a view controller that will be displayed as a popover so that the components are appropriately positioned with auto layout? Specifically: I'm working in Xcode 8.3 with the new "Present as Popover" segue, with the new "universal" storyboards. I add a view controller and then a popover segue to that view controller. When it is displayed, I see that roughly the top-left quadrant of the view controller is displayed as

How to pass data to a UIViewController from a UITableViewRowAction in Swift?

走远了吗. 提交于 2019-12-12 10:24:27
问题 I'm new to iOS programming, and I've been searching for how to do this, but can't seem to find what I'm looking for. I thought this would be a fairly easy task, and I'm sure it is if someone can enlighten me. When you swipe left on a table view I have some custom actions that can be performed. One of those actions is a simple "Edit" of the item selected. All I want to do is display another view controller but pass some data to that view controller like how it's normally done in

How to dismiss VIewController iOS Swift

你说的曾经没有我的故事 提交于 2019-12-12 06:56:25
问题 I am new to iOS development. I am developing an application using iOS Swift. I have 3 view controllers viewController1, viewController2, viewController3. When I click from viewController1 its move to viewController2. By using the following code let storyboard = UIStoryboard(name: "Main", bundle: nil) let secondViewController = storyboard.instantiateViewControllerWithIdentifier("viewController2") presentViewController(secondViewController, animated: false, completion: nil) Now I am moving from

Calculate the time between the switches of a View Controller and another View Controller

妖精的绣舞 提交于 2019-12-12 06:35:42
问题 I created my UIView class showing an internal activity indicator. This view informs you that at that time the application is performing an operation. I'm trying to apply this UIView also login in my app but I have a problem ... I would like to be able to calculate the time that the app takes from the moment the user enters his username and password, up to the moment when access to the home screen of the app. In that moment of time I would see my UIView which informs you that at that moment he

Viewcontroller Dealloc Method Never Gets Called

这一生的挚爱 提交于 2019-12-12 05:03:57
问题 I know there are many questions like this. I read all. My problem is very simple. I created a single view app from xcode file>new project>single view app. Then i added a second uiviewcontroller in storyboard and a new viewcontroller class named secondViewController. I dragged a button to main viewcontroller and by ctrl+drag to secondViewController on storyboard. I did the reverse in secondViewController. And just added dealloc functins with nslog to class files. I also added weak references

iOS NSDictionary pass through function

烈酒焚心 提交于 2019-12-12 04:58:36
问题 I have my view controller named SecondViewController and when user selects which article wants to read, I want to navigate to ThirdViewController and pass NSDictionary with article data. - (void) touchButtonBlock:(NSInteger) select { NSLog(@"touchButtonBlock"); NSDictionary *dict; switch (select) { case 0: { NSMutableDictionary *tmpDict = [[NSMutableDictionary alloc] init]; NSMutableDictionary *val = [[NSMutableDictionary alloc] init]; [val setObject:@"article360.html" forKey:@"page"]; [val