This guide describes how to integrate Felgo into existing iOS Xcode projects.
Felgo Native Integration comes as a public Cocoapods Podspec.
-
Add Felgo Native Integration pod as dependency of your existing Xcode project and run
pod install
:pod 'FelgoIOS', :git => 'https://github.com/FelgoSDK/FelgoIOS.git'
-
Initialize FelgoIOS in AppDelegate:
#import "FelgoIOS.h" - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Start the Felgo/Qt runtime at app start in background [[FelgoIOS sharedInstance] start]; return YES; } - (void)applicationWillTerminate:(UIApplication *)application { // Shutdown the Felgo/Qt runtime again [[FelgoIOS sharedInstance] quit]; }
-
Add
FelgoIOSView
class (aUIView
subclass) anywhere from within your View Controller code or Interface Builder. -
Set the
FelgoIOSView
's 'qmlSource property to a URL referencing your QML file:#import "FelgoIOSView.h" - (void)loadQML { self.felgoView.qmlSource = [[NSBundle mainBundle] URLForResource:@"Main" withExtension:@"qml"]; }
The folder NativeIntegrationExample
contains a complete iOS example project
making use of FelgoIOS.
You can open by calling pod install
and then opening the generated .xcworkspace
.