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
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z |
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
| class Decryptor { | |
| fileprivate var alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"] | |
| func decrypt(_ input: String) -> String? { | |
| var output = "" | |
| for character in input.characters { | |
| output += substitute(String(character).lowercased()) | |
| } | |
| return output |
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
| DurationReporter.onReportEnd = { _, _ in | |
| print(DurationReporter.generateReport()) | |
| } |
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
| print(DurationReporter.generateReport()) |
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
| /* | |
| User taps play | |
| */ | |
| DurationReporter.begin(event: "Video", action: "Buffering") | |
| /* | |
| Playback starts | |
| */ | |
| DurationReporter.end(event: "Video", action: "Buffering") |
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 collectedData = DurationReporter.reportData() | |
| /* | |
| Send report to analytics with use of 🚀 & 🎉 | |
| */ | |
| DurationReporter.clear() |
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
| DurationReporter.begin(event: "Application Start", action: "Loading", payload: "🚀") | |
| /* some flow */ | |
| DurationReporter.end(event: "Application Start", action: "Loading", payload: "🎉") | |
| DurationReporter.onReportEnd = { eventName, report in | |
| guard let beginPayload = report.beginPayload as? String, | |
| let endPayload = report.endPayload as? String else { return } | |
| /* | |
| Send report to analytics with use of 🚀 & 🎉 | |
| */ |
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
| DurationReporter.onReportEnd = { eventName, report in | |
| /* | |
| Send report to analytics | |
| */ | |
| } |
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
| /* Application Delegate */ | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
| DurationReporter.begin(event: "ApplicationStart", action: "Initial Processing") | |
| /* | |
| Some processing | |
| */ | |
| DurationReporter.end(event: "ApplicationStart", action: "Initial Processing") | |
| DurationReporter.begin(event: "Application Start", action: "Showing of Home") | |
| return true | |
| } |
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
| /* Application Delegate */ | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
| DurationReporter.begin(event: "ApplicationStart", action: "Initial Processing") | |
| /* | |
| Some processing | |
| */ | |
| DurationReporter.end(event: "ApplicationStart", action: "Initial Processing") | |
| return true | |
| } |
NewerOlder