ℹ️ This article is also available on his blog.
Layout and Drawing are two different things:
- Layout defines only the positions and sizes of all views on screen.
- Drawing specifies how each view is rendered (how it looks).
ℹ️ This article is also available on his blog.
Layout and Drawing are two different things:
Tone analysis on text like Grammarly.
import Combine | |
extension Publisher { | |
func withInitialValue(_ value: Output) -> AnyPublisher<Output, Failure> { | |
merge(with: Just(value).setFailureType(to: Failure.self)).eraseToAnyPublisher() | |
} | |
} |
import Foundation | |
struct AnyEquatable { | |
private let isEqualTo: (Any) -> Bool | |
let value: Any | |
init<A: Equatable>(_ value: A) { | |
self.value = value | |
isEqualTo = { other in | |
guard let o = other as? A else { return false } |
// 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? |