TL;DR
PRO plan not pro enough (doesn't include the mobile add-on)
But... the technical support is quick and helpful.
| import Combine | |
| extension Publisher { | |
| func withInitialValue(_ value: Output) -> AnyPublisher<Output, Failure> { | |
| merge(with: Just(value).setFailureType(to: Failure.self)).eraseToAnyPublisher() | |
| } | |
| } |
| // Source: https://twitter.com/NSExceptional/status/1383665312684335105 | |
| // MARK: - Helpers | |
| extension UnsafePointer { | |
| var raw: UnsafeRawPointer { | |
| return UnsafeRawPointer(self) | |
| } |
| /* | |
| GOAL: | |
| - UICollectionViewCompositionalLayout multi column layout with auto-sizing cells where each cell has the same height in a given row (uses the max cell height in a row) | |
| REALITY: | |
| - The groups aren't filled :/ | |
| */ | |
| import Foundation | |
| import UIKit |
| # A Best in Class Checklist | |
| A boiled down checklist adapted from this [post](https://www.swiftjectivec.com/a-best-in-class-app/), created by @jordanmorgan10. | |
| > To use this, create a Github Issue in your own repo, and simply copy and paste this text. | |
| ## iOS Core Technology | |
| _Things any iOS app can benefit from_ | |
| - [ ] iCloud Sync | |
| - [ ] [Core Spotlight integration](https://github.com/DreamingInBinary/Spend-Stack/issues/120) |
| import UIKit | |
| // Source: https://sarunw.com/posts/match-view-shadow-to-sketch-shadow/ | |
| extension UIView { | |
| func applySketchShadow( | |
| color: UIColor = .black, | |
| alpha: Float = 0.2, | |
| x: CGFloat = 0, | |
| y: CGFloat = 2, |
| import Foundation | |
| import UIKit | |
| // Source: https://www.swiftbysundell.com/articles/published-properties-in-swift/ | |
| // MARK: - List | |
| struct List<Value> { | |
| private(set) var firstNode: Node? | |
| private(set) var lastNode: Node? |
| extension FileManager { | |
| /* | |
| Prints out the locations of the simulator and the shared group folder. | |
| This is useful for debugging file issues. | |
| Example usage: FileManager.default.printFileLocations() | |
| */ | |
| func printFileLocations() { | |
| let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) | |
| let simulatorFolder = paths.last! |
| // Avoids the keyboard in a UIKit app by leveraging additionalSafeAreaInsets. | |
| // You can put this in the root view controller so the whole app will avoid the keyboard. | |
| // Only tested on iOS 13.3. | |
| // Made for https://douglashill.co/reading-app/ | |
| @objc func updateSafeAreaForKeyboardFromNotification(_ notification: Notification) { | |
| guard let endFrameInScreenCoords = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect else { | |
| return | |
| } | |
| // Please consider whether the force unwrap here is safe for your own use case. |
| @discardableResult | |
| public func with<T>(_ value: T, _ builder: (T) -> Void) -> T { | |
| builder(value) | |
| return value | |
| } | |
| @discardableResult | |
| public func with<T>(_ value: T, _ builder: (T) throws -> Void ) rethrows -> T { | |
| try builder(value) | |
| return value |