From b511562335ec8d7f4e056cb51e84720cd7486020 Mon Sep 17 00:00:00 2001 From: Niklas Holloh Date: Fri, 18 Oct 2019 19:52:00 +0200 Subject: [PATCH 1/8] Updated project to recommended settings (Xcode 11) --- Hanson.xcodeproj/project.pbxproj | 9 ++++++- .../xcshareddata/xcschemes/Hanson.xcscheme | 26 +++++++------------ 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Hanson.xcodeproj/project.pbxproj b/Hanson.xcodeproj/project.pbxproj index 93e0816..89b96f4 100644 --- a/Hanson.xcodeproj/project.pbxproj +++ b/Hanson.xcodeproj/project.pbxproj @@ -251,7 +251,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1100; ORGANIZATIONNAME = Blendle; TargetAttributes = { C8DBC71A1E3A47370028E936 = { @@ -271,6 +271,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = C8DBC7111E3A47370028E936; @@ -352,6 +353,7 @@ 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++"; @@ -361,6 +363,7 @@ 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_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -368,6 +371,7 @@ 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_RANGE_LOOP_ANALYSIS = YES; @@ -411,6 +415,7 @@ 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++"; @@ -420,6 +425,7 @@ 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_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -427,6 +433,7 @@ 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_RANGE_LOOP_ANALYSIS = YES; diff --git a/Hanson.xcodeproj/xcshareddata/xcschemes/Hanson.xcscheme b/Hanson.xcodeproj/xcshareddata/xcschemes/Hanson.xcscheme index 70d4226..ad2fb0f 100644 --- a/Hanson.xcodeproj/xcshareddata/xcschemes/Hanson.xcscheme +++ b/Hanson.xcodeproj/xcshareddata/xcschemes/Hanson.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -40,23 +48,11 @@ - - - - - - - - Date: Fri, 18 Oct 2019 19:52:27 +0200 Subject: [PATCH 2/8] Updated deprecated localization options --- Hanson.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Hanson.xcodeproj/project.pbxproj b/Hanson.xcodeproj/project.pbxproj index 89b96f4..389bb50 100644 --- a/Hanson.xcodeproj/project.pbxproj +++ b/Hanson.xcodeproj/project.pbxproj @@ -268,11 +268,11 @@ }; buildConfigurationList = C8DBC7151E3A47370028E936 /* Build configuration list for PBXProject "Hanson" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - English, en, + Base, ); mainGroup = C8DBC7111E3A47370028E936; productRefGroup = C8DBC71C1E3A47370028E936 /* Products */; From 1fc8dba46d758107d1569c9b8616927bd53ceabd Mon Sep 17 00:00:00 2001 From: Niklas Holloh Date: Fri, 18 Oct 2019 19:54:22 +0200 Subject: [PATCH 3/8] Fixed compiler warnings about redundant public modifiers --- Hanson/Bindable/CustomBindable.swift | 4 ++-- Hanson/Event Publisher/EventPublisher.swift | 10 +++++----- Hanson/Helpers/NSRecursiveLock+Helpers.swift | 2 +- Hanson/Observable/DynamicObservable.swift | 2 +- Hanson/Observable/NotificationObservable.swift | 2 +- Hanson/Observation Manager/Observer.swift | 8 ++++---- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Hanson/Bindable/CustomBindable.swift b/Hanson/Bindable/CustomBindable.swift index 7297b41..3082021 100644 --- a/Hanson/Bindable/CustomBindable.swift +++ b/Hanson/Bindable/CustomBindable.swift @@ -56,7 +56,7 @@ public extension ObservationManager { /// - setter: The setter that is invoked to change the wrapped variable's value. /// - Returns: The observation that has been created. @discardableResult - public func bind(_ eventPublisher: E, to target: Target, setter: @escaping CustomBindable.Setter) -> Observation { + func bind(_ eventPublisher: E, to target: Target, setter: @escaping CustomBindable.Setter) -> Observation { let customBindable = CustomBindable(target: target, setter: setter) let observation = bind(eventPublisher, to: customBindable) @@ -76,7 +76,7 @@ public extension Observer { /// - setter: The setter that is invoked to change the wrapped variable's value. /// - Returns: The observation that has been created. @discardableResult - public func bind(_ eventPublisher: E, to target: Target, setter: @escaping CustomBindable.Setter) -> Observation { + func bind(_ eventPublisher: E, to target: Target, setter: @escaping CustomBindable.Setter) -> Observation { return observationManager.bind(eventPublisher, to: target, setter: setter) } diff --git a/Hanson/Event Publisher/EventPublisher.swift b/Hanson/Event Publisher/EventPublisher.swift index 8a61f9c..d50f437 100644 --- a/Hanson/Event Publisher/EventPublisher.swift +++ b/Hanson/Event Publisher/EventPublisher.swift @@ -49,7 +49,7 @@ public protocol EventPublisher: class { public extension EventPublisher { - public func publish(_ event: Event) { + func publish(_ event: Event) { lock.lock() defer { lock.unlock() } @@ -59,7 +59,7 @@ public extension EventPublisher { } @discardableResult - public func addEventHandler(_ eventHandler: @escaping EventHandler) -> EventHandlerToken { + func addEventHandler(_ eventHandler: @escaping EventHandler) -> EventHandlerToken { lock.lock() defer { lock.unlock() } @@ -71,11 +71,11 @@ public extension EventPublisher { return eventHandlerToken } - public func didAddEventHandler() { + func didAddEventHandler() { } - public func removeEventHandler(with eventHandlerToken: EventHandlerToken) { + func removeEventHandler(with eventHandlerToken: EventHandlerToken) { lock.lock() defer { lock.unlock() } @@ -84,7 +84,7 @@ public extension EventPublisher { didRemoveEventHandler() } - public func didRemoveEventHandler() { + func didRemoveEventHandler() { } diff --git a/Hanson/Helpers/NSRecursiveLock+Helpers.swift b/Hanson/Helpers/NSRecursiveLock+Helpers.swift index 62b2251..bb5e2e0 100644 --- a/Hanson/Helpers/NSRecursiveLock+Helpers.swift +++ b/Hanson/Helpers/NSRecursiveLock+Helpers.swift @@ -13,7 +13,7 @@ internal extension NSRecursiveLock { /// Initializes the recursive lock. /// /// - Parameter name: The name associated with the lock. - internal convenience init(_ name: String) { + convenience init(_ name: String) { self.init() self.name = name diff --git a/Hanson/Observable/DynamicObservable.swift b/Hanson/Observable/DynamicObservable.swift index c17f03d..a2e3b1d 100644 --- a/Hanson/Observable/DynamicObservable.swift +++ b/Hanson/Observable/DynamicObservable.swift @@ -129,7 +129,7 @@ public extension NSObject { /// - type: The type of the property to observe. /// - shouldRetainTarget: Whether or not the target should be retained while the dynamic observable is being observed. Defaults to true. /// - Returns: An initialized dynamic observable. - public func dynamicObservable(keyPath: String, type: Value.Type, shouldRetainTarget: Bool = true) -> DynamicObservable { + func dynamicObservable(keyPath: String, type: Value.Type, shouldRetainTarget: Bool = true) -> DynamicObservable { return DynamicObservable(target: self, keyPath: keyPath, type: type, shouldRetainTarget: shouldRetainTarget) } diff --git a/Hanson/Observable/NotificationObservable.swift b/Hanson/Observable/NotificationObservable.swift index 5ff6f68..f45ed3b 100644 --- a/Hanson/Observable/NotificationObservable.swift +++ b/Hanson/Observable/NotificationObservable.swift @@ -99,7 +99,7 @@ public extension NotificationCenter { /// - notificationName: The name of the notification to observe. /// - object: The object whose notifications should be observed, or nil if notifications from all senders should be observed. /// - Returns: A notification observable for the receiving notification center. - public func observable(for notificationName: Notification.Name, object: Any? = nil) -> NotificationObservable { + func observable(for notificationName: Notification.Name, object: Any? = nil) -> NotificationObservable { return NotificationObservable(notificationCenter: self, notificationName: notificationName, notificationObject: object) } diff --git a/Hanson/Observation Manager/Observer.swift b/Hanson/Observation Manager/Observer.swift index 2b9a55c..5ca4b10 100644 --- a/Hanson/Observation Manager/Observer.swift +++ b/Hanson/Observation Manager/Observer.swift @@ -25,7 +25,7 @@ public extension Observer { /// - eventHandler: The handler to invoke when an event is published. /// - Returns: The observation that has been created. @discardableResult - public func observe(_ eventPublisher: E, eventHandler: @escaping EventHandler) -> Observation { + func observe(_ eventPublisher: E, eventHandler: @escaping EventHandler) -> Observation { return observationManager.observe(eventPublisher, eventHandler: eventHandler) } @@ -36,19 +36,19 @@ public extension Observer { /// - bindable: The bindable to update with the value changes of the event publisher. /// - Returns: The observation that has been created. @discardableResult - public func bind(_ eventPublisher: E, to bindable: B) -> Observation where E.Value == B.Value { + func bind(_ eventPublisher: E, to bindable: B) -> Observation where E.Value == B.Value { return observationManager.bind(eventPublisher, to: bindable) } /// Removes an observation. /// /// - Parameter observation: The observation to remove. - public func unobserve(_ observation: Observation) { + func unobserve(_ observation: Observation) { observationManager.unobserve(observation) } /// Removes all observations. - public func unobserveAll() { + func unobserveAll() { observationManager.unobserveAll() } From c0829e3d12f277be87de6db25ab9ff4553361b42 Mon Sep 17 00:00:00 2001 From: Niklas Holloh Date: Fri, 18 Oct 2019 19:57:28 +0200 Subject: [PATCH 4/8] Updated travis.yml to use the xcode11 os image --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 36c4d0d..7ea77a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode10.2 +osx_image: xcode11 script: - ./script/cisetup From 96fbbb7286baf47185da63d94c0823c145bce5ba Mon Sep 17 00:00:00 2001 From: Niklas Holloh Date: Fri, 26 Jul 2019 09:59:35 +0200 Subject: [PATCH 5/8] Added support for using Observable as PropertyWrapper and tests --- Hanson.xcodeproj/project.pbxproj | 12 ++-- Hanson/Observable/Observable.swift | 15 ++++ .../ObservablePropertyWrapperTests.swift | 71 +++++++++++++++++++ 3 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 HansonTests/ObservablePropertyWrapperTests.swift diff --git a/Hanson.xcodeproj/project.pbxproj b/Hanson.xcodeproj/project.pbxproj index 389bb50..add5d76 100644 --- a/Hanson.xcodeproj/project.pbxproj +++ b/Hanson.xcodeproj/project.pbxproj @@ -30,6 +30,7 @@ C8DBC7631E3A4E2E0028E936 /* TestObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8DBC7611E3A4E2E0028E936 /* TestObject.swift */; }; C8DBC7641E3A4E2E0028E936 /* TestEventPublisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8DBC7621E3A4E2E0028E936 /* TestEventPublisher.swift */; }; C8EB01DC1E435A0F0036E3C9 /* CustomBindableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8EB01DB1E435A0F0036E3C9 /* CustomBindableTests.swift */; }; + E549103922EAE84100E08BB4 /* ObservablePropertyWrapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E549103822EAE84100E08BB4 /* ObservablePropertyWrapperTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -69,6 +70,7 @@ C8DBC7611E3A4E2E0028E936 /* TestObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestObject.swift; sourceTree = ""; }; C8DBC7621E3A4E2E0028E936 /* TestEventPublisher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestEventPublisher.swift; sourceTree = ""; }; C8EB01DB1E435A0F0036E3C9 /* CustomBindableTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomBindableTests.swift; sourceTree = ""; }; + E549103822EAE84100E08BB4 /* ObservablePropertyWrapperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ObservablePropertyWrapperTests.swift; path = ../../../../../../System/Volumes/Data/Users/niklasholloh/Development/github/Hanson/HansonTests/ObservablePropertyWrapperTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -174,12 +176,13 @@ isa = PBXGroup; children = ( C8DBC7601E3A4E2E0028E936 /* Helpers */, - C8DBC7541E3A4E170028E936 /* ObservationManagerTests.swift */, - C8DBC7531E3A4E170028E936 /* EventPublisherTests.swift */, - C8DBC7551E3A4E170028E936 /* ObservableTests.swift */, + C8EB01DB1E435A0F0036E3C9 /* CustomBindableTests.swift */, C8DBC7521E3A4E170028E936 /* DynamicObservableTests.swift */, + C8DBC7531E3A4E170028E936 /* EventPublisherTests.swift */, C8237A5D1ED82BBA003279DB /* NotificationObservableTests.swift */, - C8EB01DB1E435A0F0036E3C9 /* CustomBindableTests.swift */, + E549103822EAE84100E08BB4 /* ObservablePropertyWrapperTests.swift */, + C8DBC7551E3A4E170028E936 /* ObservableTests.swift */, + C8DBC7541E3A4E170028E936 /* ObservationManagerTests.swift */, C8DBC72B1E3A47370028E936 /* Info.plist */, ); path = HansonTests; @@ -335,6 +338,7 @@ C8DBC7641E3A4E2E0028E936 /* TestEventPublisher.swift in Sources */, C8DBC75B1E3A4E170028E936 /* ObservationManagerTests.swift in Sources */, C8DBC7631E3A4E2E0028E936 /* TestObject.swift in Sources */, + E549103922EAE84100E08BB4 /* ObservablePropertyWrapperTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Hanson/Observable/Observable.swift b/Hanson/Observable/Observable.swift index 5a8f3fc..b788705 100644 --- a/Hanson/Observable/Observable.swift +++ b/Hanson/Observable/Observable.swift @@ -10,6 +10,7 @@ import Foundation /// The `Observable` class represents a value that can be observed for changes. /// When changing the observable's value, the observable will publish a `ValueChange` event with the old and new value. +@propertyWrapper public class Observable: EventPublisher, Bindable { /// An alias for the event type that the observable publishes. @@ -22,8 +23,22 @@ public class Observable: EventPublisher, Bindable { _value = value } + /// Initializes the observable through a propertyWrapper's initial value assignment. + /// + /// - Parameter value: The observable's initial value. + public init(initialValue value: Value) { + _value = value + } + // MARK: Value + /// The wrapped value of the observable as accessed through the propertyWrapper. + /// When setting this to a new value, the observable will publish a `ValueChange` event with the old and new value. + public var wrappedValue: Value { + get { return value } + set { value = newValue } + } + /// The value of the observable. When setting this to a new value, the observable will publish a `ValueChange` event with the old and new value. public var value: Value { get { diff --git a/HansonTests/ObservablePropertyWrapperTests.swift b/HansonTests/ObservablePropertyWrapperTests.swift new file mode 100644 index 0000000..293b219 --- /dev/null +++ b/HansonTests/ObservablePropertyWrapperTests.swift @@ -0,0 +1,71 @@ +// +// ObservablePropertyWrapperTests.swift +// HansonTests +// +// Created by Niklas Holloh on 26.07.19. +// Copyright © 2019 Blendle. All rights reserved. +// + +import XCTest +@testable import Hanson + +class ObservablePropertyWrapperTests: XCTestCase { + + @Observable var value = "Hello World" + + func testObservingValue() { + var lastEvent: ValueChange! + _value.addEventHandler { event in + lastEvent = event + } + + // Verify that changing the value publishes an event with the old and new value. + value = "New Value" + XCTAssertEqual(lastEvent.oldValue, "Hello World") + XCTAssertEqual(lastEvent.newValue, "New Value") + + value = "Some Other Value" + XCTAssertEqual(lastEvent.oldValue, "New Value") + XCTAssertEqual(lastEvent.newValue, "Some Other Value") + } + + func testSilentlyUpdatingValue() { + var lastEvent: ValueChange! + _value.addEventHandler { event in + lastEvent = event + } + + // Verify that changing the value works via the silently update function. + _value.silentlyUpdateValue(to: "New Value") + XCTAssertEqual(value, "New Value") + + // Verify that no event has been published. + XCTAssertNil(lastEvent) + + } + + func testUpdatingValueOnMultipleQueues() { + var numberOfEvents = 0 + _value.addEventHandler { _ in + numberOfEvents += 1 + } + + // Update the value 100 times on different queues. + for i in 0..<100 { + let valueExpectation = expectation(description: "Updated value") + + let queue = DispatchQueue(label: "com.blendle.hanson.tests.observable.queue\(i)") + queue.async { + self.value = "New Value" + + valueExpectation.fulfill() + } + } + + waitForExpectations(timeout: 10, handler: nil) + + // Verify that the value has been updated 100 times. + XCTAssertEqual(numberOfEvents, 100) + } + +} From 4c980cf3d79187b968780aa607c068b5d02626e6 Mon Sep 17 00:00:00 2001 From: Niklas Holloh Date: Fri, 18 Oct 2019 20:04:46 +0200 Subject: [PATCH 6/8] Fix for incorrect file path after cherry picking the propertyWrapper implementation --- Hanson.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Hanson.xcodeproj/project.pbxproj b/Hanson.xcodeproj/project.pbxproj index add5d76..20a2312 100644 --- a/Hanson.xcodeproj/project.pbxproj +++ b/Hanson.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 857451EC235A360500473D97 /* ObservablePropertyWrapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 857451EB235A360400473D97 /* ObservablePropertyWrapperTests.swift */; }; C8237A5C1ED82978003279DB /* NotificationObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8237A5B1ED82978003279DB /* NotificationObservable.swift */; }; C8237A5E1ED82BBA003279DB /* NotificationObservableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8237A5D1ED82BBA003279DB /* NotificationObservableTests.swift */; }; C8888E841E9CCA7C00803644 /* Bindable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8888E741E9CCA7C00803644 /* Bindable.swift */; }; @@ -30,7 +31,6 @@ C8DBC7631E3A4E2E0028E936 /* TestObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8DBC7611E3A4E2E0028E936 /* TestObject.swift */; }; C8DBC7641E3A4E2E0028E936 /* TestEventPublisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8DBC7621E3A4E2E0028E936 /* TestEventPublisher.swift */; }; C8EB01DC1E435A0F0036E3C9 /* CustomBindableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8EB01DB1E435A0F0036E3C9 /* CustomBindableTests.swift */; }; - E549103922EAE84100E08BB4 /* ObservablePropertyWrapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E549103822EAE84100E08BB4 /* ObservablePropertyWrapperTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -44,6 +44,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 857451EB235A360400473D97 /* ObservablePropertyWrapperTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ObservablePropertyWrapperTests.swift; sourceTree = ""; }; C8237A5B1ED82978003279DB /* NotificationObservable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationObservable.swift; sourceTree = ""; }; C8237A5D1ED82BBA003279DB /* NotificationObservableTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationObservableTests.swift; sourceTree = ""; }; C8888E741E9CCA7C00803644 /* Bindable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Bindable.swift; sourceTree = ""; }; @@ -70,7 +71,6 @@ C8DBC7611E3A4E2E0028E936 /* TestObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestObject.swift; sourceTree = ""; }; C8DBC7621E3A4E2E0028E936 /* TestEventPublisher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestEventPublisher.swift; sourceTree = ""; }; C8EB01DB1E435A0F0036E3C9 /* CustomBindableTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomBindableTests.swift; sourceTree = ""; }; - E549103822EAE84100E08BB4 /* ObservablePropertyWrapperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ObservablePropertyWrapperTests.swift; path = ../../../../../../System/Volumes/Data/Users/niklasholloh/Development/github/Hanson/HansonTests/ObservablePropertyWrapperTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -180,7 +180,7 @@ C8DBC7521E3A4E170028E936 /* DynamicObservableTests.swift */, C8DBC7531E3A4E170028E936 /* EventPublisherTests.swift */, C8237A5D1ED82BBA003279DB /* NotificationObservableTests.swift */, - E549103822EAE84100E08BB4 /* ObservablePropertyWrapperTests.swift */, + 857451EB235A360400473D97 /* ObservablePropertyWrapperTests.swift */, C8DBC7551E3A4E170028E936 /* ObservableTests.swift */, C8DBC7541E3A4E170028E936 /* ObservationManagerTests.swift */, C8DBC72B1E3A47370028E936 /* Info.plist */, @@ -338,7 +338,7 @@ C8DBC7641E3A4E2E0028E936 /* TestEventPublisher.swift in Sources */, C8DBC75B1E3A4E170028E936 /* ObservationManagerTests.swift in Sources */, C8DBC7631E3A4E2E0028E936 /* TestObject.swift in Sources */, - E549103922EAE84100E08BB4 /* ObservablePropertyWrapperTests.swift in Sources */, + 857451EC235A360500473D97 /* ObservablePropertyWrapperTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From b61678f2851dd63d6795be7031a9dd84b2904c2c Mon Sep 17 00:00:00 2001 From: Niklas Holloh Date: Fri, 18 Oct 2019 20:06:22 +0200 Subject: [PATCH 7/8] Fixed compiler warning about property wrapper init being renamed from init(initialValue:) to init(wrappedValue:) --- Hanson/Observable/Observable.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hanson/Observable/Observable.swift b/Hanson/Observable/Observable.swift index b788705..a8175c9 100644 --- a/Hanson/Observable/Observable.swift +++ b/Hanson/Observable/Observable.swift @@ -26,7 +26,7 @@ public class Observable: EventPublisher, Bindable { /// Initializes the observable through a propertyWrapper's initial value assignment. /// /// - Parameter value: The observable's initial value. - public init(initialValue value: Value) { + public init(wrappedValue value: Value) { _value = value } From b824f30bb86dc8f302554b92afe6e9091ce6ce56 Mon Sep 17 00:00:00 2001 From: Niklas Holloh Date: Fri, 18 Oct 2019 20:11:23 +0200 Subject: [PATCH 8/8] Switched from iPhone 7 test target to iPhone 11 as iPhone 7 with latest iOS is unavailable on travis with xcode11 image --- script/etc/config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/etc/config.sh b/script/etc/config.sh index 8805634..a412307 100644 --- a/script/etc/config.sh +++ b/script/etc/config.sh @@ -2,4 +2,4 @@ SDK=iphonesimulator PROJECT=Hanson.xcodeproj SCHEME=Hanson PLATFORM="iOS Simulator" -DEVICE="iPhone 7" +DEVICE="iPhone 11"