This file contains 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
{ | |
"name": "Suitest", | |
"platforms": { | |
"tvos": "11.0", | |
"ios": "12.0" | |
}, | |
"version": "1.5.0", | |
"summary": "Suitest is a test automation and device manipulation tool for AppleTV and iOS devices.", | |
"requires_arc": true, | |
"tvos": { |
This file contains 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
c(・o・)ɔ |
This file contains 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
┳┻| | |
┻┳| | |
┳┻| psst! Down here! | |
┻┳| | |
┳┻| | |
┻┳| | |
┳┻| | |
┻┳| | |
┳┻| | |
┻┳| |
This file contains 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
func myFunction() { | |
return _ = functionReturningString() | |
} | |
func functionReturningString() -> String { | |
return "Nothing to see here" | |
} | |
// Even works for a guard | |
func myFunction(value: Any?) { |
This file contains 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
func myFunction() { | |
return { print("All done") }() // Inline closure | |
} | |
func myFunction() { | |
return () // () -> Void | |
} | |
func myFunction() { | |
return Void() // Compiles! |
This file contains 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
func myFunction() { | |
defer { print("j/k... Now, I am done") } | |
return print("All done") | |
} | |
myFunction() | |
// Output: | |
// All done | |
// j/k... Now, I am done |
This file contains 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
func myFunction(value: Any?) { | |
guard let _ = value else { return valueIsNilDoSomething() } | |
valueIsNotNilDoSomethingElse() | |
} |
This file contains 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
func myFunction() { | |
return print("All done") | |
} | |
myFunction() // Output: All done |
This file contains 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
// MARK: - UIPopoverPresentationControllerDelegate | |
func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle { | |
return .none | |
} |
This file contains 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
final class ViewController: UIViewController, UIPopoverPresentationControllerDelegate { | |
... | |
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | |
let popoverViewController = segue.destination | |
// Override the presentation style on the iPhone so that the popover does not appear in fullscreen | |
popoverViewController.popoverPresentationController?.delegate = self | |
NewerOlder