• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
1

ANE using swift step by step tutorial

Participant ,
Nov 30, 2017 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.6K

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
community guidelines
Engaged ,
Dec 03, 2017 Dec 03, 2017

Copy link to clipboard

Copied

Votes

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
community guidelines
Participant ,
Dec 04, 2017 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.

Votes

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
community guidelines
Participant ,
Jan 05, 2018 Jan 05, 2018

Copy link to clipboard

Copied

Any updates?

Votes

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
community guidelines
Engaged ,
Jan 10, 2018 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.

Votes

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
community guidelines
Engaged ,
Apr 02, 2018 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!

Votes

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
community guidelines
Engaged ,
Apr 11, 2018 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

    }

}

Votes

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
community guidelines
Engaged ,
Apr 12, 2018 Apr 12, 2018

Copy link to clipboard

Copied

LATEST

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!

Votes

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
community guidelines
Community Beginner ,
Feb 07, 2018 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

Votes

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
community guidelines
Participant ,
Feb 08, 2018 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".

Votes

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
community guidelines
Explorer ,
Apr 02, 2018 Apr 02, 2018

Copy link to clipboard

Copied

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

Votes

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
community guidelines