The native interface should be Objective-C like usual.  The Java talks only
to this Objective-C layer.  Then to access your Swift framework, you use
the usual rules for calling Swift from Objective-C.

You wouldn't put any swift files directly in the native/ios directory.  All
Swift would be inside your framework, which you build, and zip, and place
inside the native/ios folder.

On Mon, Sep 21, 2020 at 1:57 PM 'P5music' via CodenameOne Discussions <
[email protected]> wrote:

> Thank you.
> The framework is made of  Swift code, but I wonder if the methods have to
> be exposed with the @objc annotation, and it is as usual on the Codename
> side, like the Generate Native Interface and so on, objective-C code
> included.
> Regards
>
> Il giorno lunedì 21 settembre 2020 alle 14:09:30 UTC+2 Steve Hannah ha
> scritto:
>
>> You can create a swift framework in Xcode.  Then zip up the framework and
>> put it in the native/ios directory, e.g.
>> native/ios/MyFramework.framework.zip
>>
>> I do this inside the WebRTC cn1lib I'm currently working on.  I needed to
>> add build hints so that Clang would work with the swift modules properly:
>> ios.pods.build.CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES=YES
>> ios.pods.build.CLANG_ENABLE_MODULES=YES
>>
>> (See full properties file here
>> https://github.com/shannah/CN1WebRTC/blob/master/webrtc/codenameone_library_appended.properties
>> )
>>
>> Steve
>>
>> On Mon, Sep 21, 2020 at 1:59 AM 'P5music' via CodenameOne Discussions <
>> [email protected]> wrote:
>>
>>> I would like to add the import/export functions to my Codename App.
>>> The way I need it, It can be done only with native code.
>>> I have that native code in Swift language from the XCode Swift-native
>>> version of my app.
>>> I would like to know if I can expose it  with the
>>> @objc or @objcMembers
>>> annotations for the Swift methods.
>>> I mean, of course the generated files have to be like it is explained in
>>> Codename documentation, but I also would put Swift files in the native
>>> folder that contain the real methods (the "officially" interfaced obj-C
>>> methods call the Swift ones)
>>> Does this make sense?
>>> Thanks
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "CodenameOne Discussions" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/codenameone-discussions/495f4544-9c31-4b59-8686-e2e57cee7e31n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/codenameone-discussions/495f4544-9c31-4b59-8686-e2e57cee7e31n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> Steve Hannah
>> Software Developer
>> Codename One
>> http://www.codenameone.com
>>
> --
> You received this message because you are subscribed to the Google Groups
> "CodenameOne Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/codenameone-discussions/76b5fc97-8da8-40ef-9742-b25928811083n%40googlegroups.com
> <https://groups.google.com/d/msgid/codenameone-discussions/76b5fc97-8da8-40ef-9742-b25928811083n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Steve Hannah
Web Lite Solutions Corp.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/CABiRg%2BTZTCdjE4YOfxEptzhAwFVbJk8HcHH%2Bb2ZCv46pfE5m0A%40mail.gmail.com.

Reply via email to