Skip to content

Instantly share code, notes, and snippets.

View JimRoepcke's full-sized avatar

Jim Roepcke JimRoepcke

View GitHub Profile
@JimRoepcke
JimRoepcke / Weird.swift
Last active June 29, 2016 04:24
Please help me understand why the Swift 2.2 compiler in Xcode 7.3.1 says the class does not conform to the protocol
//: Playground - noun: a place where people can play
protocol Thingy: class {}
protocol ThingTaking: class {
associatedtype ThingType: Thingy
func some(thing: ThingType)
}
enum Bar: String {
case a, b, c
init?(w: Bool, x: Bool, y: Bool, z: Bool) {
if w {
if x {
self = .a
return
} else if y {
self = .b
return
@JimRoepcke
JimRoepcke / Playground.swift
Created March 26, 2020 01:54
Change in Swift behaviour with didSet property observer for @published property in Xcode 11.4
/*
In Xcode 11.3.1, the output is:
>>> setting n to -1
sending value through valueDidChange publisher
situation negative("hello")
<<< done
>>> setting n to 1
sending value through valueDidChange publisher
situation positive("hello")
@JimRoepcke
JimRoepcke / Playground.swift
Created March 26, 2020 01:59
Change in Swift behaviour with didSet property observer for @published property in Xcode 11.4
/*
In Xcode 11.3.1, the output is:
>>> setting n to -1
sending value through valueDidChange publisher
situation negative("hello")
<<< done
>>> setting n to 1
sending value through valueDidChange publisher
situation positive("hello")
@JimRoepcke
JimRoepcke / gist:f47f7d541dcb92c87979a885d62af6f0
Created October 1, 2024 22:48
iOS 18 crash in TCA with large reducer with generic sub-reducers
Incident Identifier: 49576494-AEF6-4749-B7BF-990FBE0C3C39
Distributor ID: com.apple.TestFlight
Hardware Model: iPhone17,1
Process: MyApp [3919]
Path: /private/var/containers/Bundle/Application/CCBF10BF-11EF-45CC-8EE7-0B92489E463A/MyApp.app/MyApp
Identifier: com.mycompany.myapp.test
Version: 12.38.1 (60441)
AppStoreTools: 16A242d
AppVariant: 1:iPhone17,1:18
Beta: YES