Skip to content

Instantly share code, notes, and snippets.

View vidugloeck's full-sized avatar

Vidu Glöck vidugloeck

  • Hamburg, Germany
View GitHub Profile
@mugbug
mugbug / AssertEquals+Diff.swift
Created June 10, 2021 20:29
XCTestCase wrapper for asserting equatable structs with formatted error diff message
import XCTest
// Credits: https://github.com/pointfreeco/swift-composable-architecture
//swiftlint:disable empty_string force_cast force_unwrapping unused_closure_parameter function_body_length
class MyCustomTestCase: XCTestCase {
func assertEqual<T: Equatable>(
expected: T,
actual: T
) {
@DreamingInBinary
DreamingInBinary / Best in Class iOS Checklist
Last active January 29, 2024 18:18
This is a public checklist updated every year after the latest version of iOS and iPadOS are shipped. It's a boiled down version of a "Best in Class" app checklist created by Jordan Morgan.
# 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
- [ ] Focus Filter Support
final class Loader: BindableObject {
let didChange = PassthroughSubject<Data?, Never>()
var task: URLSessionDataTask!
var data: Data? = nil {
didSet {
didChange.send(data)
}
}
init(_ url: URL) {
@lattner
lattner / TaskConcurrencyManifesto.md
Last active June 19, 2024 13:41
Swift Concurrency Manifesto
@JadenGeller
JadenGeller / AnyEquatable.swift
Last active January 6, 2024 18:26
AnyEquatable
public struct AnyEquatable: Equatable {
private let value: Any
private let equals: Any -> Bool
public init<E: Equatable>(_ value: E) {
self.value = value
self.equals = { ($0 as? E == value) ?? false }
}
}
@xNekOIx
xNekOIx / iOSAutoLayoutDebug
Last active July 7, 2020 17:45
iOS AutoLayout debug
po [[UIWindow keyWindow] _autolayoutTrace] // prints layouts ambiguity
po [UIViewController _printHierarchy] // prints view controllers hierarchy
po [view constraintsAffectingLayoutForAxis:0] // horizontal
po [view constraintsAffectingLayoutForAxis:1] // vertical
[view hasAmbiguousLayout] // BOOL
[view exerciseAmbiguityInLayout] // visualizing ambiguity
UIViewAlertForUnsatisfiableConstraints // symbolic breakpoint
UIConstraintBasedLayoutDebugging // symbolic breakpoint