I would like to use this CocoaPod - https://github.com/larcus94/ImagePickerSheetController - which is written in Swift.
Has anyone managed to use a Swift pod in their Rubymotion project? Is it something the Rubymotion team is working on, since more and more Pods are written in Swift?
Not possible today, and probably not in the near future. Some whys in the topic below:
Yes in the near future it won't be possible swift runtime is vert différent and swift often evolves because it's a new language .For example the process for mixing with C++ is more complicated than objective-c++
Having written swift code, and dealing with the things apple does -- I'd say it'll be a long time before we can use swift libs with RM. Have an app at work, done in swift 1.2, then swift2 came out -- we updated xcode and we had to change almost every line in the app. Swift is nice, but it's changing too much too quick with a lot of BC breaks to make it worth the time to get RM to work with it.
Pods written in Swift can only be integrated as frameworks; adduse_frameworks!to your Podfile or target to opt into using it
Pods written in Swift can only be integrated as frameworks; add
to your Podfile or target to opt into using it
This message seems to indicate that it is possible to use a Swift cocoapod - is this just an erroneous message, or can you really do as the message implies?
I would really like to hear if this works for people -- I am a little leary of being legacied-out of RM as more and more swift code is written.
The long and short of it is that, currently, RubyMotion is not compatible with Swift.
However, Swift support is on the roadmap: https://hipbyte.myjetbrains.com/youtrack/issue/RM-1133
This question has been asked many times in many different posts. Hopefully this issue will be resolved soon.
The 4.18 change log shows
[iOS, OSX, watchOS, tvOS] Added support to use the frameworks which created
by Swift language.
Have you guys tried it out yet?
I've tried, and it didn't work. I needed to pull down motion-cocoapods down from GitHub since there's no released version with use_frameworks yet, but I still ran into issues during compilation.
I ran into problems as well with the quick test I tried. Also had to pull down master of motion-cocoapods. I was a little surprised that using use_frameworks! was an all or nothing thing - it wanted to make frameworks of all my other pods I include. Maybe that was causing the issue. Haven't had a chance to look more in depth...