

- #Nativescript colorpicker import how to#
- #Nativescript colorpicker import generator#
- #Nativescript colorpicker import code#
If the library was not created as a Framework, there are two things you can do if you have the source code: Verify that the library was created as a dynamic framework, also known as a Cocoa Touch Framework. Utilizing an Existing Xcode Library or FrameworkĪnother scenario is you found a cool library that someone else has written and you want to use it in your app.

* **Gotcha 2** - If you're going to run the app on the iOS simulator, you have to build the project in Xcode for the simulator, and then you have to import the simulator library into your NativeScript app. In this case, the only class is imported is TemperatureConverter.h
#Nativescript colorpicker import generator#
The main framework header file called TemperatureConverterFramework.h should #import the headers that you want accessible in your app so the NativeScript metadata generator can find them.I've opened the TemperatureConverterFramework project in Xcode Classes you want to use in NativeScript should be exposed publicly.The project should be created as a dynamic framework – this is currently the only type of library that is supported.
#Nativescript colorpicker import code#
Here is what the header code looks like to give you an idea. All this sample does is convert Celsius and Fahrenheit temperatures. In the sample that I provided, there is an Xcode project that is set up correctly. Let's say you already have an existing code base that you wrote and you want to reuse it in your NativeScript app. The steps below will refer to this sample, so if you download it you'll be able to follow along easier. The sample Xcode library is a temperature converter that converts between Celsius and Fahrenheit and vice versa. I've prepared a sample for you that you can download from GitHub and try out for yourself. There are a few things that could trip you up and I will make a note of these items in the appropriate sections.
#Nativescript colorpicker import how to#
I will show you how to build and configure the framework for iOS using Xcode and how to import and call the library form your NativeScript app. Not only can you do this for the standard frameworks that come with iOS and Android, but you can use your own as well.

You can call your native objects with JavaScript.

I've updated the companion code in the GitHub repo for NativeScript version 1.0.1 and included the lib folder for those who just want to download and try out the app right away. This post will show you how you can use a native iOS library in your own app. NativeScript has this neat little feature that allows you to import an existing native library and call it from your NativeScript app. Should you rewrite that library or framework in JavaScript or create a new NativeScript module? Well, you certainly could do that, but the good news is that you don't have to. When developing a NativeScript app, you might run into a situation where you really need to use a native library that's you've already written, or a library that someone else has already made available as an open source project, for example.
