From 6760b7ccba7cb741a57ce984fdbc6c87f19022a6 Mon Sep 17 00:00:00 2001 From: norlin Date: Tue, 24 Jan 2017 11:31:07 +0300 Subject: [PATCH] add ObjC example app --- .gitignore | 3 + examples/hola-cdn-example-ios/Podfile | 5 + .../project.pbxproj | 395 ++++++++++++++++++ .../hola-cdn-example-ios/AppDelegate.h | 17 + .../hola-cdn-example-ios/AppDelegate.m | 51 +++ .../AppIcon.appiconset/Contents.json | 68 +++ .../Base.lproj/LaunchScreen.storyboard | 27 ++ .../Base.lproj/Main.storyboard | 26 ++ .../hola-cdn-example-ios/Info.plist | 45 ++ .../hola-cdn-example-ios/ViewController.h | 15 + .../hola-cdn-example-ios/ViewController.m | 51 +++ .../hola-cdn-example-ios/main.m | 16 + 12 files changed, 719 insertions(+) create mode 100644 examples/hola-cdn-example-ios/Podfile create mode 100644 examples/hola-cdn-example-ios/hola-cdn-example-ios.xcodeproj/project.pbxproj create mode 100644 examples/hola-cdn-example-ios/hola-cdn-example-ios/AppDelegate.h create mode 100644 examples/hola-cdn-example-ios/hola-cdn-example-ios/AppDelegate.m create mode 100644 examples/hola-cdn-example-ios/hola-cdn-example-ios/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 examples/hola-cdn-example-ios/hola-cdn-example-ios/Base.lproj/LaunchScreen.storyboard create mode 100644 examples/hola-cdn-example-ios/hola-cdn-example-ios/Base.lproj/Main.storyboard create mode 100644 examples/hola-cdn-example-ios/hola-cdn-example-ios/Info.plist create mode 100644 examples/hola-cdn-example-ios/hola-cdn-example-ios/ViewController.h create mode 100644 examples/hola-cdn-example-ios/hola-cdn-example-ios/ViewController.m create mode 100644 examples/hola-cdn-example-ios/hola-cdn-example-ios/main.m diff --git a/.gitignore b/.gitignore index d78d024..d315878 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ xcuserdata/ Carthage/ Cartfile.resolved *.zip + +Podfile.lock +Pods/ diff --git a/examples/hola-cdn-example-ios/Podfile b/examples/hola-cdn-example-ios/Podfile new file mode 100644 index 0000000..cb16417 --- /dev/null +++ b/examples/hola-cdn-example-ios/Podfile @@ -0,0 +1,5 @@ +use_frameworks! + +target 'hola-cdn-example-ios' do + pod 'HolaCDN', :path => '../../' +end diff --git a/examples/hola-cdn-example-ios/hola-cdn-example-ios.xcodeproj/project.pbxproj b/examples/hola-cdn-example-ios/hola-cdn-example-ios.xcodeproj/project.pbxproj new file mode 100644 index 0000000..d921394 --- /dev/null +++ b/examples/hola-cdn-example-ios/hola-cdn-example-ios.xcodeproj/project.pbxproj @@ -0,0 +1,395 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 97656F391E373FBA001B738F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97656F381E373FBA001B738F /* main.m */; }; + 97656F3C1E373FBA001B738F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 97656F3B1E373FBA001B738F /* AppDelegate.m */; }; + 97656F3F1E373FBA001B738F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 97656F3E1E373FBA001B738F /* ViewController.m */; }; + 97656F421E373FBA001B738F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97656F401E373FBA001B738F /* Main.storyboard */; }; + 97656F441E373FBA001B738F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97656F431E373FBA001B738F /* Assets.xcassets */; }; + 97656F471E373FBA001B738F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97656F451E373FBA001B738F /* LaunchScreen.storyboard */; }; + E51DC13AF85DD21112DB2607 /* Pods_hola_cdn_example_ios.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 31A4A58140705FA088DE60A1 /* Pods_hola_cdn_example_ios.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 31A4A58140705FA088DE60A1 /* Pods_hola_cdn_example_ios.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_hola_cdn_example_ios.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 631537CC5848F9D9DA503820 /* Pods-hola-cdn-example-ios.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-hola-cdn-example-ios.debug.xcconfig"; path = "Pods/Target Support Files/Pods-hola-cdn-example-ios/Pods-hola-cdn-example-ios.debug.xcconfig"; sourceTree = ""; }; + 973D4A4147632B1AC2C1A900 /* Pods-hola-cdn-example-ios.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-hola-cdn-example-ios.release.xcconfig"; path = "Pods/Target Support Files/Pods-hola-cdn-example-ios/Pods-hola-cdn-example-ios.release.xcconfig"; sourceTree = ""; }; + 97656F341E373FBA001B738F /* hola-cdn-example-ios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "hola-cdn-example-ios.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 97656F381E373FBA001B738F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 97656F3A1E373FBA001B738F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 97656F3B1E373FBA001B738F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 97656F3D1E373FBA001B738F /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 97656F3E1E373FBA001B738F /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 97656F411E373FBA001B738F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97656F431E373FBA001B738F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97656F461E373FBA001B738F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97656F481E373FBA001B738F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97656F311E373FBA001B738F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E51DC13AF85DD21112DB2607 /* Pods_hola_cdn_example_ios.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3E663EC38594B3215227B7B2 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 31A4A58140705FA088DE60A1 /* Pods_hola_cdn_example_ios.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 97656F2B1E373FBA001B738F = { + isa = PBXGroup; + children = ( + 97656F361E373FBA001B738F /* hola-cdn-example-ios */, + 97656F351E373FBA001B738F /* Products */, + E293F3742953F4B9EF58527D /* Pods */, + 3E663EC38594B3215227B7B2 /* Frameworks */, + ); + sourceTree = ""; + }; + 97656F351E373FBA001B738F /* Products */ = { + isa = PBXGroup; + children = ( + 97656F341E373FBA001B738F /* hola-cdn-example-ios.app */, + ); + name = Products; + sourceTree = ""; + }; + 97656F361E373FBA001B738F /* hola-cdn-example-ios */ = { + isa = PBXGroup; + children = ( + 97656F3A1E373FBA001B738F /* AppDelegate.h */, + 97656F3B1E373FBA001B738F /* AppDelegate.m */, + 97656F3D1E373FBA001B738F /* ViewController.h */, + 97656F3E1E373FBA001B738F /* ViewController.m */, + 97656F401E373FBA001B738F /* Main.storyboard */, + 97656F431E373FBA001B738F /* Assets.xcassets */, + 97656F451E373FBA001B738F /* LaunchScreen.storyboard */, + 97656F481E373FBA001B738F /* Info.plist */, + 97656F371E373FBA001B738F /* Supporting Files */, + ); + path = "hola-cdn-example-ios"; + sourceTree = ""; + }; + 97656F371E373FBA001B738F /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 97656F381E373FBA001B738F /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + E293F3742953F4B9EF58527D /* Pods */ = { + isa = PBXGroup; + children = ( + 631537CC5848F9D9DA503820 /* Pods-hola-cdn-example-ios.debug.xcconfig */, + 973D4A4147632B1AC2C1A900 /* Pods-hola-cdn-example-ios.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97656F331E373FBA001B738F /* hola-cdn-example-ios */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97656F4B1E373FBA001B738F /* Build configuration list for PBXNativeTarget "hola-cdn-example-ios" */; + buildPhases = ( + 4B94E52788203FF109D6DA5F /* [CP] Check Pods Manifest.lock */, + 97656F301E373FBA001B738F /* Sources */, + 97656F311E373FBA001B738F /* Frameworks */, + 97656F321E373FBA001B738F /* Resources */, + F97A3210DE657277C611ADD4 /* [CP] Embed Pods Frameworks */, + 44F298CFBC688E10016ABAE2 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "hola-cdn-example-ios"; + productName = "hola-cdn-example-ios"; + productReference = 97656F341E373FBA001B738F /* hola-cdn-example-ios.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97656F2C1E373FBA001B738F /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0820; + TargetAttributes = { + 97656F331E373FBA001B738F = { + CreatedOnToolsVersion = 8.2.1; + DevelopmentTeam = H266NKJGCY; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 97656F2F1E373FBA001B738F /* Build configuration list for PBXProject "hola-cdn-example-ios" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97656F2B1E373FBA001B738F; + productRefGroup = 97656F351E373FBA001B738F /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97656F331E373FBA001B738F /* hola-cdn-example-ios */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97656F321E373FBA001B738F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97656F471E373FBA001B738F /* LaunchScreen.storyboard in Resources */, + 97656F441E373FBA001B738F /* Assets.xcassets in Resources */, + 97656F421E373FBA001B738F /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 44F298CFBC688E10016ABAE2 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-hola-cdn-example-ios/Pods-hola-cdn-example-ios-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 4B94E52788203FF109D6DA5F /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + F97A3210DE657277C611ADD4 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-hola-cdn-example-ios/Pods-hola-cdn-example-ios-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97656F301E373FBA001B738F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97656F3F1E373FBA001B738F /* ViewController.m in Sources */, + 97656F3C1E373FBA001B738F /* AppDelegate.m in Sources */, + 97656F391E373FBA001B738F /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97656F401E373FBA001B738F /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97656F411E373FBA001B738F /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97656F451E373FBA001B738F /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97656F461E373FBA001B738F /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 97656F491E373FBA001B738F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97656F4A1E373FBA001B738F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97656F4C1E373FBA001B738F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 631537CC5848F9D9DA503820 /* Pods-hola-cdn-example-ios.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = H266NKJGCY; + INFOPLIST_FILE = "hola-cdn-example-ios/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.hola.hola-cdn-example-ios"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 97656F4D1E373FBA001B738F /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 973D4A4147632B1AC2C1A900 /* Pods-hola-cdn-example-ios.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = H266NKJGCY; + INFOPLIST_FILE = "hola-cdn-example-ios/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.hola.hola-cdn-example-ios"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97656F2F1E373FBA001B738F /* Build configuration list for PBXProject "hola-cdn-example-ios" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97656F491E373FBA001B738F /* Debug */, + 97656F4A1E373FBA001B738F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97656F4B1E373FBA001B738F /* Build configuration list for PBXNativeTarget "hola-cdn-example-ios" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97656F4C1E373FBA001B738F /* Debug */, + 97656F4D1E373FBA001B738F /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97656F2C1E373FBA001B738F /* Project object */; +} diff --git a/examples/hola-cdn-example-ios/hola-cdn-example-ios/AppDelegate.h b/examples/hola-cdn-example-ios/hola-cdn-example-ios/AppDelegate.h new file mode 100644 index 0000000..c6afeb0 --- /dev/null +++ b/examples/hola-cdn-example-ios/hola-cdn-example-ios/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// hola-cdn-example-ios +// +// Created by norlin on 24/01/2017. +// +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/examples/hola-cdn-example-ios/hola-cdn-example-ios/AppDelegate.m b/examples/hola-cdn-example-ios/hola-cdn-example-ios/AppDelegate.m new file mode 100644 index 0000000..b6bed00 --- /dev/null +++ b/examples/hola-cdn-example-ios/hola-cdn-example-ios/AppDelegate.m @@ -0,0 +1,51 @@ +// +// AppDelegate.m +// hola-cdn-example-ios +// +// Created by norlin on 24/01/2017. +// +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. +} + + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. +} + + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + + +@end diff --git a/examples/hola-cdn-example-ios/hola-cdn-example-ios/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/hola-cdn-example-ios/hola-cdn-example-ios/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..36d2c80 --- /dev/null +++ b/examples/hola-cdn-example-ios/hola-cdn-example-ios/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/hola-cdn-example-ios/hola-cdn-example-ios/Base.lproj/LaunchScreen.storyboard b/examples/hola-cdn-example-ios/hola-cdn-example-ios/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..fdf3f97 --- /dev/null +++ b/examples/hola-cdn-example-ios/hola-cdn-example-ios/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/hola-cdn-example-ios/hola-cdn-example-ios/Base.lproj/Main.storyboard b/examples/hola-cdn-example-ios/hola-cdn-example-ios/Base.lproj/Main.storyboard new file mode 100644 index 0000000..4529698 --- /dev/null +++ b/examples/hola-cdn-example-ios/hola-cdn-example-ios/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/hola-cdn-example-ios/hola-cdn-example-ios/Info.plist b/examples/hola-cdn-example-ios/hola-cdn-example-ios/Info.plist new file mode 100644 index 0000000..d052473 --- /dev/null +++ b/examples/hola-cdn-example-ios/hola-cdn-example-ios/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/examples/hola-cdn-example-ios/hola-cdn-example-ios/ViewController.h b/examples/hola-cdn-example-ios/hola-cdn-example-ios/ViewController.h new file mode 100644 index 0000000..3a5bd48 --- /dev/null +++ b/examples/hola-cdn-example-ios/hola-cdn-example-ios/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// hola-cdn-example-ios +// +// Created by norlin on 24/01/2017. +// +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/examples/hola-cdn-example-ios/hola-cdn-example-ios/ViewController.m b/examples/hola-cdn-example-ios/hola-cdn-example-ios/ViewController.m new file mode 100644 index 0000000..fe0417b --- /dev/null +++ b/examples/hola-cdn-example-ios/hola-cdn-example-ios/ViewController.m @@ -0,0 +1,51 @@ +// +// ViewController.m +// hola-cdn-example-ios +// +// Created by norlin on 24/01/2017. +// +// + +#import "ViewController.h" +#import "hola_cdn_sdk.h" + +@implementation ViewController + +HolaCDN *cdn; +AVPlayer *player; +AVPlayerLayer *layer; + +- (void)viewDidLoad { + [super viewDidLoad]; + + // turn on debug logging + [HolaCDN setLogLevel:HolaCDNLogLevelDebug]; + + // create a HolaCDN instance for specific customer + cdn = [HolaCDN cdnWithCustomer:@"demo" usingZone:nil andMode:@"cdn"]; + + // set timeout to 5 sec (default is 2 sec) + // in case if HolaCDN JS Library is not downloaded in this timeout, the video will start to play without HolaCDN + // in that case, you may see WARN log messages similar to this one: + // [WARN/Proxy:1] Trying to execute js: 'on_timeupdate'; no delegate found! + [cdn setLoaderTimeout:5]; + + // init player for specific video + NSURL *url = [NSURL URLWithString:@"https://player.h-cdn.org/static/hls/cdn2/master.m3u8"]; + player = [cdn playerWithURL:url]; + [cdn attach:player]; + + // add player to the view + layer = [AVPlayerLayer playerLayerWithPlayer:player]; + [self.view.layer addSublayer:layer]; + + // start playback + [player play]; +} + +-(void)viewDidLayoutSubviews { + // resize player layer to the view's bounds + layer.frame = self.view.bounds; +} + +@end diff --git a/examples/hola-cdn-example-ios/hola-cdn-example-ios/main.m b/examples/hola-cdn-example-ios/hola-cdn-example-ios/main.m new file mode 100644 index 0000000..17fd9c9 --- /dev/null +++ b/examples/hola-cdn-example-ios/hola-cdn-example-ios/main.m @@ -0,0 +1,16 @@ +// +// main.m +// hola-cdn-example-ios +// +// Created by norlin on 24/01/2017. +// +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +}