Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Interesting!

So all the NS_SWIFT_UNAVAILABLE APIs are still easily bypassable in Swift?


Depends 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.


Yes, it's very rare that something is actually unavailable. You can even use things like `sysctlbyname` in Swift without writing C.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: