4 ms·
Aside from inline assembly, Swift can operate at just a low level, it just requires more work, since those operations are unsafe. All of Apple's public framewor
by jshier 3y ago
Aside from inline assembly, Swift can operate at just a low level, it just requires more work, since those operations are unsafe. All of Apple's public frameworks are importable into Swift. At this point there are more frameworks unavailable in Obj-C.
- papereditor 3y agoInteresting! So all the NS_SWIFT_UNAVAILABLE APIs are still easily bypassable in Swift?
- jshier 3y agoDepends what they are. Most of the time those are unavailable because they've been replaced with better Swift imports of the same API somewhere. Less commonly it's because they use one of the few C features that can't be imported into Swift or, even more rarely, because the API is fundamentally unsafe and they don't want it available in Swift. In all cases you can reexpose these APIs to Swift by writing your own C wrapper.
- KerrAvon 3y agoYes, it's very rare that something is actually unavailable. You can even use things like `sysctlbyname` in Swift without writing C.