iOS Static Framework Setup: Difference between revisions

From Engineering Client Portal

(Created page with "= Configuring Xcode Development Environment for Static Framework = == Importing Frameworks == The first step is to ensure that the following frameworks and libraries are impor...")
 
No edit summary
Line 1: Line 1:
{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR & DTVR}} {{Breadcrumb|DCR Video iOS SDK}} {{CurrentBreadcrumb}}
[[Category:Digital]]
__NOTOC__
= Configuring Xcode Development Environment for Static Framework =
= Configuring Xcode Development Environment for Static Framework =
== Importing Frameworks ==
== Importing Frameworks ==

Revision as of 23:50, 11 February 2019

Engineering Portal / Digital / DCR & DTVR / DCR Video iOS SDK / iOS Static Framework Setup

Configuring Xcode Development Environment for Static Framework

Importing Frameworks

The first step is to ensure that the following frameworks and libraries are imported into the Frameworks folder of the Xcode project before creating an instance of the Nielsen App SDK object.

  • UIKit.framework
  • Foundation.framework
  • AdSupport.framework
  • JavascriptCore.framework
  • WebKit.framework
  • SystemConfiguration.framework
  • Security.framework
    • Nielsen Analytics framework makes use of a number of functions in this library.
  • AVFoundation.framework
  • NielsenAppApi.framework
  • libc++.tbd (as SDK contains Objective C++ source file)
    • Alternatively, include -lstdc++ in Build Settings → Other Linker Flag of the Xcode project

Example

  • Extract “NielsenAppApi.Framework” from the Nielsen App SDK sample app and copy it to Frameworks folder of the Xcode project.
  • Add the code -#import NielsenAppApi/NielsenAppApi.h to the View Controller’s header file.

Ensure that the following are included in the Linked Frameworks and Libraries list (located in the project’s Summary settings).

  • Nielsen App SDK
  • iOS security framework

Using Swift

To import a set of Objective-C files in the same app target as your Swift code, you rely on an Objective-C bridging header to expose those files to Swift. Xcode offers to create this header file when you add a Swift file to an existing Objective-C app, or an Objective-C file to an existing Swift app.

  • Select File/New File/Objective-C File
  • Xcode will prompt you to create a bridging header.
bridgingheader 2x.png

Once this file has been created, you need to add the following:

#import <NielsenAppApi/NielsenAppApi.h>

Using Objective-C

Add the code

#import <NielsenAppApi/NielsenAppApi.h>

to the View Controller’s header file.