segue

Passing data between View Controllers in Swift (From TableView to DetailViewController)

a 夏天 提交于 2019-11-30 18:06:26
问题 I have two files, MyTableViewController and myViewController. I set UIImageView on TableCell in MyTableVIewController. myViewController does not contain anything. And I created an array called ImageArray which contains an array of Images. What I am aiming to do here is when I click an image on TableCell in myTableViewController, I want the clicked image to appear in the myViewController. And some description about the clicked image beside the image too. I want to use myViewController for

How to share one storyboard scene between multiple UIViewControllers

女生的网名这么多〃 提交于 2019-11-30 16:47:03
问题 I'm completely re-formulating this question having learned that I was originally off track but that having me no closer to solving the problem. With reference to this image... I am wanting to either create or manipulate the segue (highlighted in yellow) in code such that the Master view is any one of a number of subclasses of MFMasterViewController (highlighted in red). When doing this using Nibs I could create a Nib, SharedNib.xib & set the class as MFMasterViewController , then create my

Pass a UIWebView request using prepareForSegue

假如想象 提交于 2019-11-30 16:29:02
I 'm new to IOS and Objective C. The scenario is I have 2 buttons, which open (with segue) 2 view controllers containing a UIWebview. I thought is better to do it with 1 UIWebView so I tried to pass the request object of the webvew and use only one webview controller. so I got the wwwBtn (UIButton that opens a site) and fbBtn (UIButton that goes to a Facebook URL) my viewController and the wwwWebViewController which contains th UIWebView. Here is how I did it. The viewController.h file : @interface ViewController : UIViewController { UIButton *wwwBtn; UIButton *fbButton; } @property (retain,

iOS 5 Segue not working after the first execution

本秂侑毒 提交于 2019-11-30 16:28:43
I'm creating an iOS5 application using the storyboard features. The basic structure is: LoginScreen ---(segue)--> MyScreen ---(press on logout)------(segue back to login screen)-->LoginScreen it's pretty simple. The way I manage the first segue is: - (void) onResponse:(NSMutableDictionary *)response { NSLog(@"Login successful,token received"); // if the Login was successful,store the token NSUserDefaults* userPref = [NSUserDefaults standardUserDefaults]; [userPref setObject:[response objectForKey:@"Token"] forKey:@"AuthToken"]; [userPref synchronize]; //..and let the user getting in [self

iOS 5 Segue not working after the first execution

谁说胖子不能爱 提交于 2019-11-30 16:10:08
问题 I'm creating an iOS5 application using the storyboard features. The basic structure is: LoginScreen ---(segue)--> MyScreen ---(press on logout)------(segue back to login screen)-->LoginScreen it's pretty simple. The way I manage the first segue is: - (void) onResponse:(NSMutableDictionary *)response { NSLog(@"Login successful,token received"); // if the Login was successful,store the token NSUserDefaults* userPref = [NSUserDefaults standardUserDefaults]; [userPref setObject:[response

performSegueWithIdentifier not working

删除回忆录丶 提交于 2019-11-30 15:59:00
I have this code that loads a new UIView (from storyboard) when a button is pressed. goPressed function is fired on button pressed and it calls selectImage function. selectImage opens a UIImagePickerController and lets user select a photo. After user has selected the photo, didFinishPickingMediaWithInfo delegate adds the selected image to a UIImageView. In 'goPressed', after selectImage is performed, it should be performing a Segue at like commented as //1. But nothing happens. performSegueWithIdentifier doesn't seem to be working. And if I don't call [self selectImage] before calling

Swift passing calculated data back to previous view controller

北城余情 提交于 2019-11-30 15:39:02
问题 I am creating my first simple budgeting app. Basically, I take a few user inputs like monthly income & savings goal. Then they click "start", & the app calculates stuff such as, their daily budget etc. Here I'm running into trouble. After all the calculations, I display "how much you can spend each day" (e.g. $20 a day), which I pass forward through segues from their original inputs on the original screen. Now, in this VC ( UserInfoVC ) I created a button which lets them add how much money

Specify direction of “show” (push) segue

白昼怎懂夜的黑 提交于 2019-11-30 15:11:23
问题 Is there a simple way to specify the direction (from left, right, top, or bottom) of a "show" segue (previously called a "push" segue)? The default "show" segue goes from left to right, but I would like it to go from bottom to top. 回答1: I don't believe there is a built in method for achieve that, however you could use Custom Transitions, which were introduced in iOS7. There are plenty of great tutorials out there, I've added some links below and some sample code demonstrating how you could

Swift passing calculated data back to previous view controller

不问归期 提交于 2019-11-30 15:07:02
I am creating my first simple budgeting app. Basically, I take a few user inputs like monthly income & savings goal. Then they click "start", & the app calculates stuff such as, their daily budget etc. Here I'm running into trouble. After all the calculations, I display "how much you can spend each day" (e.g. $20 a day), which I pass forward through segues from their original inputs on the original screen. Now, in this VC ( UserInfoVC ) I created a button which lets them add how much money they spent today. So when they click this "add money spent" button, I open a new VC ( AddSubtractMoney )

(Swift) Unwind segue when multiple view controllers lead to same view?

不羁岁月 提交于 2019-11-30 12:13:00
问题 I am trying to code a hangman game and am having trouble with unwind segues. I have multiple view controllers that all ultimately lead to the same view, where the user plays the actual hangman. However, depending on the presenting controller, I want the game to be in different "modes" (ie: multiplayer, single player, etc.). I am trying to add a play again button that unwinds to the previous view controller, but am unsure how to unwind when there are multiple paths the user could have taken to