├── .gitignore ├── CloudSharingExample.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── hans.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── hans.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ ├── CloudSharingExample.xcscheme │ │ └── xcschememanagement.plist │ └── hknoechel.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── CloudSharingExample.xcscheme │ └── xcschememanagement.plist ├── CloudSharingExample ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── titanium_mobile.imageset │ │ ├── Contents.json │ │ ├── titanium_mobile-1.png │ │ ├── titanium_mobile-2.png │ │ └── titanium_mobile.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CloudSharingExample.entitlements ├── Info.plist ├── ViewController.swift └── titanium_mobile.png ├── README.md └── example.png /.gitignore: -------------------------------------------------------------------------------- 1 | *.xcuserstate 2 | -------------------------------------------------------------------------------- /CloudSharingExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3A18CA2F1D10596400EFB8DC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A18CA2E1D10596400EFB8DC /* AppDelegate.swift */; }; 11 | 3A18CA311D10596400EFB8DC /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A18CA301D10596400EFB8DC /* ViewController.swift */; }; 12 | 3A18CA341D10596400EFB8DC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3A18CA321D10596400EFB8DC /* Main.storyboard */; }; 13 | 3A18CA361D10596400EFB8DC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3A18CA351D10596400EFB8DC /* Assets.xcassets */; }; 14 | 3A18CA391D10596400EFB8DC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3A18CA371D10596400EFB8DC /* LaunchScreen.storyboard */; }; 15 | 3A18CA431D105C0300EFB8DC /* CloudKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A18CA421D105C0300EFB8DC /* CloudKit.framework */; }; 16 | 3A18CA451D105D0F00EFB8DC /* titanium_mobile.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A18CA441D105D0F00EFB8DC /* titanium_mobile.png */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 3A18CA2B1D10596300EFB8DC /* CloudSharingExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CloudSharingExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 3A18CA2E1D10596400EFB8DC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 22 | 3A18CA301D10596400EFB8DC /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 23 | 3A18CA331D10596400EFB8DC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 24 | 3A18CA351D10596400EFB8DC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 25 | 3A18CA381D10596400EFB8DC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 26 | 3A18CA3A1D10596400EFB8DC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 27 | 3A18CA401D105BF700EFB8DC /* CloudSharingExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = CloudSharingExample.entitlements; sourceTree = ""; }; 28 | 3A18CA421D105C0300EFB8DC /* CloudKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CloudKit.framework; path = System/Library/Frameworks/CloudKit.framework; sourceTree = SDKROOT; }; 29 | 3A18CA441D105D0F00EFB8DC /* titanium_mobile.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = titanium_mobile.png; sourceTree = ""; }; 30 | /* End PBXFileReference section */ 31 | 32 | /* Begin PBXFrameworksBuildPhase section */ 33 | 3A18CA281D10596300EFB8DC /* Frameworks */ = { 34 | isa = PBXFrameworksBuildPhase; 35 | buildActionMask = 2147483647; 36 | files = ( 37 | 3A18CA431D105C0300EFB8DC /* CloudKit.framework in Frameworks */, 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXFrameworksBuildPhase section */ 42 | 43 | /* Begin PBXGroup section */ 44 | 3A18CA221D10596300EFB8DC = { 45 | isa = PBXGroup; 46 | children = ( 47 | 3A18CA2D1D10596300EFB8DC /* CloudSharingExample */, 48 | 3A18CA2C1D10596300EFB8DC /* Products */, 49 | 3A18CA411D105C0300EFB8DC /* Frameworks */, 50 | ); 51 | sourceTree = ""; 52 | }; 53 | 3A18CA2C1D10596300EFB8DC /* Products */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 3A18CA2B1D10596300EFB8DC /* CloudSharingExample.app */, 57 | ); 58 | name = Products; 59 | sourceTree = ""; 60 | }; 61 | 3A18CA2D1D10596300EFB8DC /* CloudSharingExample */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 3A18CA461D105D1600EFB8DC /* Resources */, 65 | 3A18CA2E1D10596400EFB8DC /* AppDelegate.swift */, 66 | 3A18CA301D10596400EFB8DC /* ViewController.swift */, 67 | 3A18CA351D10596400EFB8DC /* Assets.xcassets */, 68 | 3A18CA3A1D10596400EFB8DC /* Info.plist */, 69 | ); 70 | path = CloudSharingExample; 71 | sourceTree = ""; 72 | }; 73 | 3A18CA411D105C0300EFB8DC /* Frameworks */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 3A18CA421D105C0300EFB8DC /* CloudKit.framework */, 77 | ); 78 | name = Frameworks; 79 | sourceTree = ""; 80 | }; 81 | 3A18CA461D105D1600EFB8DC /* Resources */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 3A18CA401D105BF700EFB8DC /* CloudSharingExample.entitlements */, 85 | 3A18CA321D10596400EFB8DC /* Main.storyboard */, 86 | 3A18CA441D105D0F00EFB8DC /* titanium_mobile.png */, 87 | 3A18CA371D10596400EFB8DC /* LaunchScreen.storyboard */, 88 | ); 89 | name = Resources; 90 | sourceTree = ""; 91 | }; 92 | /* End PBXGroup section */ 93 | 94 | /* Begin PBXNativeTarget section */ 95 | 3A18CA2A1D10596300EFB8DC /* CloudSharingExample */ = { 96 | isa = PBXNativeTarget; 97 | buildConfigurationList = 3A18CA3D1D10596400EFB8DC /* Build configuration list for PBXNativeTarget "CloudSharingExample" */; 98 | buildPhases = ( 99 | 3A18CA271D10596300EFB8DC /* Sources */, 100 | 3A18CA281D10596300EFB8DC /* Frameworks */, 101 | 3A18CA291D10596300EFB8DC /* Resources */, 102 | ); 103 | buildRules = ( 104 | ); 105 | dependencies = ( 106 | ); 107 | name = CloudSharingExample; 108 | productName = CloudSharingExample; 109 | productReference = 3A18CA2B1D10596300EFB8DC /* CloudSharingExample.app */; 110 | productType = "com.apple.product-type.application"; 111 | }; 112 | /* End PBXNativeTarget section */ 113 | 114 | /* Begin PBXProject section */ 115 | 3A18CA231D10596300EFB8DC /* Project object */ = { 116 | isa = PBXProject; 117 | attributes = { 118 | LastSwiftUpdateCheck = 0800; 119 | LastUpgradeCheck = 0800; 120 | ORGANIZATIONNAME = Appcelerator; 121 | TargetAttributes = { 122 | 3A18CA2A1D10596300EFB8DC = { 123 | CreatedOnToolsVersion = 8.0; 124 | DevelopmentTeamName = "Hans Knoechel"; 125 | ProvisioningStyle = Automatic; 126 | SystemCapabilities = { 127 | com.apple.iCloud = { 128 | enabled = 1; 129 | }; 130 | }; 131 | }; 132 | }; 133 | }; 134 | buildConfigurationList = 3A18CA261D10596300EFB8DC /* Build configuration list for PBXProject "CloudSharingExample" */; 135 | compatibilityVersion = "Xcode 3.2"; 136 | developmentRegion = English; 137 | hasScannedForEncodings = 0; 138 | knownRegions = ( 139 | en, 140 | Base, 141 | ); 142 | mainGroup = 3A18CA221D10596300EFB8DC; 143 | productRefGroup = 3A18CA2C1D10596300EFB8DC /* Products */; 144 | projectDirPath = ""; 145 | projectRoot = ""; 146 | targets = ( 147 | 3A18CA2A1D10596300EFB8DC /* CloudSharingExample */, 148 | ); 149 | }; 150 | /* End PBXProject section */ 151 | 152 | /* Begin PBXResourcesBuildPhase section */ 153 | 3A18CA291D10596300EFB8DC /* Resources */ = { 154 | isa = PBXResourcesBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | 3A18CA451D105D0F00EFB8DC /* titanium_mobile.png in Resources */, 158 | 3A18CA391D10596400EFB8DC /* LaunchScreen.storyboard in Resources */, 159 | 3A18CA361D10596400EFB8DC /* Assets.xcassets in Resources */, 160 | 3A18CA341D10596400EFB8DC /* Main.storyboard in Resources */, 161 | ); 162 | runOnlyForDeploymentPostprocessing = 0; 163 | }; 164 | /* End PBXResourcesBuildPhase section */ 165 | 166 | /* Begin PBXSourcesBuildPhase section */ 167 | 3A18CA271D10596300EFB8DC /* Sources */ = { 168 | isa = PBXSourcesBuildPhase; 169 | buildActionMask = 2147483647; 170 | files = ( 171 | 3A18CA311D10596400EFB8DC /* ViewController.swift in Sources */, 172 | 3A18CA2F1D10596400EFB8DC /* AppDelegate.swift in Sources */, 173 | ); 174 | runOnlyForDeploymentPostprocessing = 0; 175 | }; 176 | /* End PBXSourcesBuildPhase section */ 177 | 178 | /* Begin PBXVariantGroup section */ 179 | 3A18CA321D10596400EFB8DC /* Main.storyboard */ = { 180 | isa = PBXVariantGroup; 181 | children = ( 182 | 3A18CA331D10596400EFB8DC /* Base */, 183 | ); 184 | name = Main.storyboard; 185 | sourceTree = ""; 186 | }; 187 | 3A18CA371D10596400EFB8DC /* LaunchScreen.storyboard */ = { 188 | isa = PBXVariantGroup; 189 | children = ( 190 | 3A18CA381D10596400EFB8DC /* Base */, 191 | ); 192 | name = LaunchScreen.storyboard; 193 | sourceTree = ""; 194 | }; 195 | /* End PBXVariantGroup section */ 196 | 197 | /* Begin XCBuildConfiguration section */ 198 | 3A18CA3B1D10596400EFB8DC /* Debug */ = { 199 | isa = XCBuildConfiguration; 200 | buildSettings = { 201 | ALWAYS_SEARCH_USER_PATHS = NO; 202 | CLANG_ANALYZER_NONNULL = YES; 203 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 204 | CLANG_CXX_LIBRARY = "libc++"; 205 | CLANG_ENABLE_MODULES = YES; 206 | CLANG_ENABLE_OBJC_ARC = YES; 207 | CLANG_WARN_BOOL_CONVERSION = YES; 208 | CLANG_WARN_CONSTANT_CONVERSION = YES; 209 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 210 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 211 | CLANG_WARN_EMPTY_BODY = YES; 212 | CLANG_WARN_ENUM_CONVERSION = YES; 213 | CLANG_WARN_INT_CONVERSION = YES; 214 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 215 | CLANG_WARN_UNREACHABLE_CODE = YES; 216 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 217 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 218 | COPY_PHASE_STRIP = NO; 219 | DEBUG_INFORMATION_FORMAT = dwarf; 220 | ENABLE_STRICT_OBJC_MSGSEND = YES; 221 | ENABLE_TESTABILITY = YES; 222 | GCC_C_LANGUAGE_STANDARD = gnu99; 223 | GCC_DYNAMIC_NO_PIC = NO; 224 | GCC_NO_COMMON_BLOCKS = YES; 225 | GCC_OPTIMIZATION_LEVEL = 0; 226 | GCC_PREPROCESSOR_DEFINITIONS = ( 227 | "DEBUG=1", 228 | "$(inherited)", 229 | ); 230 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 231 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 232 | GCC_WARN_UNDECLARED_SELECTOR = YES; 233 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 234 | GCC_WARN_UNUSED_FUNCTION = YES; 235 | GCC_WARN_UNUSED_VARIABLE = YES; 236 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 237 | MTL_ENABLE_DEBUG_INFO = YES; 238 | ONLY_ACTIVE_ARCH = YES; 239 | SDKROOT = iphoneos; 240 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 241 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 242 | TARGETED_DEVICE_FAMILY = "1,2"; 243 | }; 244 | name = Debug; 245 | }; 246 | 3A18CA3C1D10596400EFB8DC /* Release */ = { 247 | isa = XCBuildConfiguration; 248 | buildSettings = { 249 | ALWAYS_SEARCH_USER_PATHS = NO; 250 | CLANG_ANALYZER_NONNULL = YES; 251 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 252 | CLANG_CXX_LIBRARY = "libc++"; 253 | CLANG_ENABLE_MODULES = YES; 254 | CLANG_ENABLE_OBJC_ARC = YES; 255 | CLANG_WARN_BOOL_CONVERSION = YES; 256 | CLANG_WARN_CONSTANT_CONVERSION = YES; 257 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 258 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 259 | CLANG_WARN_EMPTY_BODY = YES; 260 | CLANG_WARN_ENUM_CONVERSION = YES; 261 | CLANG_WARN_INT_CONVERSION = YES; 262 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 263 | CLANG_WARN_UNREACHABLE_CODE = YES; 264 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 265 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 266 | COPY_PHASE_STRIP = NO; 267 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 268 | ENABLE_NS_ASSERTIONS = NO; 269 | ENABLE_STRICT_OBJC_MSGSEND = YES; 270 | GCC_C_LANGUAGE_STANDARD = gnu99; 271 | GCC_NO_COMMON_BLOCKS = YES; 272 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 273 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 274 | GCC_WARN_UNDECLARED_SELECTOR = YES; 275 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 276 | GCC_WARN_UNUSED_FUNCTION = YES; 277 | GCC_WARN_UNUSED_VARIABLE = YES; 278 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 279 | MTL_ENABLE_DEBUG_INFO = NO; 280 | SDKROOT = iphoneos; 281 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 282 | TARGETED_DEVICE_FAMILY = "1,2"; 283 | VALIDATE_PRODUCT = YES; 284 | }; 285 | name = Release; 286 | }; 287 | 3A18CA3E1D10596400EFB8DC /* Debug */ = { 288 | isa = XCBuildConfiguration; 289 | buildSettings = { 290 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 291 | CODE_SIGN_ENTITLEMENTS = CloudSharingExample/CloudSharingExample.entitlements; 292 | DEVELOPMENT_TEAM = ""; 293 | INFOPLIST_FILE = CloudSharingExample/Info.plist; 294 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 295 | PRODUCT_BUNDLE_IDENTIFIER = com.appcelerator.CloudSharingExample; 296 | PRODUCT_NAME = "$(TARGET_NAME)"; 297 | SWIFT_VERSION = 3.0; 298 | }; 299 | name = Debug; 300 | }; 301 | 3A18CA3F1D10596400EFB8DC /* Release */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 305 | CODE_SIGN_ENTITLEMENTS = CloudSharingExample/CloudSharingExample.entitlements; 306 | DEVELOPMENT_TEAM = ""; 307 | INFOPLIST_FILE = CloudSharingExample/Info.plist; 308 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 309 | PRODUCT_BUNDLE_IDENTIFIER = com.appcelerator.CloudSharingExample; 310 | PRODUCT_NAME = "$(TARGET_NAME)"; 311 | SWIFT_VERSION = 3.0; 312 | }; 313 | name = Release; 314 | }; 315 | /* End XCBuildConfiguration section */ 316 | 317 | /* Begin XCConfigurationList section */ 318 | 3A18CA261D10596300EFB8DC /* Build configuration list for PBXProject "CloudSharingExample" */ = { 319 | isa = XCConfigurationList; 320 | buildConfigurations = ( 321 | 3A18CA3B1D10596400EFB8DC /* Debug */, 322 | 3A18CA3C1D10596400EFB8DC /* Release */, 323 | ); 324 | defaultConfigurationIsVisible = 0; 325 | defaultConfigurationName = Release; 326 | }; 327 | 3A18CA3D1D10596400EFB8DC /* Build configuration list for PBXNativeTarget "CloudSharingExample" */ = { 328 | isa = XCConfigurationList; 329 | buildConfigurations = ( 330 | 3A18CA3E1D10596400EFB8DC /* Debug */, 331 | 3A18CA3F1D10596400EFB8DC /* Release */, 332 | ); 333 | defaultConfigurationIsVisible = 0; 334 | defaultConfigurationName = Release; 335 | }; 336 | /* End XCConfigurationList section */ 337 | }; 338 | rootObject = 3A18CA231D10596300EFB8DC /* Project object */; 339 | } 340 | -------------------------------------------------------------------------------- /CloudSharingExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CloudSharingExample.xcodeproj/project.xcworkspace/xcuserdata/hans.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/CloudSharingControllerExample/c623efbd9ad2e53eb83c1502d1695f614a00e358/CloudSharingExample.xcodeproj/project.xcworkspace/xcuserdata/hans.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /CloudSharingExample.xcodeproj/xcuserdata/hans.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /CloudSharingExample.xcodeproj/xcuserdata/hans.xcuserdatad/xcschemes/CloudSharingExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /CloudSharingExample.xcodeproj/xcuserdata/hans.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CloudSharingExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 3A18CA2A1D10596300EFB8DC 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /CloudSharingExample.xcodeproj/xcuserdata/hknoechel.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /CloudSharingExample.xcodeproj/xcuserdata/hknoechel.xcuserdatad/xcschemes/CloudSharingExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /CloudSharingExample.xcodeproj/xcuserdata/hknoechel.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CloudSharingExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 3A18CA2A1D10596300EFB8DC 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /CloudSharingExample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // CloudSharingExample 4 | // 5 | // Created by Hans Knöchel on 14.06.16. 6 | // Copyright © 2016 Appcelerator. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CloudKit 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | 18 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 19 | 20 | // Override point for customization after application launch. 21 | return true 22 | } 23 | 24 | func applicationWillResignActive(_ application: UIApplication) { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 27 | } 28 | 29 | func applicationDidEnterBackground(_ application: UIApplication) { 30 | // 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. 31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 32 | } 33 | 34 | func applicationWillEnterForeground(_ application: UIApplication) { 35 | // 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. 36 | } 37 | 38 | func applicationDidBecomeActive(_ application: UIApplication) { 39 | // 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. 40 | } 41 | 42 | func applicationWillTerminate(_ application: UIApplication) { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | func application(_ application: UIApplication, userDidAcceptCloudKitShareWith userAcceptedCloudKitSharedWith: CKShareMetadata) { 47 | print("Accepted CloudKit sharing from: \(userAcceptedCloudKitSharedWith.ownerIdentity.nameComponents?.givenName)") 48 | } 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /CloudSharingExample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /CloudSharingExample/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /CloudSharingExample/Assets.xcassets/titanium_mobile.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "titanium_mobile.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "titanium_mobile-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "titanium_mobile-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /CloudSharingExample/Assets.xcassets/titanium_mobile.imageset/titanium_mobile-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/CloudSharingControllerExample/c623efbd9ad2e53eb83c1502d1695f614a00e358/CloudSharingExample/Assets.xcassets/titanium_mobile.imageset/titanium_mobile-1.png -------------------------------------------------------------------------------- /CloudSharingExample/Assets.xcassets/titanium_mobile.imageset/titanium_mobile-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/CloudSharingControllerExample/c623efbd9ad2e53eb83c1502d1695f614a00e358/CloudSharingExample/Assets.xcassets/titanium_mobile.imageset/titanium_mobile-2.png -------------------------------------------------------------------------------- /CloudSharingExample/Assets.xcassets/titanium_mobile.imageset/titanium_mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/CloudSharingControllerExample/c623efbd9ad2e53eb83c1502d1695f614a00e358/CloudSharingExample/Assets.xcassets/titanium_mobile.imageset/titanium_mobile.png -------------------------------------------------------------------------------- /CloudSharingExample/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /CloudSharingExample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /CloudSharingExample/CloudSharingExample.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.icloud-container-identifiers 6 | 7 | iCloud.$(CFBundleIdentifier) 8 | 9 | com.apple.developer.icloud-services 10 | 11 | CloudKit 12 | 13 | com.apple.developer.ubiquity-kvstore-identifier 14 | $(TeamIdentifierPrefix)$(CFBundleIdentifier) 15 | 16 | 17 | -------------------------------------------------------------------------------- /CloudSharingExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /CloudSharingExample/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // CloudSharingExample 4 | // 5 | // Created by Hans Knöchel on 14.06.16. 6 | // Copyright © 2016 Appcelerator. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CloudKit 11 | 12 | class ViewController: UIViewController, UICloudSharingControllerDelegate { 13 | 14 | @IBAction func didTapCloudSharingButton() { 15 | 16 | let cloudSharingController = UICloudSharingController(preparationHandler: { controller, preparationCompletionHandler in 17 | 18 | // Create image record 19 | let fileName = "titanium_mobile" 20 | let newRecord = CKRecord(recordType: "ImageRecord", recordID: CKRecordID(recordName: "test")) 21 | let image = UIImage(named: fileName) 22 | 23 | // Write to filesystem 24 | let documentDirectory = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] 25 | let imageFilePath = (documentDirectory as NSString).appendingPathComponent(fileName) 26 | let myUrl = URL(fileURLWithPath: imageFilePath) 27 | 28 | do { 29 | let data = UIImagePNGRepresentation(image!) 30 | try data?.write(to: myUrl, options: .atomicWrite) 31 | let asset = CKAsset(fileURL: myUrl) 32 | 33 | newRecord["image"] = asset 34 | } catch { 35 | print("Could not write to filesystem") 36 | } 37 | 38 | // Initialize cloud sharing 39 | let share: CKShare = CKShare(rootRecord: newRecord) 40 | share[CKShareTitleKey] = "\(fileName).png" as CKRecordValue 41 | share[CKShareTypeKey] = "com.appcelerator.CloudSharingExample" as CKRecordValue 42 | 43 | // Prepare records 44 | let modifyRecordsOperation = CKModifyRecordsOperation(recordsToSave: [newRecord, share], recordIDsToDelete: nil) 45 | 46 | modifyRecordsOperation.timeoutIntervalForRequest = 15 47 | modifyRecordsOperation.timeoutIntervalForResource = 15 48 | 49 | modifyRecordsOperation.modifyRecordsCompletionBlock = { records, recordIDs, error in 50 | if error != nil { 51 | print("Error: \(String(describing: error?.localizedDescription))") 52 | } 53 | preparationCompletionHandler(share, CKContainer.default(), error) 54 | } 55 | 56 | OperationQueue().addOperation(modifyRecordsOperation) 57 | }) 58 | 59 | // Set sharing delegate 60 | cloudSharingController.delegate = self 61 | 62 | // Set sharing permissions 63 | cloudSharingController.availablePermissions = [.allowPublic, .allowReadOnly] 64 | 65 | // Show cloud shareing dialog 66 | self.present(cloudSharingController, animated: true, completion: nil) 67 | } 68 | 69 | // MARK: CloudKit Delegates 70 | 71 | func itemTitle(for csc: UICloudSharingController) -> String? { 72 | return "titanium_mobile.png" 73 | } 74 | 75 | @available(iOS 10.0, *) 76 | func cloudSharingController(_ csc: UICloudSharingController, failedToSaveShareWithError error: Error) { 77 | print("failedToSaveShareWithError: \(error.localizedDescription)") 78 | } 79 | 80 | func cloudSharingControllerDidSaveShare(_ csc: UICloudSharingController) { 81 | print("cloudSharingControllerDidSaveShare") 82 | } 83 | 84 | func cloudSharingControllerDidStopSharing(_ csc: UICloudSharingController) { 85 | print("cloudSharingControllerDidStopSharing") 86 | } 87 | } 88 | 89 | -------------------------------------------------------------------------------- /CloudSharingExample/titanium_mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/CloudSharingControllerExample/c623efbd9ad2e53eb83c1502d1695f614a00e358/CloudSharingExample/titanium_mobile.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### CloudSharing Example 2 | --- 3 | This example project demonstrates the usage of the new `UICloudSharingController` introduced in iOS 10. 4 | Please check out the [API diffs](https://developer.apple.com/library/prerelease/content/releasenotes/General/iOS10APIDiffs/Swift/UIKit.html) for more information on the new API's. 5 | As for now, Apple does not document much around the API, so this example might be updated over the next months. 6 | 7 | CloudSharing Example 8 | 9 | ### Contributing 10 | --- 11 | If you have an improvement or issue, please let me know and open an [Issue](https://github.com/hansemannn/CloudSharingControllerExample/issues) or [Pull Request](https://github.com/hansemannn/CloudSharingControllerExample/pulls). Thanks! :rocket: 12 | 13 | -------------------------------------------------------------------------------- /example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hansemannn/CloudSharingControllerExample/c623efbd9ad2e53eb83c1502d1695f614a00e358/example.png --------------------------------------------------------------------------------