This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <connections> | |
| <segue destination="knX-Ex-UQZ" kind="custom" identifier="CustomSegue" customClass="MyCustomSegue" customModule="MyCustomSegueSwift" id="52K-D3-Bbt"/> | |
| </connections> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //set the ViewControllers for the animation | |
| let sourceView = self.source.view as UIView! | |
| let destinationView = self.destination.view as UIView! | |
| let window = UIApplication.shared.delegate?.window! | |
| // 1. beloveSubview | |
| window?.insertSubview(destinationView!, belowSubview: sourceView!) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override func perform() { | |
| //set the ViewControllers for the animation | |
| let sourceView = self.source.view as UIView! | |
| let destinationView = self.destination.view as UIView! | |
| let window = UIApplication.shared.delegate?.window! | |
| //set the destination View center |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @IBAction func unwindfromSecondView(_ sender: UIStoryboardSegue) { | |
| self.view.backgroundColor! = UIColor.cyan | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Do any additional setup after loading the view. | |
| if (colorstring == "purple") { | |
| self.view.backgroundColor! = UIColor.purple | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | |
| if (segue.identifier! == "CustomSegue") { | |
| //with Navigation Controller | |
| //let navController = segue.destination as! UINavigationController | |
| //let detailController = ((navController.topViewController) as! SecondViewController) | |
| //without NavigationController: | |
| let detailController = (segue.destination as! SecondViewController) | |
| detailController.colorstring = "purple" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var colorstring = NSString() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let spotiURL = URL(string: "http://www.spotlessicode.com") | |
| UIApplication.shared.open(spotiURL!, options: [:], completionHandler: nil) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [[UIApplication sharedApplication] openURL:spotiURL options:@{} completionHandler:^(BOOL success) { | |
| if (success) { | |
| NSLog(@"Opened url"); | |
| } | |
| }]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| content.sound = UNNotificationSound.init(named: "sound01.caf") |