diff --git a/RxCocoa/Common/_RXKVOObserver.m b/RxCocoa/Common/_RXKVOObserver.m index a94d5993..965d1894 100644 --- a/RxCocoa/Common/_RXKVOObserver.m +++ b/RxCocoa/Common/_RXKVOObserver.m @@ -40,7 +40,9 @@ } -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - self.callback(change[NSKeyValueChangeNewKey]); + @synchronized(self) { + self.callback(change[NSKeyValueChangeNewKey]); + } } -(void)dispose { diff --git a/RxExample/RxExample.xcodeproj/project.pbxproj b/RxExample/RxExample.xcodeproj/project.pbxproj index f81bfc79..2ad924d9 100644 --- a/RxExample/RxExample.xcodeproj/project.pbxproj +++ b/RxExample/RxExample.xcodeproj/project.pbxproj @@ -145,6 +145,7 @@ C84CC58F1BDD486300E06A64 /* SynchronizedUnsubscribeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84CC56F1BDD08F500E06A64 /* SynchronizedUnsubscribeType.swift */; }; C84CC5901BDD486300E06A64 /* AsyncLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = C894642A1BC6C2B00055219D /* AsyncLock.swift */; }; C84CC5911BDD48B800E06A64 /* SubscriptionDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84CC5831BDD484400E06A64 /* SubscriptionDisposable.swift */; }; + C860ECAC1C42EACD00A664B3 /* SectionedViewDataSourceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C860ECAB1C42EACD00A664B3 /* SectionedViewDataSourceType.swift */; }; C864BAD71C3332F10083833C /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C864BAD11C3332F10083833C /* DetailViewController.swift */; }; C864BAD81C3332F10083833C /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C864BAD11C3332F10083833C /* DetailViewController.swift */; }; C864BAD91C3332F10083833C /* RandomUserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = C864BAD21C3332F10083833C /* RandomUserAPI.swift */; }; @@ -386,8 +387,8 @@ C8C4B4BF1C17724A00828BD5 /* _RXObjCRuntime.m in Sources */ = {isa = PBXBuildFile; fileRef = C8C4B4BD1C17724A00828BD5 /* _RXObjCRuntime.m */; }; C8C4B4CC1C17728200828BD5 /* MessageSentObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8C4B4CA1C17728200828BD5 /* MessageSentObserver.swift */; }; C8CCB8D41C2D5FBA000EDACC /* String+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8CCB8D31C2D5FBA000EDACC /* String+Rx.swift */; }; - C8D132151C42B54B00B59FFF /* UIImagePickerController+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D132141C42B54B00B59FFF /* UIImagePickerController+Rx.swift */; }; - C8D132161C42B54B00B59FFF /* UIImagePickerController+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D132141C42B54B00B59FFF /* UIImagePickerController+Rx.swift */; }; + C8D132151C42B54B00B59FFF /* UIImagePickerController+RxCreate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D132141C42B54B00B59FFF /* UIImagePickerController+RxCreate.swift */; }; + C8D132161C42B54B00B59FFF /* UIImagePickerController+RxCreate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D132141C42B54B00B59FFF /* UIImagePickerController+RxCreate.swift */; }; C8DF92CD1B0B2F84009BCF9A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8DF92C81B0B2F84009BCF9A /* AppDelegate.swift */; }; C8DF92DF1B0B328B009BCF9A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8DF92DE1B0B328B009BCF9A /* AppDelegate.swift */; }; C8DF92E31B0B32DA009BCF9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C8DF92E01B0B32DA009BCF9A /* LaunchScreen.xib */; }; @@ -685,6 +686,7 @@ C84CC56E1BDD08F500E06A64 /* SynchronizedSubscribeType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SynchronizedSubscribeType.swift; sourceTree = ""; }; C84CC56F1BDD08F500E06A64 /* SynchronizedUnsubscribeType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SynchronizedUnsubscribeType.swift; sourceTree = ""; }; C84CC5831BDD484400E06A64 /* SubscriptionDisposable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubscriptionDisposable.swift; sourceTree = ""; }; + C860ECAB1C42EACD00A664B3 /* SectionedViewDataSourceType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SectionedViewDataSourceType.swift; sourceTree = ""; }; C864BAD11C3332F10083833C /* DetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; C864BAD21C3332F10083833C /* RandomUserAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RandomUserAPI.swift; sourceTree = ""; }; C864BAD31C3332F10083833C /* String+extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+extensions.swift"; sourceTree = ""; }; @@ -903,7 +905,7 @@ C8C4B4BE1C17724A00828BD5 /* _RXObjCRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _RXObjCRuntime.h; sourceTree = ""; }; C8C4B4CA1C17728200828BD5 /* MessageSentObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MessageSentObserver.swift; sourceTree = ""; }; C8CCB8D31C2D5FBA000EDACC /* String+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Rx.swift"; sourceTree = ""; }; - C8D132141C42B54B00B59FFF /* UIImagePickerController+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImagePickerController+Rx.swift"; sourceTree = ""; }; + C8D132141C42B54B00B59FFF /* UIImagePickerController+RxCreate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImagePickerController+RxCreate.swift"; sourceTree = ""; }; C8DF92C81B0B2F84009BCF9A /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; C8DF92DE1B0B328B009BCF9A /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; C8DF92E01B0B32DA009BCF9A /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = ""; }; @@ -991,7 +993,7 @@ isa = PBXGroup; children = ( 8479BC701C3BCB9800FB8B54 /* ImagePickerController.swift */, - C8D132141C42B54B00B59FFF /* UIImagePickerController+Rx.swift */, + C8D132141C42B54B00B59FFF /* UIImagePickerController+RxCreate.swift */, ); path = ImagePicker; sourceTree = ""; @@ -1497,6 +1499,7 @@ C894650D1BC6C2BC0055219D /* Common */ = { isa = PBXGroup; children = ( + C860ECAB1C42EACD00A664B3 /* SectionedViewDataSourceType.swift */, C8C4B4BD1C17724A00828BD5 /* _RXObjCRuntime.m */, C8C4B4BE1C17724A00828BD5 /* _RXObjCRuntime.h */, C8BCD4011C14BFB7005F1280 /* NSLayoutConstraint+Rx.swift */, @@ -2083,6 +2086,7 @@ C864BADA1C3332F10083833C /* RandomUserAPI.swift in Sources */, C89464F61BC6C2B00055219D /* AnonymousObserver.swift in Sources */, C89464C81BC6C2B00055219D /* DistinctUntilChanged.swift in Sources */, + C860ECAC1C42EACD00A664B3 /* SectionedViewDataSourceType.swift in Sources */, C89464CF1BC6C2B00055219D /* Just.swift in Sources */, C8F6A1381BEF9DF6007DF367 /* RetryWhen.swift in Sources */, C89465921BC6C2BC0055219D /* UIControl+Rx.swift in Sources */, @@ -2297,7 +2301,7 @@ C89464EF1BC6C2B00055219D /* Observable+Debug.swift in Sources */, C89464E91BC6C2B00055219D /* Zip+CollectionType.swift in Sources */, CB883B511BE3AC54000AC2EE /* RefCountDisposable.swift in Sources */, - C8D132161C42B54B00B59FFF /* UIImagePickerController+Rx.swift in Sources */, + C8D132161C42B54B00B59FFF /* UIImagePickerController+RxCreate.swift in Sources */, C89465761BC6C2BC0055219D /* KVOObserver.swift in Sources */, C89464CA1BC6C2B00055219D /* Empty.swift in Sources */, C803973B1BD3E17D009D8B26 /* ActivityIndicator.swift in Sources */, @@ -2401,7 +2405,7 @@ C86E2F471AE5A0CA00C31024 /* WikipediaSearchResult.swift in Sources */, C8984CD11C36BC3E001E4272 /* NumberCell.swift in Sources */, C8A2A2C81B4049E300F11F09 /* PseudoRandomGenerator.swift in Sources */, - C8D132151C42B54B00B59FFF /* UIImagePickerController+Rx.swift in Sources */, + C8D132151C42B54B00B59FFF /* UIImagePickerController+RxCreate.swift in Sources */, C8984CD51C36BC3E001E4272 /* PartialUpdatesViewController.swift in Sources */, 8479BC721C3BDAD400FB8B54 /* ImagePickerController.swift in Sources */, C864BAE11C3332F10083833C /* User.swift in Sources */, diff --git a/RxExample/RxExample.xcodeproj/xcshareddata/xcschemes/RxExample-iOS.xcscheme b/RxExample/RxExample.xcodeproj/xcshareddata/xcschemes/RxExample-iOS.xcscheme index 5bf374d8..774c9f84 100644 --- a/RxExample/RxExample.xcodeproj/xcshareddata/xcschemes/RxExample-iOS.xcscheme +++ b/RxExample/RxExample.xcodeproj/xcshareddata/xcschemes/RxExample-iOS.xcscheme @@ -52,7 +52,7 @@