2

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.

1 Answers1

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?

Community
  • 1
  • 1
Bas
  • 4,423
  • 8
  • 36
  • 53
  • 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