Highlighted

ANE using swift step by step tutorial

Participant ,
Nov 30, 2017

Copy link to clipboard

Copied

Dear Adobe AIR SDK Team,

please, provide step by step tutorial for create ANE for iOS using Swift.

TOPICS
Air beta

Views

2.0K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

ANE using swift step by step tutorial

Participant ,
Nov 30, 2017

Copy link to clipboard

Copied

Dear Adobe AIR SDK Team,

please, provide step by step tutorial for create ANE for iOS using Swift.

TOPICS
Air beta

Views

2.0K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 30, 2017 1
Engaged ,
Dec 03, 2017

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 03, 2017 2
Participant ,
Dec 04, 2017

Copy link to clipboard

Copied

Thank you.

Yes, i saw this tutorial.

Unfortunately, due to the absence of voice comments, it is very difficult to understand the meaning and purpose of each action.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 04, 2017 0
Participant ,
Jan 05, 2018

Copy link to clipboard

Copied

Any updates?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 05, 2018 0
Engaged ,
Jan 10, 2018

Copy link to clipboard

Copied

I will gladly answer any questions you have.

I'm not re-recording the videos with voice though. I already spent alot of time and effort putting those together, along with the docs and readme and multiple sample projects.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 10, 2018 0
Engaged ,
Apr 02, 2018

Copy link to clipboard

Copied

I must say, the project by @el111 absolutely rocks!!  Kudos.

GitHub - tuarua/Swift-IOS-ANE: FlashRuntimeExtensions.swift. Example Air Native Extension written in...

All the heavy lifting that the "step by step" from Sourabh Gupta completely misses - is taken care of in el111's project.  Check out the Part 1 video he posted above: Using Swift in AIR Native Extensions - Hello World Example Part 1 - YouTube

Once you get to the end of the video - you basically just need to start writing your swift functions!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 02, 2018 1
Engaged ,
Apr 11, 2018

Copy link to clipboard

Copied

Glad you found the project + videos useful.

I think Sourabh Gupta's blog post is useful and the approach forms the basis of how this is done.

Some people may wish to keep their "FRE" code in ObjC.

And as a comparison it's actually deeper that the React Native page on using Swift

That being said, what my project aimed to do was create a wrapper framework to:

  • formalise the approach - no more verbose methods with names like "Convert_AS3_to_Native_String"
  • wrap the FRE methods in Swift style syntax
  • support accepted Swift language features such as optionals, guards etc
  • minimise the amount of ObjC coding needed and abstract any used
  • reduce boiler plate code by using macros
  • still remain flexible so that ObjC can be used if desired
  • work across OSX, iOS, tvOS
  • utilise extensibility features of Swift

The last one is probably the most important for me.

It has allowed me to quickly port the ARKit API to AS3 relatively quickly

Here for example is an extension which allows easy conversion of an AS3 Vector3D into the equivalent SCNVector 3 class and vice versa.

//single liner

let vec = SCNVector3(argv[0])

import Foundation

import ARKit

public extension SCNVector3 {

    init?(_ freObject: FREObject?) {

        guard let rv = freObject else {

            return nil

        }

        self.init(Float(rv["x"]) ?? 0,

                  Float(rv["y"]) ?? 0,

                  Float(rv["z"]) ?? 0)

    }

    func toFREObject() -> FREObject? {

        do {

            let ret = try FREObject(className: "flash.geom.Vector3D",

                                    args: Double(self.x), Double(self.y), Double(self.z))

            return ret

        } catch {

        }

        return nil

    }

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 11, 2018 2
dews LATEST
Engaged ,
Apr 12, 2018

Copy link to clipboard

Copied

Ack re Sourabh Gupta - it was harsh a comment - as I'm becoming more familiar with building native extensions for iOS, Sourabh's post is looking more like a step-by-step, my bad.  Still grateful for your project though and excited about the potential for porting more of the swift API!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 12, 2018 0
Community Beginner ,
Feb 07, 2018

Copy link to clipboard

Copied

Hi Oleg,

You can go through my devnet article "Swift based ANE for iOS/tvOS.​" for step by step guidance on how to develop and use Swift based ANE in AIR application.

-Sourabh Gupta | Adobe AIR Team

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 07, 2018 2
Participant ,
Feb 08, 2018

Copy link to clipboard

Copied

Thank you, great work!

It would be better in future to make a crash course video with an example to show native toast with string "Hello world".

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 08, 2018 0
Explorer ,
Apr 02, 2018

Copy link to clipboard

Copied

Yes ,this project by @elll is great. I found it last year。

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 02, 2018 0