Skip to main content
Inspiring
October 11, 2013
Question

using xib in iOS Ane?

  • October 11, 2013
  • 2 replies
  • 1599 views

I'm developing an ANE which makes use of an xib view.

How do I package this within the ANE?

The app keeps crashing because it can't find the nib so I'm assuming I need to package it somehow into the ANE?

Can I just place it within the same directory with other assets like png files etc?

This topic has been closed for replies.

2 replies

z_abdulgalimov
Inspiring
May 3, 2015

What do you think about this decision: FPNativeUI - YouTube ?

kheftel
Inspiring
May 4, 2015

We got storyboards to work in an ANE by putting them in a static .framework.  It should also work with xib files.  (dynamic frameworks don't work)

First, we compiled the .a in the ANE against the framework by putting it in the "link binary with libraries" build phase.

Then, in the platform-ios.xml file, we added the framework as a packaged depenency:

    <packagedDependencies>

        <packagedDependency>myframework.framework</packagedDependency>

    </packagedDependencies>

Then, in the build script for the ANE, we had to make sure to include all the framework assets, including storyboards, in the iPhone-ARM directory of the ANE:

cp -R ../ios/Build/Products/Release-iphoneos/myframework.framework/mystoryboard~ipad.storyboardc iPhone-ARM/

cp -R ../ios/Build/Products/Release-iphoneos/myframework.framework/mystoryboard~iphone.storyboardc iPhone-ARM/

Then, in the packaging command, we have to reference the platform-ios.xml file:

adt -package -target ane mynativeextension.ane extension.xml -swc mynativeextension.swc \

  -platform iPhone-ARM -platformoptions platform-ios.xml myframework.framework -C iPhone-ARM/ . \

  -platform default -C default/ .

The following pages really helped:

Adobe Flash Platform * Including resources in your native extension package

http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-2482335412ffea65006-8000.html

Building a native extension for iOS and Android – Part 1: Getting started with volume control | Adobe Developer Connecti…

It's complicated, but in the end we were able to include PNGs, sound files, storyboards, and even custom fonts for the native views to use.

I wrote an article explaining how to do the custom fonts, sometime I need to do the same about including xibs/storyboards.......

ANE for iOS with Custom Framework – Using Custom Fonts | khef.co

Good luck, ask questions if you need to!

User Unknow
Legend
May 6, 2015

just add your xib to the project as asset

DaveCatesAuthor
Inspiring
October 12, 2013

Not tried it yet but this help page looks like it's just what I needed and missed:

http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-2e74ffb4130044f3619-7ff8.html

Might help someone else in the future