viewcontroller

Segue doesn't work in macOS

时光毁灭记忆、已成空白 提交于 2019-12-08 09:39:47
问题 I have NSSlider in ViewController that must pass integer value to SecondViewController via segue of type Show and update a View every time I move it. So, moving slider I interactively shuffle images in SecondViewController 's window. I spent a week trying to implement such a behaviour of NSSlider but I failed. Maybe I made wrong connections in Interface Builder. I don't know. If you know any other method to make NSSlider work for shuffling images, tell me, please. See updated answer for

Passing data of table view (row select) to view controller

谁都会走 提交于 2019-12-08 08:43:23
问题 mi problem is this: I want to select the first, second... row and the view controller must show the information according to the row selected(label, images, etc), I trying a lot of thing but, not work. I use protocol and this: func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 4 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = self.tableView.dequeueReusableCell(withIdentifier: "cell", for:

How to make a single shared instance of iAd banner throughout many view controllers?

最后都变了- 提交于 2019-12-08 07:00:55
问题 I have tried using a singleton class in my app delegate but I haven't been able to get that to work. I've also checked out the iAdSuite examples (particularly the containerBanner example because it seemed to be the most relative) but I can't figure it out. If there's a better way to accomplish this without using a singleton class and you can point me in the right direction I'd really appreciate it. Some of my singleton class code is below. Thank you! @interface App Delegate @property (assign)

Passing data between segues without using PrepareForSegue

寵の児 提交于 2019-12-07 19:29:55
问题 I'm creating an user setup account with 5 steps using storyboard. Each step have a ViewController: 1º)Input for Name, contact etc, 2º) Import photos, 3º)Input, etc 4º)more inputs 5º)Confirmation Page, if the user click "confirm" -> Get all the inputs and upload to Parse. The only solution i get when i search online for this, is to create a func "Prepare for Segue" and pass the information...But for me, this doesnt make any sense: If i had 1000 viewcontrollers, the first viewcontroller

Reference to the segue source view controller

别等时光非礼了梦想. 提交于 2019-12-06 23:15:44
问题 Within my viewDidLoad I would like some custom code based upon the previous controller. How can I access the segue source controller or the previous segue identifier in the destination controller's viewDidLoad to handle this? 回答1: There is no way to get a reference to the segue that created you. You could create a property (sourceVC in my example) in the destination controller, and assign self to this property in the prepareForSegue method (in the source view controller): [(DestinationVCClass

Unable to select custom class for ViewControllers in Xcode Storyboard

狂风中的少年 提交于 2019-12-06 19:49:42
问题 I just upgraded Xcode to 5.0. I'm still fairly new to cocoa so I hope I'm overlooking something basic. Basically I can't get Xcode to see the custom classes that I want to use as parent classes for view controllers. Originally I wanted to create a custom class for a tableview controller but to simplify the problem I tried it with regular viewcontrollers, but that doesnt work either. What I do: Create new project: Single View Application Add a cocoa class to it (File->New->File->Objective-C

Passing data from a ViewController to a TabViewController

青春壹個敷衍的年華 提交于 2019-12-06 15:52:09
问题 I would like to know what the most efficient way is to pass a variable (say: a string) from one regular ViewController to a TabViewController. (NOT iOS => ONLY OSX) I've been searching and trying different stuff and I know there is the "prepareForSegue" function, but I can't seem te get it working for a Tab View. (I'm trying to pass over 50-70 vars to the next view btw) Is there no way to create a separate file in which I can store all my vars and then import it in the new view controller? I

How to make a single shared instance of iAd banner throughout many view controllers?

◇◆丶佛笑我妖孽 提交于 2019-12-06 15:11:42
I have tried using a singleton class in my app delegate but I haven't been able to get that to work. I've also checked out the iAdSuite examples (particularly the containerBanner example because it seemed to be the most relative) but I can't figure it out. If there's a better way to accomplish this without using a singleton class and you can point me in the right direction I'd really appreciate it. Some of my singleton class code is below. Thank you! @interface App Delegate @property (assign) iAdController *iadc; + (AppDelegate*) sharedApplication; - (iAdController*)sharedAd; @end

Looking for concept for managing game level views, level selection views, preferences view, storing levels, environment variables

时光毁灭记忆、已成空白 提交于 2019-12-06 13:55:19
问题 I'm developing a puzzle game application - watch on youtube - for iPhone, and the actual "in-game" part is almost done . It is a separate Class (subclass of UIView) what initializes with a puzzle clue, puzzle pieces, and is ready to send a message for somebody if the puzzle has solved ("completeness" check invoked on every touchesEnded). Now I'm troubled how to design the whole application pattern programatically. The game needs a main menu view , a puzzle selector view , fromwhich I can

How to Build A Dynamic UIPageViewController

纵然是瞬间 提交于 2019-12-06 13:41:34
问题 I have followed the basic tutorial here to create a UIPageViewController that swipes through different ViewControllers, all of which I create on Main.Storyboard. I want to make an application that generates dynamic ViewControllers, meaning I will have to instantiate the ViewControllers in the UIPageViewController programatically. However, I am trying to take everything a bit further. I am going to have a dynamic set of ViewControllers to display based on data I have in Firebase. On each swipe