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
| // | |
| // SystemDeactivationMonitor.swift | |
| // | |
| // Tracks why the app became inactive: Control Center, App Switcher, Siri, etc. | |
| // Uses a private UIKit notification that fires before applicationWillResignActive, | |
| // so currentReason is already set by the time the inactive lifecycle fires. | |
| // | |
| // Confirmed working on tvOS 26.4 and iOS 18.x. | |
| // | |
| // React Native usage: |
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
| { | |
| "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 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
| c(・o・)ɔ |
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
| ┳┻| | |
| ┻┳| | |
| ┳┻| psst! Down here! | |
| ┻┳| | |
| ┳┻| | |
| ┻┳| | |
| ┳┻| | |
| ┻┳| | |
| ┳┻| | |
| ┻┳| |
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
| func myFunction() { | |
| return _ = functionReturningString() | |
| } | |
| func functionReturningString() -> String { | |
| return "Nothing to see here" | |
| } | |
| // Even works for a guard | |
| func myFunction(value: Any?) { |
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
| func myFunction() { | |
| return { print("All done") }() // Inline closure | |
| } | |
| func myFunction() { | |
| return () // () -> Void | |
| } | |
| func myFunction() { | |
| return Void() // Compiles! |
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
| 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 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
| func myFunction(value: Any?) { | |
| guard let _ = value else { return valueIsNilDoSomething() } | |
| valueIsNotNilDoSomethingElse() | |
| } |
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
| func myFunction() { | |
| return print("All done") | |
| } | |
| myFunction() // Output: All done |
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
| // MARK: - UIPopoverPresentationControllerDelegate | |
| func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle { | |
| return .none | |
| } |
NewerOlder