diff --git a/.gitignore b/.gitignore index 16f37c2..d877e18 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ TestApp/build *.mode1v3 *.pbxuser xcuserdata -.DS_Store \ No newline at end of file +.DS_Store +TestApp.xccheckout +Example2/Example2.xcodeproj/project.xcworkspace/xcshareddata +Example1/Example1.xcodeproj/project.xcworkspace/xcshareddata diff --git a/FsprgEmbeddedStore.xcodeproj/project.pbxproj b/FsprgEmbeddedStore.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6a40df9 --- /dev/null +++ b/FsprgEmbeddedStore.xcodeproj/project.pbxproj @@ -0,0 +1,595 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 53; + objects = { + +/* Begin PBXBuildFile section */ + 507FDCBB1D9983F400FE07E7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 507FDCBA1D9983F400FE07E7 /* AppDelegate.swift */; }; + 507FDCBD1D9983F400FE07E7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 507FDCBC1D9983F400FE07E7 /* Assets.xcassets */; }; + 507FDCC01D9983F400FE07E7 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 507FDCBE1D9983F400FE07E7 /* MainMenu.xib */; }; + 507FDCC51D9983FD00FE07E7 /* FsprgEmbeddedStore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DABC89ED1D3E913200B2FA05 /* FsprgEmbeddedStore.framework */; }; + 507FDCC61D9983FD00FE07E7 /* FsprgEmbeddedStore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DABC89ED1D3E913200B2FA05 /* FsprgEmbeddedStore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + DABC89F11D3E913200B2FA05 /* FsprgEmbeddedStore.h in Headers */ = {isa = PBXBuildFile; fileRef = DABC89F01D3E913200B2FA05 /* FsprgEmbeddedStore.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DABC8A161D3E915F00B2FA05 /* FsprgEmbeddedStoreController.h in Headers */ = {isa = PBXBuildFile; fileRef = DABC89FA1D3E915F00B2FA05 /* FsprgEmbeddedStoreController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DABC8A171D3E915F00B2FA05 /* FsprgEmbeddedStoreController.m in Sources */ = {isa = PBXBuildFile; fileRef = DABC89FB1D3E915F00B2FA05 /* FsprgEmbeddedStoreController.m */; }; + DABC8A181D3E915F00B2FA05 /* FsprgEmbeddedStoreDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = DABC89FC1D3E915F00B2FA05 /* FsprgEmbeddedStoreDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DABC8A191D3E915F00B2FA05 /* FsprgOrderDocumentRepresentation.h in Headers */ = {isa = PBXBuildFile; fileRef = DABC89FD1D3E915F00B2FA05 /* FsprgOrderDocumentRepresentation.h */; }; + DABC8A1A1D3E915F00B2FA05 /* FsprgOrderDocumentRepresentation.m in Sources */ = {isa = PBXBuildFile; fileRef = DABC89FE1D3E915F00B2FA05 /* FsprgOrderDocumentRepresentation.m */; }; + DABC8A1B1D3E915F00B2FA05 /* FsprgOrderView.h in Headers */ = {isa = PBXBuildFile; fileRef = DABC89FF1D3E915F00B2FA05 /* FsprgOrderView.h */; }; + DABC8A1C1D3E915F00B2FA05 /* FsprgOrderView.m in Sources */ = {isa = PBXBuildFile; fileRef = DABC8A001D3E915F00B2FA05 /* FsprgOrderView.m */; }; + DABC8A1D1D3E915F00B2FA05 /* FsprgStoreParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = DABC8A011D3E915F00B2FA05 /* FsprgStoreParameters.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DABC8A1E1D3E915F00B2FA05 /* FsprgStoreParameters.m in Sources */ = {isa = PBXBuildFile; fileRef = DABC8A021D3E915F00B2FA05 /* FsprgStoreParameters.m */; }; + DABC8A1F1D3E915F00B2FA05 /* FsprgFileDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = DABC8A041D3E915F00B2FA05 /* FsprgFileDownload.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DABC8A201D3E915F00B2FA05 /* FsprgFileDownload.m in Sources */ = {isa = PBXBuildFile; fileRef = DABC8A051D3E915F00B2FA05 /* FsprgFileDownload.m */; }; + DABC8A211D3E915F00B2FA05 /* FsprgFulfillment.h in Headers */ = {isa = PBXBuildFile; fileRef = DABC8A061D3E915F00B2FA05 /* FsprgFulfillment.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DABC8A221D3E915F00B2FA05 /* FsprgFulfillment.m in Sources */ = {isa = PBXBuildFile; fileRef = DABC8A071D3E915F00B2FA05 /* FsprgFulfillment.m */; }; + DABC8A231D3E915F00B2FA05 /* FsprgLicense.h in Headers */ = {isa = PBXBuildFile; fileRef = DABC8A081D3E915F00B2FA05 /* FsprgLicense.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DABC8A241D3E915F00B2FA05 /* FsprgLicense.m in Sources */ = {isa = PBXBuildFile; fileRef = DABC8A091D3E915F00B2FA05 /* FsprgLicense.m */; }; + DABC8A251D3E915F00B2FA05 /* FsprgOrder.h in Headers */ = {isa = PBXBuildFile; fileRef = DABC8A0A1D3E915F00B2FA05 /* FsprgOrder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DABC8A261D3E915F00B2FA05 /* FsprgOrder.m in Sources */ = {isa = PBXBuildFile; fileRef = DABC8A0B1D3E915F00B2FA05 /* FsprgOrder.m */; }; + DABC8A271D3E915F00B2FA05 /* FsprgOrderItem.h in Headers */ = {isa = PBXBuildFile; fileRef = DABC8A0C1D3E915F00B2FA05 /* FsprgOrderItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DABC8A281D3E915F00B2FA05 /* FsprgOrderItem.m in Sources */ = {isa = PBXBuildFile; fileRef = DABC8A0D1D3E915F00B2FA05 /* FsprgOrderItem.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 507FDCC71D9983FD00FE07E7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = DABC89E41D3E913200B2FA05 /* Project object */; + proxyType = 1; + remoteGlobalIDString = DABC89EC1D3E913200B2FA05; + remoteInfo = FsprgEmbeddedStore; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 507FDCC91D9983FD00FE07E7 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 507FDCC61D9983FD00FE07E7 /* FsprgEmbeddedStore.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 507FDCB81D9983F400FE07E7 /* TestUsage-Swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "TestUsage-Swift.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 507FDCBA1D9983F400FE07E7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 507FDCBC1D9983F400FE07E7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 507FDCBF1D9983F400FE07E7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 507FDCC11D9983F400FE07E7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + DABC89ED1D3E913200B2FA05 /* FsprgEmbeddedStore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FsprgEmbeddedStore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + DABC89F01D3E913200B2FA05 /* FsprgEmbeddedStore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FsprgEmbeddedStore.h; sourceTree = ""; }; + DABC89F21D3E913200B2FA05 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + DABC89FA1D3E915F00B2FA05 /* FsprgEmbeddedStoreController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FsprgEmbeddedStoreController.h; sourceTree = ""; }; + DABC89FB1D3E915F00B2FA05 /* FsprgEmbeddedStoreController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FsprgEmbeddedStoreController.m; sourceTree = ""; }; + DABC89FC1D3E915F00B2FA05 /* FsprgEmbeddedStoreDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FsprgEmbeddedStoreDelegate.h; sourceTree = ""; }; + DABC89FD1D3E915F00B2FA05 /* FsprgOrderDocumentRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FsprgOrderDocumentRepresentation.h; sourceTree = ""; }; + DABC89FE1D3E915F00B2FA05 /* FsprgOrderDocumentRepresentation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FsprgOrderDocumentRepresentation.m; sourceTree = ""; }; + DABC89FF1D3E915F00B2FA05 /* FsprgOrderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FsprgOrderView.h; sourceTree = ""; }; + DABC8A001D3E915F00B2FA05 /* FsprgOrderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FsprgOrderView.m; sourceTree = ""; }; + DABC8A011D3E915F00B2FA05 /* FsprgStoreParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FsprgStoreParameters.h; sourceTree = ""; }; + DABC8A021D3E915F00B2FA05 /* FsprgStoreParameters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FsprgStoreParameters.m; sourceTree = ""; }; + DABC8A041D3E915F00B2FA05 /* FsprgFileDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FsprgFileDownload.h; sourceTree = ""; }; + DABC8A051D3E915F00B2FA05 /* FsprgFileDownload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FsprgFileDownload.m; sourceTree = ""; }; + DABC8A061D3E915F00B2FA05 /* FsprgFulfillment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FsprgFulfillment.h; sourceTree = ""; }; + DABC8A071D3E915F00B2FA05 /* FsprgFulfillment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FsprgFulfillment.m; sourceTree = ""; }; + DABC8A081D3E915F00B2FA05 /* FsprgLicense.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FsprgLicense.h; sourceTree = ""; }; + DABC8A091D3E915F00B2FA05 /* FsprgLicense.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FsprgLicense.m; sourceTree = ""; }; + DABC8A0A1D3E915F00B2FA05 /* FsprgOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FsprgOrder.h; sourceTree = ""; }; + DABC8A0B1D3E915F00B2FA05 /* FsprgOrder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FsprgOrder.m; sourceTree = ""; }; + DABC8A0C1D3E915F00B2FA05 /* FsprgOrderItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FsprgOrderItem.h; sourceTree = ""; }; + DABC8A0D1D3E915F00B2FA05 /* FsprgOrderItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FsprgOrderItem.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 507FDCB51D9983F400FE07E7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 507FDCC51D9983FD00FE07E7 /* FsprgEmbeddedStore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DABC89E91D3E913200B2FA05 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 507FDCB91D9983F400FE07E7 /* TestUsage-Swift */ = { + isa = PBXGroup; + children = ( + 507FDCBA1D9983F400FE07E7 /* AppDelegate.swift */, + 507FDCBC1D9983F400FE07E7 /* Assets.xcassets */, + 507FDCBE1D9983F400FE07E7 /* MainMenu.xib */, + 507FDCC11D9983F400FE07E7 /* Info.plist */, + ); + path = "TestUsage-Swift"; + sourceTree = ""; + }; + DABC89E31D3E913200B2FA05 = { + isa = PBXGroup; + children = ( + DABC89EF1D3E913200B2FA05 /* FsprgEmbeddedStore */, + 507FDCB91D9983F400FE07E7 /* TestUsage-Swift */, + DABC89EE1D3E913200B2FA05 /* Products */, + ); + sourceTree = ""; + }; + DABC89EE1D3E913200B2FA05 /* Products */ = { + isa = PBXGroup; + children = ( + DABC89ED1D3E913200B2FA05 /* FsprgEmbeddedStore.framework */, + 507FDCB81D9983F400FE07E7 /* TestUsage-Swift.app */, + ); + name = Products; + sourceTree = ""; + }; + DABC89EF1D3E913200B2FA05 /* FsprgEmbeddedStore */ = { + isa = PBXGroup; + children = ( + DABC89F81D3E915F00B2FA05 /* Source */, + DABC89F01D3E913200B2FA05 /* FsprgEmbeddedStore.h */, + DABC89F21D3E913200B2FA05 /* Info.plist */, + ); + path = FsprgEmbeddedStore; + sourceTree = ""; + }; + DABC89F81D3E915F00B2FA05 /* Source */ = { + isa = PBXGroup; + children = ( + DABC89FA1D3E915F00B2FA05 /* FsprgEmbeddedStoreController.h */, + DABC89FB1D3E915F00B2FA05 /* FsprgEmbeddedStoreController.m */, + DABC89FC1D3E915F00B2FA05 /* FsprgEmbeddedStoreDelegate.h */, + DABC89FD1D3E915F00B2FA05 /* FsprgOrderDocumentRepresentation.h */, + DABC89FE1D3E915F00B2FA05 /* FsprgOrderDocumentRepresentation.m */, + DABC89FF1D3E915F00B2FA05 /* FsprgOrderView.h */, + DABC8A001D3E915F00B2FA05 /* FsprgOrderView.m */, + DABC8A011D3E915F00B2FA05 /* FsprgStoreParameters.h */, + DABC8A021D3E915F00B2FA05 /* FsprgStoreParameters.m */, + DABC8A031D3E915F00B2FA05 /* Model */, + ); + path = Source; + sourceTree = SOURCE_ROOT; + }; + DABC8A031D3E915F00B2FA05 /* Model */ = { + isa = PBXGroup; + children = ( + DABC8A041D3E915F00B2FA05 /* FsprgFileDownload.h */, + DABC8A051D3E915F00B2FA05 /* FsprgFileDownload.m */, + DABC8A061D3E915F00B2FA05 /* FsprgFulfillment.h */, + DABC8A071D3E915F00B2FA05 /* FsprgFulfillment.m */, + DABC8A081D3E915F00B2FA05 /* FsprgLicense.h */, + DABC8A091D3E915F00B2FA05 /* FsprgLicense.m */, + DABC8A0A1D3E915F00B2FA05 /* FsprgOrder.h */, + DABC8A0B1D3E915F00B2FA05 /* FsprgOrder.m */, + DABC8A0C1D3E915F00B2FA05 /* FsprgOrderItem.h */, + DABC8A0D1D3E915F00B2FA05 /* FsprgOrderItem.m */, + ); + path = Model; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + DABC89EA1D3E913200B2FA05 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + DABC8A251D3E915F00B2FA05 /* FsprgOrder.h in Headers */, + DABC8A161D3E915F00B2FA05 /* FsprgEmbeddedStoreController.h in Headers */, + DABC8A181D3E915F00B2FA05 /* FsprgEmbeddedStoreDelegate.h in Headers */, + DABC8A1D1D3E915F00B2FA05 /* FsprgStoreParameters.h in Headers */, + DABC8A1F1D3E915F00B2FA05 /* FsprgFileDownload.h in Headers */, + DABC8A211D3E915F00B2FA05 /* FsprgFulfillment.h in Headers */, + DABC8A271D3E915F00B2FA05 /* FsprgOrderItem.h in Headers */, + DABC8A231D3E915F00B2FA05 /* FsprgLicense.h in Headers */, + DABC89F11D3E913200B2FA05 /* FsprgEmbeddedStore.h in Headers */, + DABC8A1B1D3E915F00B2FA05 /* FsprgOrderView.h in Headers */, + DABC8A191D3E915F00B2FA05 /* FsprgOrderDocumentRepresentation.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 507FDCB71D9983F400FE07E7 /* TestUsage-Swift */ = { + isa = PBXNativeTarget; + buildConfigurationList = 507FDCC21D9983F400FE07E7 /* Build configuration list for PBXNativeTarget "TestUsage-Swift" */; + buildPhases = ( + 507FDCB41D9983F400FE07E7 /* Sources */, + 507FDCB51D9983F400FE07E7 /* Frameworks */, + 507FDCB61D9983F400FE07E7 /* Resources */, + 507FDCC91D9983FD00FE07E7 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 507FDCC81D9983FD00FE07E7 /* PBXTargetDependency */, + ); + name = "TestUsage-Swift"; + productName = "TestUsage-Swift"; + productReference = 507FDCB81D9983F400FE07E7 /* TestUsage-Swift.app */; + productType = "com.apple.product-type.application"; + }; + DABC89EC1D3E913200B2FA05 /* FsprgEmbeddedStore */ = { + isa = PBXNativeTarget; + buildConfigurationList = DABC89F51D3E913200B2FA05 /* Build configuration list for PBXNativeTarget "FsprgEmbeddedStore" */; + buildPhases = ( + DABC89E81D3E913200B2FA05 /* Sources */, + DABC89E91D3E913200B2FA05 /* Frameworks */, + DABC89EA1D3E913200B2FA05 /* Headers */, + DABC89EB1D3E913200B2FA05 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FsprgEmbeddedStore; + productName = FsprgEmbeddedStore; + productReference = DABC89ED1D3E913200B2FA05 /* FsprgEmbeddedStore.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + DABC89E41D3E913200B2FA05 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1430; + ORGANIZATIONNAME = "Edovia Inc."; + TargetAttributes = { + 507FDCB71D9983F400FE07E7 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 1020; + ProvisioningStyle = Automatic; + }; + DABC89EC1D3E913200B2FA05 = { + CreatedOnToolsVersion = 7.3.1; + }; + }; + }; + buildConfigurationList = DABC89E71D3E913200B2FA05 /* Build configuration list for PBXProject "FsprgEmbeddedStore" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = DABC89E31D3E913200B2FA05; + productRefGroup = DABC89EE1D3E913200B2FA05 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + DABC89EC1D3E913200B2FA05 /* FsprgEmbeddedStore */, + 507FDCB71D9983F400FE07E7 /* TestUsage-Swift */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 507FDCB61D9983F400FE07E7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 507FDCBD1D9983F400FE07E7 /* Assets.xcassets in Resources */, + 507FDCC01D9983F400FE07E7 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DABC89EB1D3E913200B2FA05 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 507FDCB41D9983F400FE07E7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 507FDCBB1D9983F400FE07E7 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DABC89E81D3E913200B2FA05 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DABC8A1E1D3E915F00B2FA05 /* FsprgStoreParameters.m in Sources */, + DABC8A221D3E915F00B2FA05 /* FsprgFulfillment.m in Sources */, + DABC8A281D3E915F00B2FA05 /* FsprgOrderItem.m in Sources */, + DABC8A201D3E915F00B2FA05 /* FsprgFileDownload.m in Sources */, + DABC8A241D3E915F00B2FA05 /* FsprgLicense.m in Sources */, + DABC8A171D3E915F00B2FA05 /* FsprgEmbeddedStoreController.m in Sources */, + DABC8A261D3E915F00B2FA05 /* FsprgOrder.m in Sources */, + DABC8A1C1D3E915F00B2FA05 /* FsprgOrderView.m in Sources */, + DABC8A1A1D3E915F00B2FA05 /* FsprgOrderDocumentRepresentation.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 507FDCC81D9983FD00FE07E7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = DABC89EC1D3E913200B2FA05 /* FsprgEmbeddedStore */; + targetProxy = 507FDCC71D9983FD00FE07E7 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 507FDCBE1D9983F400FE07E7 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 507FDCBF1D9983F400FE07E7 /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 507FDCC31D9983F400FE07E7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + COMBINE_HIDPI_IMAGES = YES; + DEAD_CODE_STRIPPING = YES; + INFOPLIST_FILE = "TestUsage-Swift/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.fastspring.sdk.TestUsage-Swift"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 507FDCC41D9983F400FE07E7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + COMBINE_HIDPI_IMAGES = YES; + DEAD_CODE_STRIPPING = YES; + INFOPLIST_FILE = "TestUsage-Swift/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.fastspring.sdk.TestUsage-Swift"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + DABC89F31D3E913200B2FA05 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + 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_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; + 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; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + DABC89F41D3E913200B2FA05 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + 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_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; + 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; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + DABC89F61D3E913200B2FA05 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + COMBINE_HIDPI_IMAGES = YES; + DEAD_CODE_STRIPPING = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = FsprgEmbeddedStore/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.13; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11"; + PRODUCT_BUNDLE_IDENTIFIER = com.edovia.FsprgEmbeddedStore; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + DABC89F71D3E913200B2FA05 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + COMBINE_HIDPI_IMAGES = YES; + DEAD_CODE_STRIPPING = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = FsprgEmbeddedStore/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.13; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11"; + PRODUCT_BUNDLE_IDENTIFIER = com.edovia.FsprgEmbeddedStore; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 507FDCC21D9983F400FE07E7 /* Build configuration list for PBXNativeTarget "TestUsage-Swift" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 507FDCC31D9983F400FE07E7 /* Debug */, + 507FDCC41D9983F400FE07E7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + DABC89E71D3E913200B2FA05 /* Build configuration list for PBXProject "FsprgEmbeddedStore" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DABC89F31D3E913200B2FA05 /* Debug */, + DABC89F41D3E913200B2FA05 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + DABC89F51D3E913200B2FA05 /* Build configuration list for PBXNativeTarget "FsprgEmbeddedStore" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DABC89F61D3E913200B2FA05 /* Debug */, + DABC89F71D3E913200B2FA05 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = DABC89E41D3E913200B2FA05 /* Project object */; +} diff --git a/FsprgEmbeddedStore.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/FsprgEmbeddedStore.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b2902e3 --- /dev/null +++ b/FsprgEmbeddedStore.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/FsprgEmbeddedStore.xcodeproj/project.xcworkspace/xcshareddata/FsprgEmbeddedStore.xcscmblueprint b/FsprgEmbeddedStore.xcodeproj/project.xcworkspace/xcshareddata/FsprgEmbeddedStore.xcscmblueprint new file mode 100644 index 0000000..474d052 --- /dev/null +++ b/FsprgEmbeddedStore.xcodeproj/project.xcworkspace/xcshareddata/FsprgEmbeddedStore.xcscmblueprint @@ -0,0 +1,30 @@ +{ + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "ECD9FA0CCDC4DEE088D281486C1095F3D525E37F", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { + + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { + "E3159BE2A0AA0438B45583734574FC90102D82D0" : 0, + "ECD9FA0CCDC4DEE088D281486C1095F3D525E37F" : 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "B768050C-9603-4641-B8E2-7C1CCD4FF558", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { + "E3159BE2A0AA0438B45583734574FC90102D82D0" : "..", + "ECD9FA0CCDC4DEE088D281486C1095F3D525E37F" : "FsprgEmbeddedStore\/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey" : "FsprgEmbeddedStore", + "DVTSourceControlWorkspaceBlueprintVersion" : 204, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "FsprgEmbeddedStore.xcodeproj", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/bitbucket.org\/edovia\/screens-3-for-mac.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "E3159BE2A0AA0438B45583734574FC90102D82D0" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/Edovia\/FsprgEmbeddedStoreMac.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "ECD9FA0CCDC4DEE088D281486C1095F3D525E37F" + } + ] +} \ No newline at end of file diff --git a/FsprgEmbeddedStore.xcodeproj/xcshareddata/xcschemes/FsprgEmbeddedStore.xcscheme b/FsprgEmbeddedStore.xcodeproj/xcshareddata/xcschemes/FsprgEmbeddedStore.xcscheme new file mode 100644 index 0000000..c7c9385 --- /dev/null +++ b/FsprgEmbeddedStore.xcodeproj/xcshareddata/xcschemes/FsprgEmbeddedStore.xcscheme @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FsprgEmbeddedStore/FsprgEmbeddedStore.h b/FsprgEmbeddedStore/FsprgEmbeddedStore.h index 900e197..5cac86c 100644 --- a/FsprgEmbeddedStore/FsprgEmbeddedStore.h +++ b/FsprgEmbeddedStore/FsprgEmbeddedStore.h @@ -2,17 +2,25 @@ // FsprgEmbeddedStore.h // FsprgEmbeddedStore // -// Created by Lars Steiger on 2/28/10. -// Copyright 2010 FastSpring. All rights reserved. +// Created by Luc Vandal on 2016-07-19. +// Copyright © 2016 Edovia Inc. All rights reserved. // -#import "FsprgEmbeddedStoreController.h" -#import "FsprgEmbeddedStoreDelegate.h" -#import "FsprgStoreParameters.h" +#import + +//! Project version number for FsprgEmbeddedStore. +FOUNDATION_EXPORT double FsprgEmbeddedStoreVersionNumber; + +//! Project version string for FsprgEmbeddedStore. +FOUNDATION_EXPORT const unsigned char FsprgEmbeddedStoreVersionString[]; + +#import +#import +#import // Model -#import "FsprgOrder.h" -#import "FsprgOrderItem.h" -#import "FsprgFulfillment.h" -#import "FsprgLicense.h" -#import "FsprgFileDownload.h" +#import +#import +#import +#import +#import diff --git a/FsprgEmbeddedStore/Info.plist b/FsprgEmbeddedStore/Info.plist new file mode 100644 index 0000000..df4c6e9 --- /dev/null +++ b/FsprgEmbeddedStore/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2016 Edovia Inc. All rights reserved. + NSPrincipalClass + + + diff --git a/FsprgEmbeddedStore/Model/FsprgLicense.h b/FsprgEmbeddedStore/Model/FsprgLicense.h deleted file mode 100644 index 27a1e7d..0000000 --- a/FsprgEmbeddedStore/Model/FsprgLicense.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// FsprgLicense.h -// FsprgEmbeddedStore -// -// Created by Lars Steiger on 2/24/10. -// Copyright 2010 FastSpring. All rights reserved. -// - -#import - - -/*! - * License information. FsprgLicense is backed by a NSMutableDictionary that - * can be accessed and modified via the raw and setRaw: methods. - */ -@interface FsprgLicense : NSObject { - NSDictionary *raw; -} - -+ (FsprgLicense *)licenseWithDictionary:(NSDictionary *)aDictionary; - -- (FsprgLicense *)initWithDictionary:(NSDictionary *)aDictionary; -- (NSDictionary *)raw; -- (void)setRaw:(NSDictionary *)aDictionary; - -- (NSString *)licenseName; -- (NSString *)licenseEmail; -- (NSString *)licenseCompany; -- (NSString *)firstLicenseCode; -- (NSArray *)licenseCodes; -- (NSDictionary *)licensePropertyList; -- (NSURL *)licenseURL; - -@end diff --git a/FsprgEmbeddedStore/Model/FsprgOrder.h b/FsprgEmbeddedStore/Model/FsprgOrder.h deleted file mode 100644 index 23f0ab5..0000000 --- a/FsprgEmbeddedStore/Model/FsprgOrder.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// FsprgOrder.h -// FsprgEmbeddedStore -// -// Created by Lars Steiger on 2/12/10. -// Copyright 2010 FastSpring. All rights reserved. -// - -#import -#import "FsprgOrderItem.h" - - -/*! - * Order information. FsprgOrder is backed by a NSMutableDictionary that - * can be accessed and modified via the raw and setRaw: methods. - */ -@interface FsprgOrder : NSObject { - NSDictionary *raw; -} - -+ (FsprgOrder *)orderFromData:(NSData *)aData; - -- (FsprgOrder *)initWithDictionary:(NSDictionary *)aDictionary; -- (NSDictionary *)raw; -- (void)setRaw:(NSDictionary *)aDictionary; - -- (BOOL)orderIsTest; -- (NSString *)orderReference; -- (NSString *)orderLanguage; -- (NSString *)orderCurrency; -- (NSNumber *)orderTotal; -- (NSNumber *)orderTotalUSD; -- (NSString *)customerFirstName; -- (NSString *)customerLastName; -- (NSString *)customerCompany; -- (NSString *)customerEmail; - -/*! - * Shortcut for [[self orderItems] objectAtIndex:0]. - * @result First item. - */ -- (FsprgOrderItem *)firstOrderItem; -- (NSArray *)orderItems; - -@end diff --git a/FsprgEmbeddedStore/Model/FsprgOrderItem.h b/FsprgEmbeddedStore/Model/FsprgOrderItem.h deleted file mode 100644 index f71ee07..0000000 --- a/FsprgEmbeddedStore/Model/FsprgOrderItem.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// FsprgOrderItem.h -// FsprgEmbeddedStore -// -// Created by Lars Steiger on 2/24/10. -// Copyright 2010 FastSpring. All rights reserved. -// - -#import -#import "FsprgFulfillment.h" -#import "FsprgLicense.h" -#import "FsprgFileDownload.h" - - -/*! - * Order item information. FsprgOrderItem is backed by a NSMutableDictionary that - * can be accessed and modified via the raw and setRaw: methods. - */ -@interface FsprgOrderItem : NSObject { - NSDictionary *raw; -} - -+ (FsprgOrderItem *)itemWithDictionary:(NSDictionary *)aDictionary; - -- (FsprgOrderItem *)initWithDictionary:(NSDictionary *)aDictionary; -- (NSDictionary *)raw; -- (void)setRaw:(NSDictionary *)aDictionary; - -- (NSString *)productName; -- (NSString *)productDisplay; -- (NSNumber *)quantity; -- (NSNumber *)itemTotal; -- (NSNumber *)itemTotalUSD; - -/*! - * This reference can be used to make calls to FastSpring's Subscription API. - * See https://support.fastspring.com/entries/236487-api-subscriptions - */ -- (NSString *)subscriptionReference; - -/*! - * This URL can be presented to the customer to manage their subscription. - */ -- (NSURL *)subscriptionCustomerURL; - -- (FsprgFulfillment *)fulfillment; - -/*! - * Shortcut for [[self fulfillment] valueForKey:@"license"]. - * @result License information. - */ -- (FsprgLicense *)license; - -/*! - * Shortcut for [[self fulfillment] valueForKey:@"download"]. - * @result Download information. - */ -- (FsprgFileDownload *)download; - -@end diff --git a/README.mdown b/README.mdown index cd6b890..4f65010 100644 --- a/README.mdown +++ b/README.mdown @@ -1,5 +1,8 @@ # Introduction # +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![CocoaPods](https://img.shields.io/cocoapods/dt/FsprgEmbeddedStoreMac.svg)](http://cocoapods.org/pods/FsprgEmbeddedStoreMac) + [FastSpring](http://www.fastspring.com) offers an innovative e-commerce engine designed to overcome ease of use, customer service, and cost issues that have plagued software e-commerce companies. FastSpring's embedded store consists of a controller with some integration points and WebKit's web view. It's thin and very flexible and lets you integrate FastSpring the way that fits best for your application. @@ -48,7 +51,7 @@ In addition, it has some integration points defined by the `FsprgEmbeddedStoreDe ## How-to embed it ## -Use our [CocoaPod](http://cocoapods.org/?q=fsprgembeddedstoremac) or perform the following steps. +Use our [CocoaPod](http://cocoapods.org/pods/FsprgEmbeddedStoreMac), Carthage, or perform the following steps. 1. [Clone or fork](http://help.github.com/fork-a-repo) our repository. 2. Open your project in Xcode. diff --git a/FsprgEmbeddedStore/FsprgEmbeddedStoreController.h b/Source/FsprgEmbeddedStoreController.h similarity index 74% rename from FsprgEmbeddedStore/FsprgEmbeddedStoreController.h rename to Source/FsprgEmbeddedStoreController.h index 983685b..f8b3f95 100755 --- a/FsprgEmbeddedStore/FsprgEmbeddedStoreController.h +++ b/Source/FsprgEmbeddedStoreController.h @@ -8,7 +8,7 @@ #import #import -#import "FsprgEmbeddedStoreDelegate.h" +#import /*! @@ -21,19 +21,17 @@ NSMutableDictionary *hostCertificates; } -- (WebView *)webView; +@property (NS_NONATOMIC_IOSONLY, strong) WebView *webView; /*! * Connects this controller to a web view. * @param aWebView Web view to connect. */ -- (void)setWebView:(WebView *)aWebView; -- (id )delegate; +@property (NS_NONATOMIC_IOSONLY, assign) id delegate; /*! * Sets a delegate to which it has a weak reference. * @param aDelegate Delegate to set. */ -- (void)setDelegate:(id )aDelegate; /*! * Loads the store using the given parameters. @@ -51,30 +49,30 @@ * Useful to trigger e.g. the hidden flag of a progress bar. * @result TRUE if loading a page. */ -- (BOOL)isLoading; +@property (NS_NONATOMIC_IOSONLY, getter=isLoading, readonly) BOOL loading; /*! * Useful to provide the value for a progress bar. * @result The loading progress in percent of a page (0 - 100) */ -- (double)estimatedLoadingProgress; +@property (NS_NONATOMIC_IOSONLY, readonly) double estimatedLoadingProgress; /** * Useful to show a secure icon. * @result TRUE if connection is secure (SSL) */ -- (BOOL)isSecure; +@property (NS_NONATOMIC_IOSONLY, getter=isSecure, readonly) BOOL secure; /** * * @result NSArray containing SecCertificateRef objects for the host of the main frame, if it was loaded via https. */ -- (NSArray *)securityCertificates; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *securityCertificates; /*! * Host that delivers the store (e.g. sites.fastspring.com). * @result nil until the store has been loaded. */ -- (NSString *)storeHost; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *storeHost; @end diff --git a/FsprgEmbeddedStore/FsprgEmbeddedStoreController.m b/Source/FsprgEmbeddedStoreController.m similarity index 62% rename from FsprgEmbeddedStore/FsprgEmbeddedStoreController.m rename to Source/FsprgEmbeddedStoreController.m index b2c40fe..5c7e843 100755 --- a/FsprgEmbeddedStore/FsprgEmbeddedStoreController.m +++ b/Source/FsprgEmbeddedStoreController.m @@ -10,9 +10,6 @@ #import "FsprgOrderView.h" #import "FsprgOrderDocumentRepresentation.h" -// We don't retrieve SSL certificates below OSX 10.6 -#define RETRIEVE_SSL_CERTIFICATES defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 - @interface FsprgEmbeddedStoreController () - (void)setIsLoading:(BOOL)aFlag; @@ -21,15 +18,12 @@ - (void)setIsSecure:(BOOL)aFlag; - (void)setStoreHost:(NSString *)aHost; - (void)resizeContentDivE; - (void)webViewFrameChanged:(NSNotification *)aNotification; -- (NSMutableDictionary *)hostCertificates; -- (void)setHostCertificates:(NSMutableDictionary *)aHostCertificates; +@property (nonatomic, copy) NSMutableDictionary *hostCertificates; @end -#if defined(MAC_OS_X_VERSION_10_11) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_11 @interface FsprgEmbeddedStoreController () @end -#endif @implementation FsprgEmbeddedStoreController @@ -41,21 +35,21 @@ + (void)initialize forMIMEType:@"application/x-fsprgorder+xml"]; } -- (id) init +- (instancetype) init { self = [super init]; if (self != nil) { [self setWebView:nil]; [self setDelegate:nil]; [self setStoreHost:nil]; - [self setHostCertificates:[NSMutableDictionary dictionary]]; + self.hostCertificates = [NSMutableDictionary dictionary]; } return self; } - (WebView *)webView { - return [[webView retain] autorelease]; + return webView; } - (void)setWebView:(WebView *)aWebView @@ -68,15 +62,14 @@ - (void)setWebView:(WebView *)aWebView [webView setApplicationNameForUserAgent:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self]; - [webView release]; - webView = [aWebView retain]; + webView = aWebView; if (webView) { [webView setPostsFrameChangedNotifications:TRUE]; - [webView setFrameLoadDelegate:self]; - [webView setUIDelegate:self]; - [webView setResourceLoadDelegate:self]; - [webView setApplicationNameForUserAgent:@"FSEmbeddedStore/2.0"]; + webView.frameLoadDelegate = self; + webView.UIDelegate = self; + webView.resourceLoadDelegate = self; + webView.applicationNameForUserAgent = @"FSEmbeddedStore/2.0"; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(webViewFrameChanged:) name:NSViewFrameDidChangeNotification @@ -115,15 +108,15 @@ - (void)loadWithParameters:(FsprgStoreParameters *)parameters return; } - NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:[urlRequest URL]]; - NSUInteger i, count = [cookies count]; + NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:urlRequest.URL]; + NSUInteger i, count = cookies.count; for (i = 0; i < count; i++) { - NSHTTPCookie *cookie = [cookies objectAtIndex:i]; + NSHTTPCookie *cookie = cookies[i]; [[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie]; } [self setStoreHost:nil]; - [[webView mainFrame] loadRequest:urlRequest]; + [webView.mainFrame loadRequest:urlRequest]; } - (void)loadWithContentsOfFile:(NSString *)aPath @@ -134,13 +127,13 @@ - (void)loadWithContentsOfFile:(NSString *)aPath if(data == nil) { NSLog(@"File %@ not found.", aPath); } else { - [[webView mainFrame] loadData:data MIMEType:@"application/x-fsprgorder+xml" textEncodingName:@"UTF-8" baseURL:nil]; + [webView.mainFrame loadData:data MIMEType:@"application/x-fsprgorder+xml" textEncodingName:@"UTF-8" baseURL:nil]; } } - (BOOL)isLoading { - return [self estimatedLoadingProgress] < 100; + return self.estimatedLoadingProgress < 100; } - (void)setIsLoading:(BOOL)aFlag { @@ -148,7 +141,7 @@ - (void)setIsLoading:(BOOL)aFlag } - (double)estimatedLoadingProgress { - return [webView estimatedProgress] * 100; + return webView.estimatedProgress * 100; } - (void)setEstimatedLoadingProgress:(double)aProgress { @@ -161,8 +154,8 @@ - (void)estimatedLoadingProgressChanged:(NSNotification *)aNotification } - (BOOL)isSecure { - WebDataSource *mainFrameDs = [[[self webView] mainFrame] dataSource]; - return [@"https" isEqualTo:[[[mainFrameDs request] URL] scheme]]; + WebDataSource *mainFrameDs = self.webView.mainFrame.dataSource; + return [@"https" isEqualTo:mainFrameDs.request.URL.scheme]; } - (void)setIsSecure:(BOOL)aFlag { @@ -171,54 +164,53 @@ - (void)setIsSecure:(BOOL)aFlag - (NSArray *)securityCertificates { - if ([self isSecure] == NO) { + if (self.secure == NO) { return nil; } - NSString *mainFrameURL = [[self webView] mainFrameURL]; - NSString *host = [[NSURL URLWithString:mainFrameURL] host]; - return [[self hostCertificates] objectForKey:host]; + NSString *mainFrameURL = self.webView.mainFrameURL; + NSString *host = [NSURL URLWithString:mainFrameURL].host; + return self.hostCertificates[host]; } - (NSString *)storeHost { - return [[storeHost retain] autorelease]; + return storeHost; } - (void)setStoreHost:(NSString *)aHost { if (storeHost != aHost) { - [storeHost release]; - storeHost = [aHost retain]; + storeHost = aHost; } } - (void)resizeContentDivE { - if ([[self delegate] respondsToSelector:@selector(shouldStoreControllerFixContentDivHeight:)]) { - if ([[self delegate] shouldStoreControllerFixContentDivHeight:self] == NO) { + if ([self.delegate respondsToSelector:@selector(shouldStoreControllerFixContentDivHeight:)]) { + if ([self.delegate shouldStoreControllerFixContentDivHeight:self] == NO) { return; } } - DOMElement *resizableContentE = [[[[self webView] mainFrame] DOMDocument] getElementById:@"FsprgResizableContent"]; + DOMElement *resizableContentE = [self.webView.mainFrame.DOMDocument getElementById:@"FsprgResizableContent"]; if(resizableContentE == nil) { return; } - CGFloat windowHeight = [[self webView] frame].size.height; - id result = [[[self webView] windowScriptObject] evaluateWebScript:@"document.getElementsByClassName('store-page-navigation')[0].clientHeight"]; + CGFloat windowHeight = self.webView.frame.size.height; + id result = [self.webView.windowScriptObject evaluateWebScript:@"document.getElementsByClassName('store-page-navigation')[0].clientHeight"]; if (result == [WebUndefined undefined]) { return; } - float pageNavigationHeight = [(NSString *)result floatValue]; + float pageNavigationHeight = ((NSString *)result).floatValue; - DOMCSSStyleDeclaration *cssStyle = [[self webView] computedStyleForElement:resizableContentE pseudoElement:nil]; - float paddingTop = [[[cssStyle paddingBottom] substringToIndex:[[cssStyle paddingTop] length]-2] floatValue]; - float paddingBottom = [[[cssStyle paddingBottom] substringToIndex:[[cssStyle paddingBottom] length]-2] floatValue]; + DOMCSSStyleDeclaration *cssStyle = [self.webView computedStyleForElement:resizableContentE pseudoElement:nil]; + float paddingTop = [[cssStyle paddingBottom] substringToIndex:[cssStyle paddingTop].length-2].floatValue; + float paddingBottom = [[cssStyle paddingBottom] substringToIndex:[cssStyle paddingBottom].length-2].floatValue; CGFloat newHeight = windowHeight - paddingTop - paddingBottom - pageNavigationHeight; - [[resizableContentE style] setHeight:[NSString stringWithFormat:@"%fpx", newHeight]]; + [resizableContentE.style setHeight:[NSString stringWithFormat:@"%fpx", newHeight]]; } - (void)webViewFrameChanged:(NSNotification *)aNotification @@ -228,13 +220,11 @@ - (void)webViewFrameChanged:(NSNotification *)aNotification - (NSMutableDictionary *)hostCertificates { - return [[hostCertificates retain] autorelease]; + return hostCertificates; } - (void)setHostCertificates:(NSMutableDictionary *)anHostCertificates { if (hostCertificates != anHostCertificates) { - [anHostCertificates retain]; - [hostCertificates release]; hostCertificates = anHostCertificates; } } @@ -244,8 +234,8 @@ - (void)setHostCertificates:(NSMutableDictionary *)anHostCertificates - (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame { - if ([[self delegate] respondsToSelector:@selector(webView:didStartProvisionalLoadForFrame:)]) { - [[self delegate] webView:sender didStartProvisionalLoadForFrame:frame]; + if ([self.delegate respondsToSelector:@selector(webView:didStartProvisionalLoadForFrame:)]) { + [self.delegate webView:sender didStartProvisionalLoadForFrame:frame]; } } @@ -255,53 +245,49 @@ - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame [self resizeContentDivE]; - NSURL *newURL = [[[frame dataSource] request] URL]; + NSURL *newURL = frame.dataSource.request.URL; NSString *newStoreHost; - if ([@"file" isEqualTo:[newURL scheme]]) { + if ([@"file" isEqualTo:newURL.scheme]) { newStoreHost = @"file"; } else { - newStoreHost = [newURL host]; + newStoreHost = newURL.host; } - if([self storeHost] == nil) { + if(self.storeHost == nil) { [self setStoreHost:newStoreHost]; - [[self delegate] didLoadStore:newURL]; + [self.delegate didLoadStore:newURL]; } else { FsprgPageType newPageType; - if([newStoreHost isEqualTo:[self storeHost]]) { + if([newStoreHost isEqualTo:self.storeHost]) { newPageType = FsprgPageFS; } else if([newStoreHost hasSuffix:@"paypal.com"]) { newPageType = FsprgPagePayPal; } else { newPageType = FsprgPageUnknown; } - [[self delegate] didLoadPage:newURL ofType:newPageType]; + [self.delegate didLoadPage:newURL ofType:newPageType]; } } - (void)webView:(WebView *)sender didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame { - [[self delegate] webView:sender didFailProvisionalLoadWithError:error forFrame:frame]; + [self.delegate webView:sender didFailProvisionalLoadWithError:error forFrame:frame]; } - (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame { - [[self delegate] webView:sender didFailLoadWithError:error forFrame:frame]; + [self.delegate webView:sender didFailLoadWithError:error forFrame:frame]; } #pragma mark - WebUIDelegate - (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame { - NSString *title = [sender mainFrameTitle]; + NSString *title = sender.mainFrameTitle; NSAlert *alertPanel = [[NSAlert alloc] init]; [alertPanel setMessageText:title]; [alertPanel setInformativeText:message]; -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9 - [alertPanel beginSheetModalForWindow:[sender window] modalDelegate:nil didEndSelector:NULL contextInfo:NULL]; -#else [alertPanel beginSheetModalForWindow:[sender window] completionHandler:nil]; -#endif } - (NSUInteger)webView:(WebView *)sender dragDestinationActionMaskForDraggingInfo:(id )draggingInfo @@ -312,10 +298,10 @@ - (NSUInteger)webView:(WebView *)sender dragDestinationActionMaskForDraggingInfo - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request { NSWindow *window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,0,0) - styleMask:(NSClosableWindowMask|NSResizableWindowMask) - backing:NSBackingStoreBuffered - defer:NO]; - WebView *subWebView = [[[WebView alloc] initWithFrame:NSMakeRect(0,0,0,0)] autorelease]; + styleMask:(NSWindowStyleMaskClosable|NSWindowStyleMaskResizable) + backing:NSBackingStoreBuffered + defer:NO]; + WebView *subWebView = [[WebView alloc] initWithFrame:NSMakeRect(0,0,0,0)]; [window setReleasedWhenClosed:TRUE]; [window setContentView:subWebView]; [window makeKeyAndOrderFront:sender]; @@ -325,7 +311,6 @@ - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *) #pragma mark - WebResourceLoadDelegate -#if RETRIEVE_SSL_CERTIFICATES - (BOOL)webView:(WebView *)sender resource:(id)identifier canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace forDataSource:(WebDataSource *)dataSource { return TRUE; @@ -333,7 +318,7 @@ - (BOOL)webView:(WebView *)sender resource:(id)identifier canAuthenticateAgainst - (void)webView:(WebView *)sender resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource { - SecTrustRef trustRef = [[challenge protectionSpace] serverTrust]; + SecTrustRef trustRef = challenge.protectionSpace.serverTrust; SecTrustResultType resultType; SecTrustEvaluate(trustRef, &resultType); NSUInteger count = (NSUInteger)SecTrustGetCertificateCount(trustRef); @@ -342,16 +327,14 @@ - (void)webView:(WebView *)sender resource:(id)identifier didReceiveAuthenticati CFIndex idx; for (idx = 0; idx < (CFIndex)count; idx++) { SecCertificateRef certificateRef = SecTrustGetCertificateAtIndex(trustRef, idx); - [certificates addObject:(id)certificateRef]; + [certificates addObject:(__bridge id)certificateRef]; } - NSString *host = [[challenge protectionSpace] host]; - [[self hostCertificates] setObject:certificates forKey:host]; + NSString *host = challenge.protectionSpace.host; + self.hostCertificates[host] = certificates; - [[challenge sender] useCredential:[NSURLCredential credentialForTrust:trustRef] forAuthenticationChallenge:challenge]; + [challenge.sender useCredential:[NSURLCredential credentialForTrust:trustRef] forAuthenticationChallenge:challenge]; } -#endif - - (void)dealloc { @@ -359,8 +342,6 @@ - (void)dealloc [self setDelegate:nil]; [self setStoreHost:nil]; [self setHostCertificates:nil]; - - [super dealloc]; } @end diff --git a/FsprgEmbeddedStore/FsprgEmbeddedStoreDelegate.h b/Source/FsprgEmbeddedStoreDelegate.h similarity index 94% rename from FsprgEmbeddedStore/FsprgEmbeddedStoreDelegate.h rename to Source/FsprgEmbeddedStoreDelegate.h index 9f0aa6a..ad3ee76 100755 --- a/FsprgEmbeddedStore/FsprgEmbeddedStoreDelegate.h +++ b/Source/FsprgEmbeddedStoreDelegate.h @@ -8,15 +8,15 @@ #import #import -#import "FsprgStoreParameters.h" -#import "FsprgOrder.h" +#import +#import /*! Type for didLoadPage:ofType: */ -typedef enum { +typedef NS_ENUM(unsigned int, FsprgPageType) { FsprgPageFS, FsprgPagePayPal, FsprgPageUnknown -} FsprgPageType; +}; @class FsprgEmbeddedStoreController; diff --git a/FsprgEmbeddedStore/FsprgOrderDocumentRepresentation.h b/Source/FsprgOrderDocumentRepresentation.h similarity index 87% rename from FsprgEmbeddedStore/FsprgOrderDocumentRepresentation.h rename to Source/FsprgOrderDocumentRepresentation.h index 2e90831..b8bbc95 100644 --- a/FsprgEmbeddedStore/FsprgOrderDocumentRepresentation.h +++ b/Source/FsprgOrderDocumentRepresentation.h @@ -18,7 +18,6 @@ FsprgOrder *order; } -- (FsprgOrder *)order; -- (void)setOrder:(FsprgOrder *)anOrder; +@property (NS_NONATOMIC_IOSONLY, strong) FsprgOrder *order; @end diff --git a/FsprgEmbeddedStore/FsprgOrderDocumentRepresentation.m b/Source/FsprgOrderDocumentRepresentation.m similarity index 74% rename from FsprgEmbeddedStore/FsprgOrderDocumentRepresentation.m rename to Source/FsprgOrderDocumentRepresentation.m index f8e88ff..cec22aa 100644 --- a/FsprgEmbeddedStore/FsprgOrderDocumentRepresentation.m +++ b/Source/FsprgOrderDocumentRepresentation.m @@ -12,7 +12,7 @@ @implementation FsprgOrderDocumentRepresentation -- (id) init +- (instancetype) init { self = [super init]; if (self != nil) { @@ -23,14 +23,13 @@ - (id) init - (FsprgOrder *)order { - return [[order retain] autorelease]; + return order; } - (void)setOrder:(FsprgOrder *)anOrder { if (order != anOrder) { - [order release]; - order = [anOrder retain]; + order = anOrder; } } @@ -53,9 +52,9 @@ - (void)setDataSource:(WebDataSource *)aDataSource - (void)receivedData:(NSData *)aData withDataSource:(WebDataSource *)aDataSource { - [self setOrder:[FsprgOrder orderFromData:aData]]; - FsprgEmbeddedStoreController *delegate = [[[aDataSource webFrame] webView] frameLoadDelegate]; - [[delegate delegate] didReceiveOrder:[self order]]; + self.order = [FsprgOrder orderFromData:aData]; + FsprgEmbeddedStoreController *delegate = aDataSource.webFrame.webView.frameLoadDelegate; + [delegate.delegate didReceiveOrder:self.order]; } - (void)receivedError:(NSError *)anError withDataSource:(WebDataSource *)aDataSource @@ -70,7 +69,6 @@ - (void)dealloc { [self setOrder:nil]; - [super dealloc]; } @end diff --git a/FsprgEmbeddedStore/FsprgOrderView.h b/Source/FsprgOrderView.h similarity index 75% rename from FsprgEmbeddedStore/FsprgOrderView.h rename to Source/FsprgOrderView.h index ff6b63b..c30b8d8 100644 --- a/FsprgEmbeddedStore/FsprgOrderView.h +++ b/Source/FsprgOrderView.h @@ -19,9 +19,7 @@ BOOL needsLayout; } -- (WebDataSource *)dataSource; -- (void)setDataSource:(WebDataSource *)aDataSource; -- (BOOL)needsLayout; -- (void)setNeedsLayout:(BOOL)flag; +@property (NS_NONATOMIC_IOSONLY, assign) WebDataSource *dataSource; +@property (NS_NONATOMIC_IOSONLY) BOOL needsLayout; @end diff --git a/FsprgEmbeddedStore/FsprgOrderView.m b/Source/FsprgOrderView.m similarity index 60% rename from FsprgEmbeddedStore/FsprgOrderView.m rename to Source/FsprgOrderView.m index 53bda55..b95d3a5 100644 --- a/FsprgEmbeddedStore/FsprgOrderView.m +++ b/Source/FsprgOrderView.m @@ -13,32 +13,31 @@ @implementation FsprgOrderView -- (id)initWithFrame:(NSRect)frame +- (instancetype)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { [self setDataSource:nil]; [self setNeedsLayout:FALSE]; [self setAutoresizesSubviews:TRUE]; - [self setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; + self.autoresizingMask = (NSViewWidthSizable | NSViewHeightSizable); } return self; } - (WebDataSource *)dataSource { - return [[dataSource retain] autorelease]; + return dataSource; } - (void)setDataSource:(WebDataSource *)aDataSource { if (dataSource != aDataSource) { - [dataSource release]; - dataSource = [aDataSource retain]; + dataSource = aDataSource; } } - (void)dataSourceUpdated:(WebDataSource *)aDataSource { - [self setDataSource:aDataSource]; + self.dataSource = aDataSource; } - (BOOL)needsLayout @@ -53,7 +52,7 @@ - (void)setNeedsLayout:(BOOL)flag - (void)drawRect:(NSRect)aRect { - if([self needsLayout]) { + if(self.needsLayout) { [self setNeedsLayout:FALSE]; [self layout]; } @@ -62,20 +61,18 @@ - (void)drawRect:(NSRect)aRect - (void)layout { - if([[self subviews] count] == 0) { - [self setFrame:[[self superview] frame]]; + if(self.subviews.count == 0) { + self.frame = self.superview.frame; - FsprgOrderDocumentRepresentation *representation = (FsprgOrderDocumentRepresentation *)[[self dataSource] representation]; - FsprgOrder *order = [representation order]; + FsprgOrderDocumentRepresentation *representation = (FsprgOrderDocumentRepresentation *)self.dataSource.representation; + FsprgOrder *order = representation.order; - FsprgEmbeddedStoreController *delegate = [[[[self dataSource] webFrame] webView] UIDelegate]; - NSView *newSubview = [[delegate delegate] viewWithFrame:[self frame] forOrder:order]; + FsprgEmbeddedStoreController *delegate = self.dataSource.webFrame.webView.UIDelegate; + NSView *newSubview = [delegate.delegate viewWithFrame:self.frame forOrder:order]; [self addSubview:newSubview]; } -#if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 [super layout]; -#endif } - (void)viewDidMoveToHostWindow @@ -89,7 +86,6 @@ - (void)dealloc { [self setDataSource:nil]; - [super dealloc]; } @end diff --git a/FsprgEmbeddedStore/FsprgStoreParameters.h b/Source/FsprgStoreParameters.h similarity index 66% rename from FsprgEmbeddedStore/FsprgStoreParameters.h rename to Source/FsprgStoreParameters.h index a5f4184..e27661e 100755 --- a/FsprgEmbeddedStore/FsprgStoreParameters.h +++ b/Source/FsprgStoreParameters.h @@ -31,54 +31,46 @@ extern NSString * const kFsprgModeTest; + (FsprgStoreParameters *)parameters; + (FsprgStoreParameters *)parametersWithRaw:(NSMutableDictionary *)aRaw; -- (NSURLRequest *)toURLRequest; -- (NSURL *)toURL; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSURLRequest *toURLRequest; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSURL *toURL; -- (id)initWithRaw:(NSMutableDictionary *)aRaw; -- (NSMutableDictionary *)raw; -- (void)setRaw:(NSMutableDictionary *)aRaw; +- (instancetype)initWithRaw:(NSMutableDictionary *)aRaw NS_DESIGNATED_INITIALIZER; +@property (NS_NONATOMIC_IOSONLY, copy) NSMutableDictionary *raw; /*! * Pass a language code via the URL to bypass automatic language detection. * Example: de */ -- (NSString *)language; -- (void)setLanguage:(NSString *)aLanguage; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *language; /*! * Use kFsprgOrderProcessDetail or kFsprgOrderProcessInstant. */ -- (NSString *)orderProcessType; -- (void)setOrderProcessType:(NSString *)anOrderProcessType; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *orderProcessType; /*! * Store path name and product path name. * These are found in a full product URL such as sites.fastspring.com//product/ */ - (void)setStoreId:(NSString *)aStoreId withProductId:(NSString *)aProductId; -- (NSString *)storeId; -- (void)setStoreId:(NSString *)aStoreId; -- (NSString *)productId; -- (void)setProductId:(NSString *)aProductId; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *storeId; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *productId; /*! * Use kFsprgModeActive, kFsprgModeActiveTest or kFsprgModeTest. */ -- (NSString *)mode; -- (void)setMode:(NSString *)aMode; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *mode; /*! * Used for "External Tracking". Go to "Link Sources" inside SpringBoard. * Example: november_sale_post */ -- (NSString *)campaign; -- (void)setCampaign:(NSString *)aCampaign; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *campaign; /*! * Used for advanced and atypical store configuration options. */ -- (NSString *)option; -- (void)setOption:(NSString *)anOption; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *option; /*! * Pass a custom referrer via the URL to override the automatically detected referring URL (HTTP_REFERER). @@ -86,23 +78,20 @@ extern NSString * const kFsprgModeTest; * passed in this parameter then no data will be stored from the HTTP_REFERER header. * Example: xyz123 */ -- (NSString *)referrer; -- (void)setReferrer:(NSString *)aReferrer; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *referrer; /*! * Used for "External Tracking". Go to "Link Sources" inside SpringBoard. * Example: my_blog */ -- (NSString *)source; -- (void)setSource:(NSString *)aSource; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *source; /*! * Pass a coupon code via the URL to automatically apply a coupon to the order so that the customer * does not need to enter it. A corresponding coupon code must be setup and associated with a promotion. * Example: DECSPECIAL987 */ -- (NSString *)coupon; -- (void)setCoupon:(NSString *)aCoupon; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *coupon; /*! * This parameter has many uses within SpringBoard. A tag is a variable that can hold any positive integer value. @@ -111,19 +100,13 @@ extern NSString * const kFsprgModeTest; * * mytaga,mytagb,mytagc=2,anothertag=8 */ -- (NSString *)tags; -- (void)setTags:(NSString *)aTags; - -- (BOOL)hasContactDefaults; -- (NSString *)contactFname; -- (void)setContactFname:(NSString *)aContactFname; -- (NSString *)contactLname; -- (void)setContactLname:(NSString *)aContactLname; -- (NSString *)contactEmail; -- (void)setContactEmail:(NSString *)aContactEmail; -- (NSString *)contactCompany; -- (void)setContactCompany:(NSString *)aContactCompany; -- (NSString *)contactPhone; -- (void)setContactPhone:(NSString *)aContactPhone; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *tags; + +@property (NS_NONATOMIC_IOSONLY, readonly) BOOL hasContactDefaults; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *contactFname; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *contactLname; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *contactEmail; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *contactCompany; +@property (NS_NONATOMIC_IOSONLY, copy) NSString *contactPhone; @end diff --git a/FsprgEmbeddedStore/FsprgStoreParameters.m b/Source/FsprgStoreParameters.m similarity index 75% rename from FsprgEmbeddedStore/FsprgStoreParameters.m rename to Source/FsprgStoreParameters.m index caede0a..f56305c 100755 --- a/FsprgEmbeddedStore/FsprgStoreParameters.m +++ b/Source/FsprgStoreParameters.m @@ -39,7 +39,7 @@ @implementation FsprgStoreParameters + (void)initialize { - keyPathsForValuesAffecting = [[NSMutableDictionary dictionaryWithCapacity:1] retain]; + keyPathsForValuesAffecting = [NSMutableDictionary dictionaryWithCapacity:1]; NSSet *toURLSet = [NSSet setWithObjects:NSStringFromSelector(@selector(language)), NSStringFromSelector(@selector(orderProcessType)), @@ -57,18 +57,18 @@ + (void)initialize NSStringFromSelector(@selector(contactCompany)), NSStringFromSelector(@selector(contactPhone)), nil]; - [keyPathsForValuesAffecting setObject:toURLSet forKey:NSStringFromSelector(@selector(toURL))]; + keyPathsForValuesAffecting[NSStringFromSelector(@selector(toURL))] = toURLSet; } + (FsprgStoreParameters *)parameters { NSMutableDictionary *raw = [NSMutableDictionary dictionaryWithCapacity:15]; - return [[[FsprgStoreParameters alloc] initWithRaw:raw] autorelease]; + return [[FsprgStoreParameters alloc] initWithRaw:raw]; } + (FsprgStoreParameters *)parametersWithRaw:(NSMutableDictionary *)aRaw { - return [[[FsprgStoreParameters alloc] initWithRaw:aRaw] autorelease]; + return [[FsprgStoreParameters alloc] initWithRaw:aRaw]; } + (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key @@ -81,31 +81,35 @@ + (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key } } -- (id)initWithRaw:(NSMutableDictionary *)aRaw +- (instancetype)init +{ + return [self initWithRaw:[NSMutableDictionary dictionary]]; +} + +- (instancetype)initWithRaw:(NSMutableDictionary *)aRaw { self = [super init]; if (self != nil) { - [self setRaw:aRaw]; + self.raw = aRaw; } return self; } - (NSMutableDictionary *)raw { - return [[raw retain] autorelease]; + return raw; } - (void)setRaw:(NSMutableDictionary *)aRaw { if (raw != aRaw) { - [raw release]; - raw = [aRaw retain]; + raw = aRaw; } } - (NSURLRequest *)toURLRequest { - NSURL *toURL = [self toURL]; + NSURL *toURL = self.toURL; if (toURL) { return [NSMutableURLRequest requestWithURL:toURL]; } else { @@ -115,42 +119,42 @@ - (NSURLRequest *)toURLRequest - (NSURL *)toURL { - NSString *storeIdEncoded = [[self storeId] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + NSString *storeIdEncoded = [self.storeId stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; if(storeIdEncoded == nil) { storeIdEncoded = @""; } - NSString *productIdEncoded = [[self productId] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + NSString *productIdEncoded = [self.productId stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; if(productIdEncoded == nil) { productIdEncoded = @""; } NSString *urlAsStr; - if([kFsprgOrderProcessDetail isEqualTo:[self orderProcessType]]) { + if([kFsprgOrderProcessDetail isEqualTo:self.orderProcessType]) { NSString *protocol = @"http"; - if([self hasContactDefaults]) { + if(self.hasContactDefaults) { protocol = @"https"; } urlAsStr = [NSString stringWithFormat:@"%@://sites.fastspring.com/%@/product/%@", protocol, storeIdEncoded, productIdEncoded]; - } else if([kFsprgOrderProcessInstant isEqualTo:[self orderProcessType]]) { + } else if([kFsprgOrderProcessInstant isEqualTo:self.orderProcessType]) { urlAsStr = [NSString stringWithFormat:@"https://sites.fastspring.com/%@/instant/%@", storeIdEncoded, productIdEncoded]; - } else if ([kFsprgOrderProcessCheckout isEqualTo:[self orderProcessType]]) { + } else if ([kFsprgOrderProcessCheckout isEqualTo:self.orderProcessType]) { urlAsStr = [NSString stringWithFormat:@"https://sites.fastspring.com/%@/checkout/%@", storeIdEncoded, productIdEncoded]; } else { NSAssert1(FALSE, @"OrderProcessType '%@' unknown.", [self orderProcessType]); return nil; } - NSMutableArray *keys = [NSMutableArray arrayWithArray:[[self raw] allKeys]]; + NSMutableArray *keys = [NSMutableArray arrayWithArray:self.raw.allKeys]; [keys removeObject:kOrderProcessType]; [keys removeObject:kStoreId]; [keys removeObject:kProductId]; [keys sortUsingSelector:@selector(compare:)]; NSString *queryStr = @""; - NSUInteger i, count = [keys count]; + NSUInteger i, count = keys.count; for (i = 0; i < count; i++) { - NSString *key = [keys objectAtIndex:i]; - NSString *value = [[self raw] valueForKey:key]; + NSString *key = keys[i]; + NSString *value = [self.raw valueForKey:key]; if(value != nil) { queryStr = [queryStr stringByAppendingFormat:@"&%@=%@", key, @@ -158,7 +162,7 @@ - (NSURL *)toURL } } - if([queryStr length] > 0) { + if(queryStr.length > 0) { urlAsStr = [NSString stringWithFormat:@"%@?%@", urlAsStr, [queryStr substringFromIndex:1]]; } @@ -168,15 +172,15 @@ - (NSURL *)toURL - (void)setObject:(NSString *)anObject forKey:(NSString *)aKey { if(anObject == nil) { - [[self raw] removeObjectForKey:aKey]; + [self.raw removeObjectForKey:aKey]; } else { - [[self raw] setObject:anObject forKey:aKey]; + self.raw[aKey] = anObject; } } - (NSString *)language { - return [[self raw] objectForKey:kLanguage]; + return self.raw[kLanguage]; } - (void)setLanguage:(NSString *)aLanguage @@ -186,7 +190,7 @@ - (void)setLanguage:(NSString *)aLanguage - (NSString *)orderProcessType { - return [[self raw] objectForKey:kOrderProcessType]; + return self.raw[kOrderProcessType]; } - (void)setOrderProcessType:(NSString *)anOrderProcessType { @@ -195,13 +199,13 @@ - (void)setOrderProcessType:(NSString *)anOrderProcessType - (void)setStoreId:(NSString *)aStoreId withProductId:(NSString *)aProductId { - [self setStoreId:aStoreId]; - [self setProductId:aProductId]; + self.storeId = aStoreId; + self.productId = aProductId; } - (NSString *)storeId { - return [[self raw] objectForKey:kStoreId]; + return self.raw[kStoreId]; } - (void)setStoreId:(NSString *)aStoreId { @@ -210,7 +214,7 @@ - (void)setStoreId:(NSString *)aStoreId - (NSString *)productId { - return [[self raw] objectForKey:kProductId]; + return self.raw[kProductId]; } - (void)setProductId:(NSString *)aProductId { @@ -219,7 +223,7 @@ - (void)setProductId:(NSString *)aProductId - (NSString *)mode { - return [[self raw] objectForKey:kMode]; + return self.raw[kMode]; } - (void)setMode:(NSString *)aMode { @@ -228,7 +232,7 @@ - (void)setMode:(NSString *)aMode - (NSString *)campaign { - return [[self raw] objectForKey:kCampaign]; + return self.raw[kCampaign]; } - (void)setCampaign:(NSString *)aCampaign { @@ -237,7 +241,7 @@ - (void)setCampaign:(NSString *)aCampaign - (NSString *)option { - return [[self raw] objectForKey:kOption]; + return self.raw[kOption]; } - (void)setOption:(NSString *)anOption { @@ -246,7 +250,7 @@ - (void)setOption:(NSString *)anOption - (NSString *)referrer { - return [[self raw] objectForKey:kReferrer]; + return self.raw[kReferrer]; } - (void)setReferrer:(NSString *)aReferrer { @@ -255,7 +259,7 @@ - (void)setReferrer:(NSString *)aReferrer - (NSString *)source { - return [[self raw] objectForKey:kSource]; + return self.raw[kSource]; } - (void)setSource:(NSString *)aSource { @@ -264,7 +268,7 @@ - (void)setSource:(NSString *)aSource - (NSString *)coupon { - return [[self raw] objectForKey:kCoupon]; + return self.raw[kCoupon]; } - (void)setCoupon:(NSString *)aCoupon { @@ -273,7 +277,7 @@ - (void)setCoupon:(NSString *)aCoupon - (NSString *)tags { - return [[self raw] objectForKey:kTags]; + return self.raw[kTags]; } - (void)setTags:(NSString *)aTags { @@ -282,7 +286,7 @@ - (void)setTags:(NSString *)aTags - (BOOL)hasContactDefaults { - NSArray *allKeys = [[self raw] allKeys]; + NSArray *allKeys = self.raw.allKeys; return [allKeys containsObject:kContactFname] || [allKeys containsObject:kContactLname] || @@ -293,7 +297,7 @@ - (BOOL)hasContactDefaults - (NSString *)contactFname { - return [[self raw] objectForKey:kContactFname]; + return self.raw[kContactFname]; } - (void)setContactFname:(NSString *)aContactFname { @@ -302,7 +306,7 @@ - (void)setContactFname:(NSString *)aContactFname - (NSString *)contactLname { - return [[self raw] objectForKey:kContactLname]; + return self.raw[kContactLname]; } - (void)setContactLname:(NSString *)aContactLname { @@ -311,7 +315,7 @@ - (void)setContactLname:(NSString *)aContactLname - (NSString *)contactEmail { - return [[self raw] objectForKey:kContactEmail]; + return self.raw[kContactEmail]; } - (void)setContactEmail:(NSString *)aContactEmail { @@ -320,7 +324,7 @@ - (void)setContactEmail:(NSString *)aContactEmail - (NSString *)contactCompany { - return [[self raw] objectForKey:kContactCompany]; + return self.raw[kContactCompany]; } - (void)setContactCompany:(NSString *)aContactCompany { @@ -329,7 +333,7 @@ - (void)setContactCompany:(NSString *)aContactCompany - (NSString *)contactPhone { - return [[self raw] objectForKey:kContactPhone]; + return self.raw[kContactPhone]; } - (void)setContactPhone:(NSString *)aContactPhone { @@ -340,7 +344,6 @@ - (void)dealloc { [self setRaw:nil]; - [super dealloc]; } @end diff --git a/FsprgEmbeddedStore/Model/FsprgFileDownload.h b/Source/Model/FsprgFileDownload.h similarity index 69% rename from FsprgEmbeddedStore/Model/FsprgFileDownload.h rename to Source/Model/FsprgFileDownload.h index 793baac..c7241d0 100644 --- a/FsprgEmbeddedStore/Model/FsprgFileDownload.h +++ b/Source/Model/FsprgFileDownload.h @@ -19,10 +19,9 @@ + (FsprgFileDownload *)fileDownloadWithDictionary:(NSDictionary *)aDictionary; -- (FsprgFileDownload *)initWithDictionary:(NSDictionary *)aDictionary; -- (NSDictionary *)raw; -- (void)setRaw:(NSDictionary *)aDictionary; +- (instancetype)initWithDictionary:(NSDictionary *)aDictionary NS_DESIGNATED_INITIALIZER; +@property (NS_NONATOMIC_IOSONLY, copy) NSDictionary *raw; -- (NSURL *)fileURL; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSURL *fileURL; @end diff --git a/FsprgEmbeddedStore/Model/FsprgFileDownload.m b/Source/Model/FsprgFileDownload.m similarity index 66% rename from FsprgEmbeddedStore/Model/FsprgFileDownload.m rename to Source/Model/FsprgFileDownload.m index f36825f..edd32ed 100644 --- a/FsprgEmbeddedStore/Model/FsprgFileDownload.m +++ b/Source/Model/FsprgFileDownload.m @@ -13,32 +13,38 @@ @implementation FsprgFileDownload + (FsprgFileDownload *)fileDownloadWithDictionary:(NSDictionary *)aDictionary { - return [[[FsprgFileDownload alloc] initWithDictionary:aDictionary] autorelease]; + return [[FsprgFileDownload alloc] initWithDictionary:aDictionary]; } -- (FsprgFileDownload *)initWithDictionary:(NSDictionary *)aDictionary +- (instancetype)init +{ + return [self initWithDictionary:@{}]; +} + +- (instancetype)initWithDictionary:(NSDictionary *)aDictionary { self = [super init]; if (self != nil) { - [self setRaw:aDictionary]; + self.raw = aDictionary; } return self; } + - (NSDictionary *)raw { - return [[raw retain] autorelease]; + return raw; } + - (void)setRaw:(NSDictionary *)aDictionary { if (raw != aDictionary) { - [raw release]; - raw = [aDictionary retain]; + raw = aDictionary; } } - (NSURL *)fileURL { - return [NSURL URLWithString:[[self raw] valueForKey:@"FileURL"]]; + return [NSURL URLWithString:[self.raw valueForKey:@"FileURL"]]; } + (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key @@ -51,7 +57,6 @@ - (void)dealloc { [self setRaw:nil]; - [super dealloc]; } @end diff --git a/FsprgEmbeddedStore/Model/FsprgFulfillment.h b/Source/Model/FsprgFulfillment.h similarity index 81% rename from FsprgEmbeddedStore/Model/FsprgFulfillment.h rename to Source/Model/FsprgFulfillment.h index de932b2..0a89667 100644 --- a/FsprgEmbeddedStore/Model/FsprgFulfillment.h +++ b/Source/Model/FsprgFulfillment.h @@ -19,9 +19,8 @@ + (FsprgFulfillment *)fulfillmentWithDictionary:(NSDictionary *)aDictionary; -- (FsprgFulfillment *)initWithDictionary:(NSDictionary *)aDictionary; -- (NSDictionary *)raw; -- (void)setRaw:(NSDictionary *)aDictionary; +- (instancetype)initWithDictionary:(NSDictionary *)aDictionary NS_DESIGNATED_INITIALIZER; +@property (NS_NONATOMIC_IOSONLY, copy) NSDictionary *raw; /*! * @param aKey type of fulfillment (e.g. license, download) diff --git a/FsprgEmbeddedStore/Model/FsprgFulfillment.m b/Source/Model/FsprgFulfillment.m similarity index 75% rename from FsprgEmbeddedStore/Model/FsprgFulfillment.m rename to Source/Model/FsprgFulfillment.m index 1745458..eed6039 100644 --- a/FsprgEmbeddedStore/Model/FsprgFulfillment.m +++ b/Source/Model/FsprgFulfillment.m @@ -15,33 +15,38 @@ @implementation FsprgFulfillment + (FsprgFulfillment *)fulfillmentWithDictionary:(NSDictionary *)aDictionary { - return [[[FsprgFulfillment alloc] initWithDictionary:aDictionary] autorelease]; + return [[FsprgFulfillment alloc] initWithDictionary:aDictionary]; } -- (FsprgFulfillment *)initWithDictionary:(NSDictionary *)aDictionary +- (instancetype)init +{ + return [self initWithDictionary:@{}]; +} + +- (instancetype)initWithDictionary:(NSDictionary *)aDictionary { self = [super init]; if (self != nil) { - [self setRaw:aDictionary]; + self.raw = aDictionary; } return self; } + - (NSDictionary *)raw { - return [[raw retain] autorelease]; + return raw; } - (void)setRaw:(NSDictionary *)aDictionary { if (raw != aDictionary) { - [raw release]; - raw = [aDictionary retain]; + raw = aDictionary; } } - (id)valueForKey:(NSString *)aKey { - NSDictionary *anItem = [[self raw] valueForKey:aKey]; + NSDictionary *anItem = [self.raw valueForKey:aKey]; if([[anItem valueForKey:@"FulfillmentType"] isEqual:@"License"]) { return [FsprgLicense licenseWithDictionary:anItem]; @@ -63,7 +68,6 @@ - (void)dealloc { [self setRaw:nil]; - [super dealloc]; } @end diff --git a/Source/Model/FsprgLicense.h b/Source/Model/FsprgLicense.h new file mode 100644 index 0000000..ac83133 --- /dev/null +++ b/Source/Model/FsprgLicense.h @@ -0,0 +1,33 @@ +// +// FsprgLicense.h +// FsprgEmbeddedStore +// +// Created by Lars Steiger on 2/24/10. +// Copyright 2010 FastSpring. All rights reserved. +// + +#import + + +/*! + * License information. FsprgLicense is backed by a NSMutableDictionary that + * can be accessed and modified via the raw and setRaw: methods. + */ +@interface FsprgLicense : NSObject { + NSDictionary *raw; +} + ++ (FsprgLicense *)licenseWithDictionary:(NSDictionary *)aDictionary; + +- (instancetype)initWithDictionary:(NSDictionary *)aDictionary NS_DESIGNATED_INITIALIZER; +@property (NS_NONATOMIC_IOSONLY, copy) NSDictionary *raw; + +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *licenseName; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *licenseEmail; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *licenseCompany; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *firstLicenseCode; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *licenseCodes; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSDictionary *licensePropertyList; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSURL *licenseURL; + +@end diff --git a/FsprgEmbeddedStore/Model/FsprgLicense.m b/Source/Model/FsprgLicense.m similarity index 57% rename from FsprgEmbeddedStore/Model/FsprgLicense.m rename to Source/Model/FsprgLicense.m index 0bd919c..32a7e3c 100644 --- a/FsprgEmbeddedStore/Model/FsprgLicense.m +++ b/Source/Model/FsprgLicense.m @@ -13,63 +13,67 @@ @implementation FsprgLicense + (FsprgLicense *)licenseWithDictionary:(NSDictionary *)aDictionary { - return [[[FsprgLicense alloc] initWithDictionary:aDictionary] autorelease]; + return [[FsprgLicense alloc] initWithDictionary:aDictionary]; } -- (FsprgLicense *)initWithDictionary:(NSDictionary *)aDictionary +- (instancetype)init +{ + return [self initWithDictionary:@{}]; +} + +- (instancetype)initWithDictionary:(NSDictionary *)aDictionary { self = [super init]; if (self != nil) { - [self setRaw:aDictionary]; + self.raw = aDictionary; } return self; } - (NSDictionary *)raw { - return [[raw retain] autorelease]; + return raw; } - (void)setRaw:(NSDictionary *)aDictionary { if (raw != aDictionary) { - [raw release]; - raw = [aDictionary retain]; + raw = aDictionary; } } - (NSString *)licenseName { - return [[self raw] valueForKey:@"LicenseName"]; + return [self.raw valueForKey:@"LicenseName"]; } - (NSString *)licenseEmail { - return [[self raw] valueForKey:@"LicenseEmail"]; + return [self.raw valueForKey:@"LicenseEmail"]; } - (NSString *)licenseCompany { - return [[self raw] valueForKey:@"LicenseCompany"]; + return [self.raw valueForKey:@"LicenseCompany"]; } - (NSString *)firstLicenseCode { - return [[self licenseCodes] objectAtIndex:0]; + return self.licenseCodes[0]; } - (NSArray *)licenseCodes { - return [[self raw] valueForKey:@"LicenseCodes"]; + return [self.raw valueForKey:@"LicenseCodes"]; } - (NSDictionary *)licensePropertyList { - return [[self raw] valueForKey:@"LicensePropertyList"]; + return [self.raw valueForKey:@"LicensePropertyList"]; } - (NSURL *)licenseURL { - return [NSURL URLWithString:[[self raw] valueForKey:@"LicenseURL"]]; + return [NSURL URLWithString:[self.raw valueForKey:@"LicenseURL"]]; } + (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key @@ -82,7 +86,6 @@ - (void)dealloc { [self setRaw:nil]; - [super dealloc]; } @end diff --git a/Source/Model/FsprgOrder.h b/Source/Model/FsprgOrder.h new file mode 100644 index 0000000..042c46d --- /dev/null +++ b/Source/Model/FsprgOrder.h @@ -0,0 +1,44 @@ +// +// FsprgOrder.h +// FsprgEmbeddedStore +// +// Created by Lars Steiger on 2/12/10. +// Copyright 2010 FastSpring. All rights reserved. +// + +#import +#import + + +/*! + * Order information. FsprgOrder is backed by a NSMutableDictionary that + * can be accessed and modified via the raw and setRaw: methods. + */ +@interface FsprgOrder : NSObject { + NSDictionary *raw; +} + ++ (FsprgOrder *)orderFromData:(NSData *)aData; + +- (instancetype)initWithDictionary:(NSDictionary *)aDictionary NS_DESIGNATED_INITIALIZER; +@property (NS_NONATOMIC_IOSONLY, copy) NSDictionary *raw; + +@property (NS_NONATOMIC_IOSONLY, readonly) BOOL orderIsTest; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *orderReference; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *orderLanguage; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *orderCurrency; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSNumber *orderTotal; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSNumber *orderTotalUSD; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *customerFirstName; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *customerLastName; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *customerCompany; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *customerEmail; + +/*! + * Shortcut for [[self orderItems] objectAtIndex:0]. + * @result First item. + */ +@property (NS_NONATOMIC_IOSONLY, readonly, strong) FsprgOrderItem *firstOrderItem; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *orderItems; + +@end diff --git a/FsprgEmbeddedStore/Model/FsprgOrder.m b/Source/Model/FsprgOrder.m similarity index 50% rename from FsprgEmbeddedStore/Model/FsprgOrder.m rename to Source/Model/FsprgOrder.m index 2164f8e..8c3072e 100644 --- a/FsprgEmbeddedStore/Model/FsprgOrder.m +++ b/Source/Model/FsprgOrder.m @@ -14,108 +14,103 @@ @implementation FsprgOrder + (FsprgOrder *)orderFromData:(NSData *)aData { NSPropertyListFormat *format = nil; - NSString *errorDesc = nil; - -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6 - NSDictionary *aDict = [NSPropertyListSerialization propertyListFromData:aData - mutabilityOption:NSPropertyListImmutable - format:format - errorDescription:&errorDesc]; - -#else NSDictionary *aDict = [NSPropertyListSerialization propertyListWithData:aData options:NSPropertyListImmutable format:format error:nil]; -#endif - - return [[[FsprgOrder alloc] initWithDictionary:aDict] autorelease]; + return [[FsprgOrder alloc] initWithDictionary:aDict]; +} + +- (instancetype)init +{ + return [self initWithDictionary:@{}]; } -- (FsprgOrder *)initWithDictionary:(NSDictionary *)aDictionary +- (instancetype)initWithDictionary:(NSDictionary *)aDictionary { self = [super init]; if (self != nil) { - [self setRaw:aDictionary]; + self.raw = aDictionary; } return self; -} +} + - (NSDictionary *)raw { - return [[raw retain] autorelease]; + return raw; } + - (void)setRaw:(NSDictionary *)aDictionary { if (raw != aDictionary) { - [raw release]; - raw = [aDictionary retain]; + raw = aDictionary; } } - (BOOL)orderIsTest { - return [[[self raw] valueForKey:@"OrderIsTest"] boolValue]; + return [[self.raw valueForKey:@"OrderIsTest"] boolValue]; } - (NSString *)orderReference { - return [[self raw] valueForKey:@"OrderReference"]; + return [self.raw valueForKey:@"OrderReference"]; } - (NSString *)orderLanguage { - return [[self raw] valueForKey:@"OrderLanguage"]; + return [self.raw valueForKey:@"OrderLanguage"]; } - (NSString *)orderCurrency { - return [[self raw] valueForKey:@"OrderCurrency"]; + return [self.raw valueForKey:@"OrderCurrency"]; } - (NSNumber *)orderTotal { - return [[self raw] valueForKey:@"OrderTotal"]; + return [self.raw valueForKey:@"OrderTotal"]; } - (NSNumber *)orderTotalUSD { - return [[self raw] valueForKey:@"OrderTotalUSD"]; + return [self.raw valueForKey:@"OrderTotalUSD"]; } - (NSString *)customerFirstName { - return [[self raw] valueForKey:@"CustomerFirstName"]; + return [self.raw valueForKey:@"CustomerFirstName"]; } - (NSString *)customerLastName { - return [[self raw] valueForKey:@"CustomerLastName"]; + return [self.raw valueForKey:@"CustomerLastName"]; } - (NSString *)customerCompany { - return [[self raw] valueForKey:@"CustomerCompany"]; + return [self.raw valueForKey:@"CustomerCompany"]; } - (NSString *)customerEmail { - return [[self raw] valueForKey:@"CustomerEmail"]; + return [self.raw valueForKey:@"CustomerEmail"]; } - (FsprgOrderItem *)firstOrderItem { - NSArray *items = [[self raw] valueForKey:@"OrderItems"]; - return [FsprgOrderItem itemWithDictionary:[items objectAtIndex:0]]; + NSArray *items = [self.raw valueForKey:@"OrderItems"]; + return [FsprgOrderItem itemWithDictionary:items[0]]; } - (NSArray *)orderItems { - NSArray *items = [[self raw] valueForKey:@"OrderItems"]; - NSMutableArray *orderItems = [NSMutableArray arrayWithCapacity:[items count]]; + NSArray *items = [self.raw valueForKey:@"OrderItems"]; + NSMutableArray *orderItems = [NSMutableArray arrayWithCapacity:items.count]; - NSUInteger i, count = [items count]; + NSUInteger i, count = items.count; for (i = 0; i < count; i++) { - NSDictionary *anItem = [items objectAtIndex:i]; + NSDictionary *anItem = items[i]; [orderItems addObject:[FsprgOrderItem itemWithDictionary:anItem]]; } @@ -132,7 +127,6 @@ - (void)dealloc { [self setRaw:nil]; - [super dealloc]; } @end diff --git a/Source/Model/FsprgOrderItem.h b/Source/Model/FsprgOrderItem.h new file mode 100644 index 0000000..15b44d3 --- /dev/null +++ b/Source/Model/FsprgOrderItem.h @@ -0,0 +1,59 @@ +// +// FsprgOrderItem.h +// FsprgEmbeddedStore +// +// Created by Lars Steiger on 2/24/10. +// Copyright 2010 FastSpring. All rights reserved. +// + +#import +#import +#import +#import + + +/*! + * Order item information. FsprgOrderItem is backed by a NSMutableDictionary that + * can be accessed and modified via the raw and setRaw: methods. + */ +@interface FsprgOrderItem : NSObject { + NSDictionary *raw; +} + ++ (FsprgOrderItem *)itemWithDictionary:(NSDictionary *)aDictionary; + +- (instancetype)initWithDictionary:(NSDictionary *)aDictionary NS_DESIGNATED_INITIALIZER; +@property (NS_NONATOMIC_IOSONLY, copy) NSDictionary *raw; + +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *productName; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *productDisplay; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSNumber *quantity; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSNumber *itemTotal; +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSNumber *itemTotalUSD; + +/*! + * This reference can be used to make calls to FastSpring's Subscription API. + * See https://support.fastspring.com/entries/236487-api-subscriptions + */ +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *subscriptionReference; + +/*! + * This URL can be presented to the customer to manage their subscription. + */ +@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSURL *subscriptionCustomerURL; + +@property (NS_NONATOMIC_IOSONLY, readonly, strong) FsprgFulfillment *fulfillment; + +/*! + * Shortcut for [[self fulfillment] valueForKey:@"license"]. + * @result License information. + */ +@property (NS_NONATOMIC_IOSONLY, readonly, strong) FsprgLicense *license; + +/*! + * Shortcut for [[self fulfillment] valueForKey:@"download"]. + * @result Download information. + */ +@property (NS_NONATOMIC_IOSONLY, readonly, strong) FsprgFileDownload *download; + +@end diff --git a/FsprgEmbeddedStore/Model/FsprgOrderItem.m b/Source/Model/FsprgOrderItem.m similarity index 53% rename from FsprgEmbeddedStore/Model/FsprgOrderItem.m rename to Source/Model/FsprgOrderItem.m index 9a13cf2..3087fa8 100644 --- a/FsprgEmbeddedStore/Model/FsprgOrderItem.m +++ b/Source/Model/FsprgOrderItem.m @@ -13,78 +13,83 @@ @implementation FsprgOrderItem + (FsprgOrderItem *)itemWithDictionary:(NSDictionary *)aDictionary { - return [[[FsprgOrderItem alloc] initWithDictionary:aDictionary] autorelease]; + return [[FsprgOrderItem alloc] initWithDictionary:aDictionary]; } -- (FsprgOrderItem *)initWithDictionary:(NSDictionary *)aDictionary +- (instancetype)init +{ + return [self initWithDictionary:@{}]; +} + +- (instancetype)initWithDictionary:(NSDictionary *)aDictionary { self = [super init]; if (self != nil) { - [self setRaw:aDictionary]; + self.raw = aDictionary; } return self; } + - (NSDictionary *)raw { - return [[raw retain] autorelease]; + return raw; } - (void)setRaw:(NSDictionary *)aDictionary { if (raw != aDictionary) { - [raw release]; - raw = [aDictionary retain]; + raw = aDictionary; } } - (NSString *)productName { - return [[self raw] valueForKey:@"ProductName"]; + return [self.raw valueForKey:@"ProductName"]; } - (NSString *)productDisplay { - return [[self raw] valueForKey:@"ProductDisplay"]; + return [self.raw valueForKey:@"ProductDisplay"]; } - (NSNumber *)quantity { - return [[self raw] valueForKey:@"Quantity"]; + return [self.raw valueForKey:@"Quantity"]; } - (NSNumber *)itemTotal { - return [[self raw] valueForKey:@"ItemTotal"]; + return [self.raw valueForKey:@"ItemTotal"]; } - (NSNumber *)itemTotalUSD { - return [[self raw] valueForKey:@"ItemTotalUSD"]; + return [self.raw valueForKey:@"ItemTotalUSD"]; } - (NSString *)subscriptionReference { - return [[self raw] valueForKey:@"SubscriptionReference"]; + return [self.raw valueForKey:@"SubscriptionReference"]; } - (NSURL *)subscriptionCustomerURL { - return [NSURL URLWithString:[[self raw] valueForKey:@"SubscriptionCustomerURL"]]; + return [NSURL URLWithString:[self.raw valueForKey:@"SubscriptionCustomerURL"]]; } - (FsprgFulfillment *)fulfillment { - return [FsprgFulfillment fulfillmentWithDictionary:[[self raw] valueForKey:@"Fulfillment"]]; + return [FsprgFulfillment fulfillmentWithDictionary:[self.raw valueForKey:@"Fulfillment"]]; } - (FsprgLicense *)license { - return [[self fulfillment] valueForKey:@"license"]; + return [self.fulfillment valueForKey:@"license"]; } - (FsprgFileDownload *)download { - return [[self fulfillment] valueForKey:@"download"]; + return [self.fulfillment valueForKey:@"download"]; } + (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key @@ -97,7 +102,6 @@ - (void)dealloc { [self setRaw:nil]; - [super dealloc]; } @end diff --git a/FsprgEmbeddedStore/Tests/FsprgStoreParametersTest.h b/Source/Tests/FsprgStoreParametersTest.h similarity index 100% rename from FsprgEmbeddedStore/Tests/FsprgStoreParametersTest.h rename to Source/Tests/FsprgStoreParametersTest.h diff --git a/FsprgEmbeddedStore/Tests/FsprgStoreParametersTest.m b/Source/Tests/FsprgStoreParametersTest.m similarity index 100% rename from FsprgEmbeddedStore/Tests/FsprgStoreParametersTest.m rename to Source/Tests/FsprgStoreParametersTest.m diff --git a/FsprgEmbeddedStore/Tests/Model/FsprgOrderTest.h b/Source/Tests/Model/FsprgOrderTest.h similarity index 100% rename from FsprgEmbeddedStore/Tests/Model/FsprgOrderTest.h rename to Source/Tests/Model/FsprgOrderTest.h diff --git a/FsprgEmbeddedStore/Tests/Model/FsprgOrderTest.m b/Source/Tests/Model/FsprgOrderTest.m similarity index 100% rename from FsprgEmbeddedStore/Tests/Model/FsprgOrderTest.m rename to Source/Tests/Model/FsprgOrderTest.m diff --git a/FsprgEmbeddedStore/Tests/Model/complicated.plist b/Source/Tests/Model/complicated.plist similarity index 100% rename from FsprgEmbeddedStore/Tests/Model/complicated.plist rename to Source/Tests/Model/complicated.plist diff --git a/TestApp/AppController.m b/TestApp/AppController.m index 431a838..f2789e7 100644 --- a/TestApp/AppController.m +++ b/TestApp/AppController.m @@ -17,7 +17,7 @@ - (id) init { self = [super init]; if (self != nil) { - [self setStoreController:[[[FsprgEmbeddedStoreController alloc] init] autorelease]]; + [self setStoreController:[[FsprgEmbeddedStoreController alloc] init]]; [[[NSUserDefaultsController sharedUserDefaultsController] defaults] setBool:TRUE forKey:@"WebKitDeveloperExtras"]; @@ -27,7 +27,7 @@ - (id) init [[self params] setOrderProcessType:kFsprgOrderProcessDetail]; [[self params] setMode:kFsprgModeTest]; } else { - [self setParams:[FsprgStoreParameters parametersWithRaw:[[defaultParams mutableCopy] autorelease]]]; + [self setParams:[FsprgStoreParameters parametersWithRaw:[defaultParams mutableCopy]]]; } [[self storeController] setDelegate:self]; @@ -37,27 +37,25 @@ - (id) init - (FsprgEmbeddedStoreController *)storeController { - return [[storeController retain] autorelease]; + return storeController; } - (void)setStoreController:(FsprgEmbeddedStoreController *)aStoreController { if (storeController != aStoreController) { - [storeController release]; - storeController = [aStoreController retain]; + storeController = aStoreController; } } - (FsprgStoreParameters *)params { - return [[params retain] autorelease]; + return params; } - (void)setParams:(FsprgStoreParameters *)aParams { if (params != aParams) { - [params release]; - params = [aParams retain]; + params = aParams; } } @@ -124,7 +122,7 @@ - (NSView *)viewWithFrame:(NSRect)frame forOrder:(FsprgOrder *)order NSData *data = [NSPropertyListSerialization dataFromPropertyList:[order raw] format:NSPropertyListXMLFormat_v1_0 errorDescription:&errorDesc]; - NSString *orderAsStr = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; + NSString *orderAsStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; OrderViewController *orderViewController = [[OrderViewController alloc] initWithNibName:@"OrderView" bundle:nil]; [orderViewController setRepresentedObject:orderAsStr]; @@ -158,7 +156,6 @@ - (void)dealloc [[self storeController] setDelegate:nil]; [self setStoreController:nil]; - [super dealloc]; } @end diff --git a/TestApp/OrderViewController.m b/TestApp/OrderViewController.m index 3ac8d00..c3be90c 100644 --- a/TestApp/OrderViewController.m +++ b/TestApp/OrderViewController.m @@ -13,14 +13,13 @@ @implementation OrderViewController - (NSString *)fileName { - return [[fileName retain] autorelease]; + return fileName; } - (void)setFileName:(NSString *)aFileName { if (fileName != aFileName) { - [fileName release]; - fileName = [aFileName retain]; + fileName = aFileName; } } @@ -58,7 +57,6 @@ - (void)dealloc { [self setFileName:nil]; - [super dealloc]; } @end diff --git a/TestApp/TestApp.xcodeproj/project.pbxproj b/TestApp/TestApp.xcodeproj/project.pbxproj index 60f5604..0f66833 100644 --- a/TestApp/TestApp.xcodeproj/project.pbxproj +++ b/TestApp/TestApp.xcodeproj/project.pbxproj @@ -292,7 +292,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0440; + LastUpgradeCheck = 0630; ORGANIZATIONNAME = FastSpring; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TestApp" */; @@ -376,6 +376,7 @@ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = TestApp_Prefix.pch; @@ -388,6 +389,7 @@ C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = TestApp_Prefix.pch; @@ -402,6 +404,9 @@ buildSettings = { GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; }; name = Debug; }; @@ -410,6 +415,8 @@ buildSettings = { GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + SDKROOT = macosx; }; name = Release; }; diff --git a/TestUsage-Swift/AppDelegate.swift b/TestUsage-Swift/AppDelegate.swift new file mode 100644 index 0000000..8206b0a --- /dev/null +++ b/TestUsage-Swift/AppDelegate.swift @@ -0,0 +1,48 @@ +import Cocoa +import FsprgEmbeddedStore + +@NSApplicationMain +class AppDelegate: NSObject, NSApplicationDelegate { + + @IBOutlet weak var window: NSWindow! + + let storeController = FsprgEmbeddedStoreController() + + func applicationDidFinishLaunching(_ aNotification: Notification) { + + storeController.delegate = self + } + + func applicationWillTerminate(_ aNotification: Notification) { + // Insert code here to tear down your application + } + +} + +extension AppDelegate: FsprgEmbeddedStoreDelegate { + + func didLoadStore(_ url: URL!) { + + } + + func didLoadPage(_ url: URL!, of pageType: FsprgPageType) { + + } + + func didReceive(_ order: FsprgOrder!) { + + } + + func view(withFrame frame: NSRect, for order: FsprgOrder!) -> NSView! { + + return NSView() + } + + func webView(_ sender: WebView!, didFailProvisionalLoadWithError error: Error!, for frame: WebFrame!) { + + } + + func webView(_ sender: WebView!, didFailLoadWithError error: Error!, for frame: WebFrame!) { + + } +} diff --git a/TestUsage-Swift/Assets.xcassets/AppIcon.appiconset/Contents.json b/TestUsage-Swift/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2db2b1c --- /dev/null +++ b/TestUsage-Swift/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/TestUsage-Swift/Base.lproj/MainMenu.xib b/TestUsage-Swift/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..ef233f2 --- /dev/null +++ b/TestUsage-Swift/Base.lproj/MainMenu.xib @@ -0,0 +1,692 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TestUsage-Swift/Info.plist b/TestUsage-Swift/Info.plist new file mode 100644 index 0000000..b82bef4 --- /dev/null +++ b/TestUsage-Swift/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2016 Edovia Inc. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + +