Hi!

Sorry to get back to this, but I still couldn’t figure it out…

This is the route I took:
1- created a plugin with `week plugin create weex-my-plugin`.
2- used Carthage to import WeexSDK to build my plugin (in 
<weex-my-plugin>/ios). I think it worked but I am not sure because it also 
needs WeexPluginLoader, which in turn imports WeexSDK in Pods.
3- in the playground test app (in <weex-my-plugin>/playground/ios), I imported 
WeexSDK through Carthage and imported the rest of the dependencies (including 
the plugin) though CocoaPods. It doesn't link properly and the WeexSDK headers 
aren't be found.

I am thinking I should forget the plugin project and just create a new week app 
and extend the iOS functionality directly in the iOS project.

Can you please give me some high level pointers on how to bundle this thing 
together?
The requirements for my app are:
- Create a WXComponent and WXModule that uses a Swift lib;
- Also use natjs libs (which are not compatible with use_frameworks! In the 
Podfile);
- Preferably, make this a plugin because I will want to reuse the vue code for 
web and android.

Thanks!
Tiago

On 4 May 2018 04:38 +0100, acton zhang <[email protected]>, wrote:
> If you want a dynamic framework for Weex directly, Carthage
> <https://github.com/Carthage/Carthage> can be a better choice, and you
> can use Weex by Carthage instead of CocoaPods, I make a description in
> readme https://github.com/apache/incubator-weex
>
> 2018-05-03 20:41 GMT+08:00 Tiago Alves <[email protected]>:
>
> > Thanks!
> >
> > Though that probably won't help me since I can't have Weex + Swift
> > Frameworks + Natjs to work in the first place. That ObjC wrapper would not
> > compile…
> >
> > I think that my main problem now is that in order to use the Swift
> > frameworks I need “use_frameworks!” In the Podfile, but for natjs to work I
> > can't use “use_frameworks!”.
> >
> > Cocoapods 1.5.0 allow importing Swift projects as static libraries, but
> > then they won't link to the ObjC code because static libraries can't have a
> > bridge header.
> >
> > iOS development is a mess and this is all very frustrating :(
> >
> > Anyway, thanks!
> > Tiago
> >
> > On 3 May 2018 13:13 +0200, acton zhang <[email protected]>, wrote:
> > > hi Tiago Alves
> > >
> > > I am the author of this article, sure the plugins heavily depend on macro
> > > so we need write swift class extension Objc class, and for Objc Class, it
> > > is just a wrapper to expose method defined in swift using macro.
> > >
> > > 2018-05-03 19:00 GMT+08:00 Tiago Alves <[email protected]>:
> > >
> > > > Hi!
> > > >
> > > > I am developing a plugin in ObjC and running into countless on iOS
> > mixing
> > > > ObjC, Swift frameworks and other Weex plugins (e.g., natjs).
> > > >
> > > > Recently, I found this: https://weex.apache.org/guide/
> > extend-module-using-
> > > > swift.html
> > > > It shows a way to use Weex with Swift, but says nothing about using
> > Swift
> > > > in a plugin.
> > > >
> > > > Is it possible to use swift? I don’t think so because the Weex plugin
> > api
> > > > relies heavily on macros, which are not translatable to Swift.
> > > >
> > > > Do you think it is worth a try to use Swift to build a plugin?
> > > >
> > > > Thanks,
> > > > Tiago
> > > >
> >

Reply via email to