is it possible to write assembly in Swift? i was curious about this. Something like this: __asm__
Thats possible in languages like C.
And i wasn't able to find anything about this in Swift.
Asked
Active
Viewed 2,307 times
2

user3842509
- 33
- 3
1 Answers
2
No you can't if you want this you can do this in objective c and expose your objective- c code to Swift with a bridging header. Objective-C code:
inline void assemblyFunc() {
__asm__(/*Assembly*/);
}
More info on bridging: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html
How to call Objective-C code from Swift
I also asked this question here: Is it possible to write inline assembly in Swift?
-
okay I saw that it was already asked indeed, sorry, but I'll just accept your answer because it still helped me. – user3842509 Jul 15 '14 at 20:35