diff --git a/.gitmodules b/.gitmodules index 60079d8..c3994c5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,18 +1,15 @@ -[submodule "Carthage/Checkouts/Box"] - path = Carthage/Checkouts/Box - url = https://github.com/robrix/Box.git +[submodule "Carthage/Checkouts/Result"] + path = Carthage/Checkouts/Result + url = https://github.com/antitypical/Result.git +[submodule "Carthage/Checkouts/xcconfigs"] + path = Carthage/Checkouts/xcconfigs + url = https://github.com/jspahrsummers/xcconfigs.git [submodule "Carthage/Checkouts/Nimble"] path = Carthage/Checkouts/Nimble url = https://github.com/Quick/Nimble.git [submodule "Carthage/Checkouts/Quick"] path = Carthage/Checkouts/Quick url = https://github.com/Quick/Quick.git -[submodule "Carthage/Checkouts/xcconfigs"] - path = Carthage/Checkouts/xcconfigs - url = https://github.com/jspahrsummers/xcconfigs.git -[submodule "Carthage/Checkouts/Result"] - path = Carthage/Checkouts/Result - url = https://github.com/antitypical/Result.git [submodule "Carthage/Checkouts/ReactiveCocoa"] path = Carthage/Checkouts/ReactiveCocoa url = https://github.com/ReactiveCocoa/ReactiveCocoa.git diff --git a/Cartfile b/Cartfile index 02a6698..313e02e 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "ReactiveCocoa/ReactiveCocoa" "v3.0-beta.8" +github "ReactiveCocoa/ReactiveCocoa" ~> 4.0.0 diff --git a/Cartfile.private b/Cartfile.private index af8de78..26a4387 100644 --- a/Cartfile.private +++ b/Cartfile.private @@ -1,3 +1,3 @@ -github "Quick/Quick" ~> 0.3 -github "Quick/Nimble" ~> 0.4 +github "Quick/Quick" ~> 0.8.0 +github "Quick/Nimble" ~> 3.0.0 github "jspahrsummers/xcconfigs" ~> 0.8 diff --git a/Cartfile.resolved b/Cartfile.resolved index a6ef940..7fc0c82 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,6 +1,5 @@ -github "robrix/Box" "1.2.2" -github "Quick/Nimble" "v0.4.2" -github "Quick/Quick" "v0.3.1" +github "Quick/Nimble" "v3.1.0" +github "Quick/Quick" "v0.8.0" +github "antitypical/Result" "1.0.2" github "jspahrsummers/xcconfigs" "0.8.1" -github "antitypical/Result" "0.4.4" -github "ReactiveCocoa/ReactiveCocoa" "b89e1b73f2d1c6a99e0916f699ab6dcda71c74b5" +github "ReactiveCocoa/ReactiveCocoa" "v4.0.1" diff --git a/Carthage/Checkouts/Box b/Carthage/Checkouts/Box deleted file mode 160000 index bbe4e61..0000000 --- a/Carthage/Checkouts/Box +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bbe4e612a03ffe0bbb0e2e476c2be4534b6777a5 diff --git a/Carthage/Checkouts/Nimble b/Carthage/Checkouts/Nimble index 8927113..72878d6 160000 --- a/Carthage/Checkouts/Nimble +++ b/Carthage/Checkouts/Nimble @@ -1 +1 @@ -Subproject commit 8927113f877f32c8a01b41b746c4ac261b42c48e +Subproject commit 72878d6622cf8362d3507cd2e3d341b06580f451 diff --git a/Carthage/Checkouts/Quick b/Carthage/Checkouts/Quick index 8bf96f7..e0ce8a8 160000 --- a/Carthage/Checkouts/Quick +++ b/Carthage/Checkouts/Quick @@ -1 +1 @@ -Subproject commit 8bf96f708924d728dab5f0cf7543b6f1b896a209 +Subproject commit e0ce8a820ff0acf8b7fedcab27186736b51412b8 diff --git a/Carthage/Checkouts/ReactiveCocoa b/Carthage/Checkouts/ReactiveCocoa index b89e1b7..def976d 160000 --- a/Carthage/Checkouts/ReactiveCocoa +++ b/Carthage/Checkouts/ReactiveCocoa @@ -1 +1 @@ -Subproject commit b89e1b73f2d1c6a99e0916f699ab6dcda71c74b5 +Subproject commit def976d4ef5f3e38786a478a673db7c3f9a1d719 diff --git a/Carthage/Checkouts/Result b/Carthage/Checkouts/Result index 81b1896..382f933 160000 --- a/Carthage/Checkouts/Result +++ b/Carthage/Checkouts/Result @@ -1 +1 @@ -Subproject commit 81b189645babd30c6f70ed3f82a83988a467fb02 +Subproject commit 382f9339404d24f632a5f98453c1e08a5ea55904 diff --git a/EditableProperty.xcodeproj/project.pbxproj b/EditableProperty.xcodeproj/project.pbxproj index 2ba1572..dacf384 100644 --- a/EditableProperty.xcodeproj/project.pbxproj +++ b/EditableProperty.xcodeproj/project.pbxproj @@ -17,27 +17,22 @@ D03A80C21AF36BF10047F5AE /* EditableProperty.swift in Sources */ = {isa = PBXBuildFile; fileRef = D03A80C11AF36BF10047F5AE /* EditableProperty.swift */; }; D03A80ED1AF36C140047F5AE /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D03A80EB1AF36C140047F5AE /* Nimble.framework */; }; D03A80EE1AF36C140047F5AE /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D03A80EC1AF36C140047F5AE /* Quick.framework */; }; - D8D608981B2FC9D00068D35B /* Box.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8D608961B2FC9D00068D35B /* Box.framework */; }; D8D608991B2FC9D00068D35B /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8D608971B2FC9D00068D35B /* Result.framework */; }; D8D6089B1B2FCA060068D35B /* ReactiveCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8D6089A1B2FCA060068D35B /* ReactiveCocoa.framework */; }; - D8D6089C1B2FCA710068D35B /* Box.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = D8D608961B2FC9D00068D35B /* Box.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; D8D6089D1B2FCA710068D35B /* ReactiveCocoa.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = D8D6089A1B2FCA060068D35B /* ReactiveCocoa.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; D8D6089E1B2FCA710068D35B /* Result.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = D8D608971B2FC9D00068D35B /* Result.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; D8D608AF1B2FCB7F0068D35B /* EditableProperty.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8D608A41B2FCB7E0068D35B /* EditableProperty.framework */; }; - D8D608C41B2FCC510068D35B /* Box.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8D608C11B2FCC510068D35B /* Box.framework */; }; D8D608C51B2FCC510068D35B /* ReactiveCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8D608C21B2FCC510068D35B /* ReactiveCocoa.framework */; }; D8D608C61B2FCC510068D35B /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8D608C31B2FCC510068D35B /* Result.framework */; }; D8D608C91B2FCCDF0068D35B /* EditableProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = D03A80AA1AF36BD70047F5AE /* EditableProperty.h */; settings = {ATTRIBUTES = (Public, ); }; }; D8D608CA1B2FCCE50068D35B /* Committed.swift in Sources */ = {isa = PBXBuildFile; fileRef = D00E59891AF3FFA3000DAF8A /* Committed.swift */; }; D8D608CB1B2FCCE50068D35B /* Editor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D00E598A1AF3FFA3000DAF8A /* Editor.swift */; }; D8D608CC1B2FCCE50068D35B /* EditableProperty.swift in Sources */ = {isa = PBXBuildFile; fileRef = D03A80C11AF36BF10047F5AE /* EditableProperty.swift */; }; - D8D608CD1B2FCCF80068D35B /* Box.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8D608C11B2FCC510068D35B /* Box.framework */; }; D8D608CE1B2FCCF80068D35B /* ReactiveCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8D608C21B2FCC510068D35B /* ReactiveCocoa.framework */; }; D8D608CF1B2FCCF80068D35B /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8D608C31B2FCC510068D35B /* Result.framework */; }; D8D608D01B2FCD020068D35B /* EditablePropertySpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D00E598F1AF404E5000DAF8A /* EditablePropertySpec.swift */; }; D8D608D41B2FCD3B0068D35B /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8D608D21B2FCD3B0068D35B /* Nimble.framework */; }; D8D608D51B2FCD3B0068D35B /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8D608D31B2FCD3B0068D35B /* Quick.framework */; }; - D8D608D81B2FCDA90068D35B /* Box.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = D8D608C11B2FCC510068D35B /* Box.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; D8D608D91B2FCDA90068D35B /* ReactiveCocoa.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = D8D608C21B2FCC510068D35B /* ReactiveCocoa.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; D8D608DA1B2FCDA90068D35B /* Result.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = D8D608C31B2FCC510068D35B /* Result.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; D8D608DB1B2FCDA90068D35B /* Nimble.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = D8D608D21B2FCD3B0068D35B /* Nimble.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; @@ -68,7 +63,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - D8D6089C1B2FCA710068D35B /* Box.framework in Copy Frameworks */, D8D6089D1B2FCA710068D35B /* ReactiveCocoa.framework in Copy Frameworks */, D8D6089E1B2FCA710068D35B /* Result.framework in Copy Frameworks */, D00E59921AF406E3000DAF8A /* Quick.framework in Copy Frameworks */, @@ -83,7 +77,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - D8D608D81B2FCDA90068D35B /* Box.framework in CopyFiles */, D8D608D91B2FCDA90068D35B /* ReactiveCocoa.framework in CopyFiles */, D8D608DA1B2FCDA90068D35B /* Result.framework in CopyFiles */, D8D608DB1B2FCDA90068D35B /* Nimble.framework in CopyFiles */, @@ -94,7 +87,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - D00E59891AF3FFA3000DAF8A /* Committed.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Committed.swift; sourceTree = ""; }; + D00E59891AF3FFA3000DAF8A /* Committed.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Committed.swift; sourceTree = ""; usesTabs = 1; }; D00E598A1AF3FFA3000DAF8A /* Editor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Editor.swift; sourceTree = ""; }; D00E598F1AF404E5000DAF8A /* EditablePropertySpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditablePropertySpec.swift; sourceTree = ""; }; D03A80A51AF36BD70047F5AE /* EditableProperty.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = EditableProperty.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -102,7 +95,7 @@ D03A80AA1AF36BD70047F5AE /* EditableProperty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EditableProperty.h; sourceTree = ""; }; D03A80B01AF36BD70047F5AE /* EditablePropertyTests-Mac.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "EditablePropertyTests-Mac.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; D03A80B61AF36BD70047F5AE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D03A80C11AF36BF10047F5AE /* EditableProperty.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditableProperty.swift; sourceTree = ""; }; + D03A80C11AF36BF10047F5AE /* EditableProperty.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditableProperty.swift; sourceTree = ""; usesTabs = 1; }; D03A80C51AF36BFC0047F5AE /* Common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = ""; }; D03A80C71AF36BFC0047F5AE /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; D03A80C81AF36BFC0047F5AE /* Profile.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Profile.xcconfig; sourceTree = ""; }; @@ -131,12 +124,10 @@ D03A80E61AF36BFC0047F5AE /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; D03A80EB1AF36C140047F5AE /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nimble.framework; path = Carthage/Build/Mac/Nimble.framework; sourceTree = SOURCE_ROOT; }; D03A80EC1AF36C140047F5AE /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quick.framework; path = Carthage/Build/Mac/Quick.framework; sourceTree = SOURCE_ROOT; }; - D8D608961B2FC9D00068D35B /* Box.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Box.framework; path = Carthage/Build/Mac/Box.framework; sourceTree = SOURCE_ROOT; }; D8D608971B2FC9D00068D35B /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Result.framework; path = Carthage/Build/Mac/Result.framework; sourceTree = SOURCE_ROOT; }; D8D6089A1B2FCA060068D35B /* ReactiveCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ReactiveCocoa.framework; path = Carthage/Build/Mac/ReactiveCocoa.framework; sourceTree = SOURCE_ROOT; }; D8D608A41B2FCB7E0068D35B /* EditableProperty.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = EditableProperty.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - D8D608AE1B2FCB7F0068D35B /* EditablePropertyTest-iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "EditablePropertyTest-iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - D8D608C11B2FCC510068D35B /* Box.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Box.framework; path = Carthage/Build/iOS/Box.framework; sourceTree = SOURCE_ROOT; }; + D8D608AE1B2FCB7F0068D35B /* EditablePropertyTests-iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "EditablePropertyTests-iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; D8D608C21B2FCC510068D35B /* ReactiveCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ReactiveCocoa.framework; path = Carthage/Build/iOS/ReactiveCocoa.framework; sourceTree = SOURCE_ROOT; }; D8D608C31B2FCC510068D35B /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Result.framework; path = Carthage/Build/iOS/Result.framework; sourceTree = SOURCE_ROOT; }; D8D608D21B2FCD3B0068D35B /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nimble.framework; path = Carthage/Build/iOS/Nimble.framework; sourceTree = SOURCE_ROOT; }; @@ -148,7 +139,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D8D608981B2FC9D00068D35B /* Box.framework in Frameworks */, D8D6089B1B2FCA060068D35B /* ReactiveCocoa.framework in Frameworks */, D8D608991B2FC9D00068D35B /* Result.framework in Frameworks */, ); @@ -168,7 +158,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D8D608C41B2FCC510068D35B /* Box.framework in Frameworks */, D8D608C51B2FCC510068D35B /* ReactiveCocoa.framework in Frameworks */, D8D608C61B2FCC510068D35B /* Result.framework in Frameworks */, ); @@ -179,7 +168,6 @@ buildActionMask = 2147483647; files = ( D8D608D41B2FCD3B0068D35B /* Nimble.framework in Frameworks */, - D8D608CD1B2FCCF80068D35B /* Box.framework in Frameworks */, D8D608D51B2FCD3B0068D35B /* Quick.framework in Frameworks */, D8D608CE1B2FCCF80068D35B /* ReactiveCocoa.framework in Frameworks */, D8D608AF1B2FCB7F0068D35B /* EditableProperty.framework in Frameworks */, @@ -224,7 +212,7 @@ D03A80A51AF36BD70047F5AE /* EditableProperty.framework */, D03A80B01AF36BD70047F5AE /* EditablePropertyTests-Mac.xctest */, D8D608A41B2FCB7E0068D35B /* EditableProperty.framework */, - D8D608AE1B2FCB7F0068D35B /* EditablePropertyTest-iOS.xctest */, + D8D608AE1B2FCB7F0068D35B /* EditablePropertyTests-iOS.xctest */, ); name = Products; sourceTree = ""; @@ -377,7 +365,6 @@ D8D608C71B2FCC5A0068D35B /* Mac */ = { isa = PBXGroup; children = ( - D8D608961B2FC9D00068D35B /* Box.framework */, D8D6089A1B2FCA060068D35B /* ReactiveCocoa.framework */, D8D608971B2FC9D00068D35B /* Result.framework */, ); @@ -387,7 +374,6 @@ D8D608C81B2FCC740068D35B /* iOS */ = { isa = PBXGroup; children = ( - D8D608C11B2FCC510068D35B /* Box.framework */, D8D608C21B2FCC510068D35B /* ReactiveCocoa.framework */, D8D608C31B2FCC510068D35B /* Result.framework */, ); @@ -505,7 +491,7 @@ ); name = "EditablePropertyTests-iOS"; productName = "EditableProperty-iOSTests"; - productReference = D8D608AE1B2FCB7F0068D35B /* EditablePropertyTest-iOS.xctest */; + productReference = D8D608AE1B2FCB7F0068D35B /* EditablePropertyTests-iOS.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ @@ -514,7 +500,9 @@ D03A809C1AF36BD70047F5AE /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0630; + LastSwiftMigration = 0700; + LastSwiftUpdateCheck = 0700; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = ReactiveCocoa; TargetAttributes = { D03A80A41AF36BD70047F5AE = { @@ -640,8 +628,11 @@ baseConfigurationReference = D03A80C71AF36BFC0047F5AE /* Debug.xcconfig */; buildSettings = { CURRENT_PROJECT_VERSION = 1; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; MACOSX_DEPLOYMENT_TARGET = 10.9; + ONLY_ACTIVE_ARCH = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -652,6 +643,7 @@ baseConfigurationReference = D03A80C91AF36BFC0047F5AE /* Release.xcconfig */; buildSettings = { CURRENT_PROJECT_VERSION = 1; + GCC_NO_COMMON_BLOCKS = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; MACOSX_DEPLOYMENT_TARGET = 10.9; VERSIONING_SYSTEM = "apple-generic"; @@ -663,6 +655,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D03A80E41AF36BFC0047F5AE /* Mac-Framework.xcconfig */; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( @@ -672,6 +665,7 @@ ); FRAMEWORK_VERSION = A; INFOPLIST_FILE = EditableProperty/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; }; name = Debug; @@ -680,6 +674,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D03A80E41AF36BFC0047F5AE /* Mac-Framework.xcconfig */; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( @@ -689,6 +684,7 @@ ); FRAMEWORK_VERSION = A; INFOPLIST_FILE = EditableProperty/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; }; name = Release; @@ -705,6 +701,7 @@ ); INFOPLIST_FILE = EditablePropertyTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -722,6 +719,7 @@ ); INFOPLIST_FILE = EditablePropertyTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -731,6 +729,7 @@ baseConfigurationReference = D03A80C81AF36BFC0047F5AE /* Profile.xcconfig */; buildSettings = { CURRENT_PROJECT_VERSION = 1; + GCC_NO_COMMON_BLOCKS = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; MACOSX_DEPLOYMENT_TARGET = 10.9; VERSIONING_SYSTEM = "apple-generic"; @@ -742,6 +741,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D03A80E41AF36BFC0047F5AE /* Mac-Framework.xcconfig */; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( @@ -751,6 +751,7 @@ ); FRAMEWORK_VERSION = A; INFOPLIST_FILE = EditableProperty/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; }; name = Profile; @@ -767,6 +768,7 @@ ); INFOPLIST_FILE = EditablePropertyTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Profile; @@ -776,6 +778,7 @@ baseConfigurationReference = D03A80CA1AF36BFC0047F5AE /* Test.xcconfig */; buildSettings = { CURRENT_PROJECT_VERSION = 1; + GCC_NO_COMMON_BLOCKS = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; MACOSX_DEPLOYMENT_TARGET = 10.9; VERSIONING_SYSTEM = "apple-generic"; @@ -787,6 +790,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D03A80E41AF36BFC0047F5AE /* Mac-Framework.xcconfig */; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( @@ -796,6 +800,7 @@ ); FRAMEWORK_VERSION = A; INFOPLIST_FILE = EditableProperty/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; }; name = Test; @@ -812,6 +817,7 @@ ); INFOPLIST_FILE = EditablePropertyTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -821,6 +827,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D03A80DE1AF36BFC0047F5AE /* iOS-Framework.xcconfig */; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -830,6 +837,7 @@ ); INFOPLIST_FILE = "$(SRCROOT)/EditableProperty/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; }; name = Debug; @@ -838,6 +846,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D03A80DE1AF36BFC0047F5AE /* iOS-Framework.xcconfig */; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -847,6 +856,7 @@ ); INFOPLIST_FILE = "$(SRCROOT)/EditableProperty/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; }; name = Test; @@ -855,6 +865,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D03A80DE1AF36BFC0047F5AE /* iOS-Framework.xcconfig */; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -864,6 +875,7 @@ ); INFOPLIST_FILE = "$(SRCROOT)/EditableProperty/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; }; name = Release; @@ -872,6 +884,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D03A80DE1AF36BFC0047F5AE /* iOS-Framework.xcconfig */; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -881,6 +894,7 @@ ); INFOPLIST_FILE = "$(SRCROOT)/EditableProperty/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; }; name = Profile; @@ -896,6 +910,7 @@ ); INFOPLIST_FILE = EditablePropertyTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -911,6 +926,7 @@ ); INFOPLIST_FILE = EditablePropertyTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Test; @@ -926,6 +942,7 @@ ); INFOPLIST_FILE = EditablePropertyTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -941,6 +958,7 @@ ); INFOPLIST_FILE = EditablePropertyTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Profile; diff --git a/EditableProperty.xcodeproj/project.xcworkspace/xcshareddata/EditableProperty.xcscmblueprint b/EditableProperty.xcodeproj/project.xcworkspace/xcshareddata/EditableProperty.xcscmblueprint new file mode 100644 index 0000000..cdec954 --- /dev/null +++ b/EditableProperty.xcodeproj/project.xcworkspace/xcshareddata/EditableProperty.xcscmblueprint @@ -0,0 +1,30 @@ +{ + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "1D7898204F0A200CCD7DCD44C6DD7CFCE6DBAD95", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { + + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { + "1D7898204F0A200CCD7DCD44C6DD7CFCE6DBAD95" : 0, + "E084C86B03F81D63323C9E7510697EA528A758C7" : 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "6EEAD2AA-65C6-4EBD-8E24-B8512896CFE5", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { + "1D7898204F0A200CCD7DCD44C6DD7CFCE6DBAD95" : "EditableProperty\/", + "E084C86B03F81D63323C9E7510697EA528A758C7" : "EditableProperty\/Carthage\/Checkouts\/xcconfigs\/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey" : "EditableProperty", + "DVTSourceControlWorkspaceBlueprintVersion" : 204, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "EditableProperty.xcodeproj", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:liscio\/EditableProperty.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "1D7898204F0A200CCD7DCD44C6DD7CFCE6DBAD95" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/jspahrsummers\/xcconfigs.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "E084C86B03F81D63323C9E7510697EA528A758C7" + } + ] +} \ No newline at end of file diff --git a/EditableProperty.xcodeproj/xcshareddata/xcschemes/EditableProperty-Mac.xcscheme b/EditableProperty.xcodeproj/xcshareddata/xcschemes/EditableProperty-Mac.xcscheme index d31e1f2..054edbc 100644 --- a/EditableProperty.xcodeproj/xcshareddata/xcschemes/EditableProperty-Mac.xcscheme +++ b/EditableProperty.xcodeproj/xcshareddata/xcschemes/EditableProperty-Mac.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -62,15 +62,18 @@ ReferencedContainer = "container:EditableProperty.xcodeproj"> + + + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -62,15 +62,18 @@ ReferencedContainer = "container:EditableProperty.xcodeproj"> + + { /// The change is an automatic update to a new default value. - case DefaultValue(Box) + case DefaultValue(Value) /// The change is a new value that has been explicitly set _without_ an /// editor. /// /// This might occur from setting `value` directly, or by explicitly binding /// signals, producers, or other properties to the EditableProperty. - case ExplicitUpdate(Box) + case ExplicitUpdate(Value) /// The value was validated and committed by the given editor. - case ValidatedEdit(Box, Editor) + case ValidatedEdit(Value, Editor) /// The value that was committed. public var value: Value { switch self { case let .DefaultValue(value): - return value.value + return value case let .ExplicitUpdate(value): - return value.value + return value case let .ValidatedEdit(value, _): - return value.value + return value } } @@ -55,7 +54,7 @@ public func == (lhs: Committed { +public final class EditableProperty: MutablePropertyType { /// The current value of the property, along with information about how that /// value was obtained. - public var committedValue: PropertyOf> { - return PropertyOf(_committedValue) + public var committedValue: AnyProperty> { + return AnyProperty(_committedValue) } private let _committedValue: MutableProperty> @@ -27,18 +27,18 @@ public final class EditableProperty { public init(defaultValue: P, editsTakePriority: Bool) { (validationErrors, validationErrorsSink) = Signal.pipe() - _committedValue = MutableProperty(.DefaultValue(Box(defaultValue.value))) + _committedValue = MutableProperty(.DefaultValue(defaultValue.value)) var defaults = defaultValue.producer - |> map { Committed.DefaultValue(Box($0)) } + .map { Committed.DefaultValue($0) } if editsTakePriority { let hasBeenEdited = _committedValue.producer - |> filter { $0.isEdit } - |> map { _ in () } + .filter { $0.isEdit } + .map { _ in () } defaults = defaults - |> takeUntil(hasBeenEdited) + .takeUntil(hasBeenEdited) } _committedValue <~ defaults @@ -49,31 +49,33 @@ public final class EditableProperty { self.init(defaultValue: ConstantProperty(defaultValue), editsTakePriority: true) } - deinit { - sendCompleted(validationErrorsSink) - } -} - -extension EditableProperty: MutablePropertyType { public var value: Value { get { return _committedValue.value.value } set(value) { - _committedValue.value = .ExplicitUpdate(Box(value)) + _committedValue.value = .ExplicitUpdate(value) } } public var producer: SignalProducer { return _committedValue.producer - |> map { $0.value } + .map { $0.value } } -} -extension EditableProperty: SinkType { - public func put(value: Value) { - self.value = value + /// A signal that will send the property's changes over time, + /// then complete when the property has deinitialized. + public lazy var signal: Signal = { [unowned self] in + var extractedSignal: Signal! + self.producer.startWithSignal { signal, _ in + extractedSignal = signal + } + return extractedSignal + }() + + deinit { + validationErrorsSink.sendCompleted() } } @@ -90,37 +92,37 @@ extension EditableProperty: SinkType { /// property. public func <~ (property: EditableProperty, editor: Editor) -> Disposable { let validatedEdits = editor.edits - |> map(liftSignal) + .map(liftSignal) // We only care about the latest edit. - |> flatMap(FlattenStrategy.Latest) { [weak property] editSession -> SignalProducer in + .flatMap(FlattenStrategy.Latest) { [weak property] editSession -> SignalProducer in let sessionCompleted: SignalProducer<(), NoError> = editSession - |> then(.empty) - |> catch { _ in .empty } + .then(.empty) + .flatMapError { _ in .empty } let committedValues = (property?._committedValue.producer ?? .empty) - |> promoteErrors(ValidationError.self) - |> takeUntil(sessionCompleted) + .promoteErrors(ValidationError.self) + .takeUntil(sessionCompleted) return combineLatest(committedValues, editSession) // We only care about the result of merging the latest values. - |> flatMap(.Latest) { committed, proposed in + .flatMap(FlattenStrategy.Latest) { committed, proposed in return editor.mergeCommittedValue(committed, intoProposedValue: proposed) } // Wait until validation completes, then use the final value for // the property's value. If the signal never sends anything, // don't update the property. - |> takeLast(1) + .takeLast(1) // If interrupted or errored, just complete (to cancel the edit). - |> ignoreInterruption - |> catch { error in + .ignoreInterruption() + .flatMapError { error in if let property = property { - sendNext(property.validationErrorsSink, error) + property.validationErrorsSink.sendNext(error) } return .empty } } - |> map { Committed.ValidatedEdit(Box($0), editor) } + .map { Committed.ValidatedEdit($0, editor) } return property._committedValue <~ validatedEdits } @@ -136,18 +138,26 @@ private func liftSignal(signal: Signal) -> SignalProducer(signal: Signal) -> Signal { - return Signal { observer in - return signal.observe(Signal.Observer { event in - switch event { - case .Interrupted: - sendCompleted(observer) - - default: - observer.put(event) +private extension Signal { + /// Ignores any Interrupted event on the input signal, translating it to + /// Completed instead. + func ignoreInterruption() -> Signal { + return Signal { observer in + return self.observe { event in + switch event { + case .Interrupted: + observer.sendCompleted() + + default: + observer.action(event) + } } - }) + } } } + +private extension SignalProducer { + func ignoreInterruption() -> SignalProducer { + return lift { $0.ignoreInterruption() } + } +} \ No newline at end of file diff --git a/EditableProperty/Editor.swift b/EditableProperty/Editor.swift index e481e01..19f27e4 100644 --- a/EditableProperty/Editor.swift +++ b/EditableProperty/Editor.swift @@ -1,4 +1,5 @@ import ReactiveCocoa +import Result /// Represents an editor that can propose changes to properties, and then commit /// those changes when editing has completed. diff --git a/EditableProperty/Info.plist b/EditableProperty/Info.plist index 1a67194..4b3a120 100644 --- a/EditableProperty/Info.plist +++ b/EditableProperty/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/EditablePropertyTests/EditablePropertySpec.swift b/EditablePropertyTests/EditablePropertySpec.swift index 08a6375..b95777f 100644 --- a/EditablePropertyTests/EditablePropertySpec.swift +++ b/EditablePropertyTests/EditablePropertySpec.swift @@ -8,8 +8,8 @@ import Nimble import Quick - import EditableProperty +import Result import ReactiveCocoa typealias TestEditor = Editor @@ -17,7 +17,8 @@ typealias TestEditor = Editor class EditablePropertySpec: QuickSpec { override func spec() { it("should do some binding magic") { - let defaultValue = MutableProperty(0) + let defaultValue + = MutableProperty(0) let property = EditableProperty(defaultValue: defaultValue, editsTakePriority: false) expect(property.value).to(equal(defaultValue.value)) @@ -34,13 +35,13 @@ class EditablePropertySpec: QuickSpec { let tryEdit: Int -> () = { proposed in let (editSignal, editSink) = TestEditor.EditSession.pipe() - sendNext(editsSink, editSignal) + editsSink.sendNext(editSignal) expect(property.value).to(equal(defaultValue.value)) - sendNext(editSink, proposed) + editSink.sendNext(proposed) expect(property.value).to(equal(defaultValue.value)) - sendCompleted(editSink) + editSink.sendCompleted() } tryEdit(2) diff --git a/EditablePropertyTests/Info.plist b/EditablePropertyTests/Info.plist index eeeaa04..ba72822 100644 --- a/EditablePropertyTests/Info.plist +++ b/EditablePropertyTests/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - org.ReactiveCocoa.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName