Swift's Mirror can see everything. Including your private properties. private let token = "sk_live_secret" - Mirror reads it like it’s public. Testing frameworks use this to inspect internal state without exposing it. Great for debug dumps. Not something to rely on for hiding sensitive data Did you know reflection in Swift goes this deep?
You can also do this in java.reflect (in Java, Kotlin, all JVM languages), in Ruby, etc. ; "private" was never meant as a security measure, it was always «warning : if you rely on a lib's internals, that lib will break your app while claiming to stay backwards-compatible.».
It’s actually inherited from its c++ origins, objc mirror works the same
Good points. Mirror reflects stored instance properties via runtime metadata, so access control doesn’t apply there. Computed and static properties don’t show up for that reason. And agreed, private is about compile-time encapsulation, not a runtime security boundary. Main takeaway: great for debugging, not for hiding data.