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
| @propertyWrapper | |
| struct Storage<T: AppStorageConvertible>: RawRepresentable { | |
| var rawValue: String { wrappedValue.storedValue } | |
| var wrappedValue: T | |
| init?(rawValue: String) { | |
| guard let value = T.init(rawValue) else { return nil } | |
| self.wrappedValue = value | |
| } | |
| init(wrappedValue: T) { |
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
| // Image+Trim.swift | |
| // | |
| // Copyright © 2020 Christopher Zielinski. | |
| // https://gist.github.com/chriszielinski/aec9a2f2ba54745dc715dd55f5718177 | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is |
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 SwiftUI | |
| /// SwiftUI implementation of a responsive-feeling scrollview with tappable tiles. | |
| /// We use a custom UIScrollView via UIViewRepresentable and a UIView tap overlay to | |
| /// get around current SwiftUI issues with simultaneous gesture recognition and allow | |
| /// the tiles to respond instantly to presses while scrolling. | |
| struct ContentView: View { | |
| @State private var showSheet = false |
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
| // | |
| // Int4.swift | |
| // NegaSuperBinary | |
| // | |
| // Created by Daryle Walker on 6/22/18. | |
| // Copyright © 2018 Daryle Walker. All rights reserved. | |
| // | |
| import Foundation |
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
| #! /usr/bin/swift | |
| import ScriptingBridge | |
| @objc protocol iTunesTrack { | |
| optional var name: String {get} | |
| optional var album: String {get} | |
| } | |
| @objc protocol iTunesApplication { |
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 ExceptionTestCase: XCTestCase { | |
| func raisesException() { | |
| var exception = NSException(name: NSInternalInconsistencyException, reason: "Testing exceptions", userInfo: nil) | |
| XCTAssertThrows({ exception.raise() }, "Should raise an exception) | |
| XCTAssertThrowsSpecific({ exception.raise() }, NSInternalInconsistencyException, "Should raise NSInternalInconsistencyException") | |
| } | |
| } |
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
| # xcode-build-bump.sh | |
| # @desc Auto-increment the build number every time the project is run. | |
| # @usage | |
| # 1. Select: your Target in Xcode | |
| # 2. Select: Build Phases Tab | |
| # 3. Select: Add Build Phase -> Add Run Script | |
| # 4. Paste code below in to new "Run Script" section | |
| # 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
| # 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |