Highlighted

Is Adobe planning on support writing ANE with Swift?

Participant ,
Jan 11, 2017

Copy link to clipboard

Copied

Dear Adobe,

AIR is an awesome cross platform solution, I have already published a multi platform product using AIR technology, my product website is https://verylab.com/

Nowadays the hardwares of mobile devices are fairly high spec, even the cheap price devices can handle AIR applications pretty well, it's safe to say that the performance issue of AIR on modern mobile devices is no longer the case, which is great!

The way I see it, the only thing that holds me back is not able to write ANE with Swift. I googled the internet and found the problem is: Swift is a dynamic framework, and AIR ANE only supports static frameworks, so we have to write ANE with Objective-C.

The language grammar between Swift and ActionScript has many commons, which is easy for ActionScript developers to learn and write Swift codes. It's a HUGE let down that AIR ANE does not support Swift : (

Is there any way or any workaround for AIR ANE to support Swift?

If there is a way, is Adobe planning on support it?

Regards,

Ge Zhou

2017-01-11

Updated repo with latest code.

Now allows calls to FRE functions from Swift

The project contains a translation of FlashRuntimeExtensions to Swift. It is comprised of 2 parts.

  1. A static library which exposes methods to AIR and a thin ObjectiveC API layer to the Swift code.
  2. A dynamic Swift Framework which contains the main logic of the ANE.

To allow FRE functions to be called from within Swift, a protocol acting as a bridge back to Objective C was used.   

Example - Converting a FREObject into a String

var swiftString: String = ""

var len: UInt32 = 0

let status: FREResult = FREGetObjectAsUTF8(object: object, length: &len, value: &swiftString)

var airString: FREObject? = nil

let status: FREResult = FRENewObjectFromUTF8(length: UInt32(string.utf8.count), value: ret, object: &freObject)

Example - Converting a FREObject into a String the easy way, using ANEHelper.swift

let swiftString: String = aneHelper.getString(object: object)

let airString: FREObject? = aneHelper.getFREObject(string: swiftString)

trace(value: swiftString)

GitHub - tuarua/SwiftIOSANE: Example Air Native Extension written in Swift 3 for iOS 10

TOPICS
Air beta

Views

1.5K

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

Is Adobe planning on support writing ANE with Swift?

Participant ,
Jan 11, 2017

Copy link to clipboard

Copied

Dear Adobe,

AIR is an awesome cross platform solution, I have already published a multi platform product using AIR technology, my product website is https://verylab.com/

Nowadays the hardwares of mobile devices are fairly high spec, even the cheap price devices can handle AIR applications pretty well, it's safe to say that the performance issue of AIR on modern mobile devices is no longer the case, which is great!

The way I see it, the only thing that holds me back is not able to write ANE with Swift. I googled the internet and found the problem is: Swift is a dynamic framework, and AIR ANE only supports static frameworks, so we have to write ANE with Objective-C.

The language grammar between Swift and ActionScript has many commons, which is easy for ActionScript developers to learn and write Swift codes. It's a HUGE let down that AIR ANE does not support Swift : (

Is there any way or any workaround for AIR ANE to support Swift?

If there is a way, is Adobe planning on support it?

Regards,

Ge Zhou

2017-01-11

Updated repo with latest code.

Now allows calls to FRE functions from Swift

The project contains a translation of FlashRuntimeExtensions to Swift. It is comprised of 2 parts.

  1. A static library which exposes methods to AIR and a thin ObjectiveC API layer to the Swift code.
  2. A dynamic Swift Framework which contains the main logic of the ANE.

To allow FRE functions to be called from within Swift, a protocol acting as a bridge back to Objective C was used.   

Example - Converting a FREObject into a String

var swiftString: String = ""

var len: UInt32 = 0

let status: FREResult = FREGetObjectAsUTF8(object: object, length: &len, value: &swiftString)

var airString: FREObject? = nil

let status: FREResult = FRENewObjectFromUTF8(length: UInt32(string.utf8.count), value: ret, object: &freObject)

Example - Converting a FREObject into a String the easy way, using ANEHelper.swift

let swiftString: String = aneHelper.getString(object: object)

let airString: FREObject? = aneHelper.getFREObject(string: swiftString)

trace(value: swiftString)

GitHub - tuarua/SwiftIOSANE: Example Air Native Extension written in Swift 3 for iOS 10

TOPICS
Air beta

Views

1.5K

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
Jan 11, 2017 0
Community Beginner ,
Jan 11, 2017

Copy link to clipboard

Copied

hope

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 11, 2017 1
Engaged ,
Jan 12, 2017

Copy link to clipboard

Copied

Yes. This would be great. I've written a couple for OSX (where it is supported) and Swift is a lot nicer to use

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 12, 2017 0
Contributor ,
Jan 13, 2017

Copy link to clipboard

Copied

I simple hate Objetive-C. Swift on the other hand it's nice and easy for a AS3 developer.

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 13, 2017 1
Participant ,
Feb 10, 2017

Copy link to clipboard

Copied

Yes, totally agreed!

Support writing ANE with Swift is a huge feature, we're sincerely hoping Adobe could take it into consideration.

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 10, 2017 1
New Here ,
Jan 16, 2017

Copy link to clipboard

Copied

hope

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 16, 2017 0
New Here ,
Feb 14, 2017

Copy link to clipboard

Copied

Yes. That's great!!

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 14, 2017 0
New Here ,
Feb 14, 2017

Copy link to clipboard

Copied

hope

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 14, 2017 0