CPEData 3.3.1

CPEData 3.3.1

TestsTested
LangLanguage SwiftSwift
License Apache-2.0
ReleasedLast Release Oct 2018
SPMSupports SPM

Maintained by Imran Saadi.



CPEData 3.3.1

  • By
  • Imran Saadi

CPEData

iOS native object mapping for MovieLabs Cross-Platform Extras Manifest, Common Metadata, AppData and Style specs, compatible with CPEExperience for a full UI implementation.

Currently supported specs:

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate CPEData into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'CPEData', '~> 3.0'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager for Cocoa applications. To integrate CPEData into your Xcode project using Carthage, specify it in your Cartfile:

github "warnerbros/cpe-manifest-ios-data" ~> 3.0

Then, add CPEData.framework and SWXMLHash.framework to "Linked Frameworks and Libraries" and Carthage's "copy-frameworks" script

Usage

Use the static load functions in CPEXMLSuite for a convenient way to initialize and parse all the supported spec files.

Providing URL objects

CPEXMLSuite.load(manifestXMLURL: manifestXMLURL, appDataXMLURL: appDataXMLURL, cpeStyleXMLURL: cpeStyleXMLURL) { (error) in
    if let error = error {
        // Respond to error case
    } else {
        // Respond to parsing completion event (ExperienceLauncher.launch)
    }
}

Providing Data objects

CPEXMLSuite.load(manifestXMLData: manifestXMLData, appDataXMLData: appDataXMLData, cpeStyleXMLData: cpeStyleXMLData) { (error) in
    if let error = error {
        // Respond to error case
    } else {
        // Respond to parsing completion event (ExperienceLauncher.launch)
    }
}

Development

Open Example/CPEDataExampleWorkspace.xcworkspace in Xcode to build and run the sample project, which allows you to specify your own XML file URLs to be parsed and mapped to the library's native classes. The example project also provides a UI to explore the hierarchy of the parsed data:

Example hierarchy of parsed Manifest