viewcontroller

How to set a timer to enable/disable buttons

对着背影说爱祢 提交于 2020-01-22 03:39:08
问题 I got an issue. I want to set a timer that could disable the 6 large buttons of my ViewController2. For example : Until the timer reach 100, it's not possible to click on the buttons Clue1Button,Clue2Button,Clue3Button,Clue4Button,Clue5Button,Clue6Button Until the timer reach 200, it's not possible to click on the buttons 2,3,4,5,6 ... How should I do it ? I tried several times, but I failed each time. Thanks for your help Code of my ViewController2 : // ViewController2.swift // PROJET X // /

Swift ViewController does not respond to -getFile, Could not connect action, target class

只愿长相守 提交于 2020-01-17 06:06:28
问题 My code works all fine but there is always two console message every time I run it. app works fine but the messages just bugs me so much. Could anyone tell me what is wrong with my code and what does these console message means,thanks 2016-06-13 14:31:15.014 LazyHackintoshGenerator[1625:37250] Could not connect action, target class LazyHackintoshGenerator.ViewController does not respond to -getFile: 回答1: Likely a control's action in your storyboard is linked to a method getfile that no longer

iOS ShareKit Cancel button is not working with Xcode 4.2

自古美人都是妖i 提交于 2020-01-17 04:07:15
问题 The iOS Sharekit working with previous Xcode but will 4.2 it's not working anymore, When I hit the Cancel button it goes to this routine Inside the SHK.m - (void)hideCurrentViewControllerAnimated:(BOOL)animated { if (isDismissingView) return; if (currentView != nil) { // Dismiss the modal view if ([currentView parentViewController] != nil) { self.isDismissingView = YES; [[currentView parentViewController] dismissModalViewControllerAnimated:animated]; } else self.currentView = nil; } } I

iOS ShareKit Cancel button is not working with Xcode 4.2

筅森魡賤 提交于 2020-01-17 04:07:06
问题 The iOS Sharekit working with previous Xcode but will 4.2 it's not working anymore, When I hit the Cancel button it goes to this routine Inside the SHK.m - (void)hideCurrentViewControllerAnimated:(BOOL)animated { if (isDismissingView) return; if (currentView != nil) { // Dismiss the modal view if ([currentView parentViewController] != nil) { self.isDismissingView = YES; [[currentView parentViewController] dismissModalViewControllerAnimated:animated]; } else self.currentView = nil; } } I

change a property in another viewcontroller

半城伤御伤魂 提交于 2020-01-16 15:36:54
问题 I've searched how to run a method from another ViewController on stackoverflow and didn't find an answer. I have a ViewController1 playing an audio using AVAudioPlayer and I want my ViewController2 to be able to change it's volume. I've tried the basic: calling a method in ViewController2 that changes the volume in ViewController1 . This doesn't work. The method is able do output Logs but isn't able to change properties. Thanks 回答1: You need to pass a message from ViewController2 to

Passing data from one viewcontroller to another

坚强是说给别人听的谎言 提交于 2020-01-14 06:54:33
问题 I subclassed two view controllers. The first one is supposed to pass data, a NSUrl object to the second one. .m of the first one: NSURL *temp = [NSURL URLWithString:@"http://example.com"]; UIViewController *presentationsFullScreen_ViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PresentationsFullScreen_ViewController"]; presentationsFullScreen_ViewController.urlToUse = temp; .h of the second one: #import <UIKit/UIKit.h> @interface PresentationsFullScreen

Swift: tab bar missing when presenting a view controller - how to solve this?

霸气de小男生 提交于 2020-01-11 09:24:44
问题 I have created a simple tab bar with three views in storyboard. The tab bar works well, but when I try to show another view controller from a button within a tab, the new view is placed over the whole screen and also over the tab bar. This is how I present the view so far when a button is pressed: @IBAction func buttonPressed(_ sender: UIButton) { let newVC = self.storyboard?.instantiateViewController(withIdentifier: "extraVC") self.present(newVC!, animated: true, completion: nil) } The other

Need to free memory after Modal Segues, but I need both my Segues to pass data from A to B and B to A

穿精又带淫゛_ 提交于 2020-01-07 05:03:09
问题 I am making a game for iOS with SpriteKit. I have 2 Viewcontrollers. One is the GameViewController and the other one is the MenuViewController. Let's call them A and B respectively. When the player dies, a function is called in GameScene.swift that launches a modal "Lost" Segue to B. There, the player can restart the game or buy a life and a "Back" Segue is called to A. I need to dismiss the additional Views that get created each time I call a segue. Problem is: I need the "Lost" Segue to

Interstitial iAds in SpriteKit?

☆樱花仙子☆ 提交于 2020-01-06 19:28:54
问题 I'm using SpriteKit for my iOS app, and need some full-screen (or sometimes called "interstitial" iAds to pop up every so often. I can figure out the code for when it happens, but I need to know how to add iAds without necessarily changing the View Controller. I tried a [tutorial][1] by Techotopia on Interstitial iAds, but to do it I need to transition between actual View Controllers. Well, I tried this, but whenever transitioning back from the iAd view controller to the GameViewController,

How to get data in one Java FXML Controller from another FXML Controller (these controllers are not nested controllers)? [duplicate]

妖精的绣舞 提交于 2020-01-06 14:00:16
问题 This question already has an answer here : How can I use a variable from another Controller in JavaFX (1 answer) Closed 6 years ago . I have one button in one FXML and two text fields in another FXML. These two FXMLs are independent, I mean they are not nested. I want to print the text (which are in the two text fields) in the console/output whenever there is a click in the button. Below are the fxmls and their controllers: Button.fxml <AnchorPane id="AnchorPane" prefHeight="200.0" prefWidth=