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 x = try! divide(2, 2) |
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 photo = try! loadImage("./Resources/John Appleseed.jpg") |
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
| import Foundation | |
| extension Data { | |
| var hexString: String { | |
| let hexString = map { String(format: "%02.2hhx", $0) }.joined() | |
| return hexString | |
| } | |
| } |
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
| // TO BE CONTINUED... | |
| extension Notification.Name { | |
| func post(to notificationCenter: NotificationCenter = .default, withObject object: Any? = nil) { | |
| notificationCenter.post(name: self, object: object) | |
| } | |
| } | |
| extension Notification { | |
| struct MyApp { |
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
| import Foundation | |
| import ObjectiveC | |
| // MARK: - DynamicTypeResponsive | |
| protocol DynamicTypeResponsive { | |
| var respondsToDynamicTypeChanges: Bool { get set } | |
| } | |
| extension UILabel: DynamicTypeResponsive { | |
| var respondsToDynamicTypeChanges: Bool { |
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
| function freespace() { | |
| # rm -rf ~/Library/Containers/com.apple.mail/Data/Library/Mail\ Downloads/ | |
| # https://stackoverflow.com/a/53199763/3724306 | |
| echo "1. Boot all the sims that I want to use" | |
| echo "2. remove all the simulators that I don't have booted" | |
| echo "Run: xcrun simctl list | grep -w \"Shutdown\" | grep -o \"([-A-Z0-9]*)\" | sed \'s/[\(\)]//g\\' | xargs -I uuid xcrun simctl delete uuid" | |
| echo "Cleaning ~/Library/Caches/com.apple.dt.Xcode..." | |
| rm -rf ~/Library/Caches/com.apple.dt.Xcode/* |
OlderNewer