ARTICLE AD BOX
I have heard/read from/in reliable sources that Swift’s ‘Mirror(reflecting:_) is not “production” ready. These warnings never came with an explanation. What is Swift/SwiftUI scared it might see?
Edit 1: Idea Expansion...
@preMacro
I used to have a SQLite wrapper library that used Mirror ( refelecting:_ ) to extract a [ String ] that used to create Column Names. I never saw a hicup in performance, logic, philosophy.
Would this be safe?
If so, how were people using it that was problematic?
protocol SQLiteTable { var columnNames: [ String ] { get } init() } extension SQLiteTable { var columnNames: [ String ] { Mirror ( reflecting: Self() ).children.map { $0.label ?? "Err" } } } struct Table1: SQLiteTable { @Key < UUID > var id @Column < String > var name @Column < Int > var age }