From d3bddcabb02b4b9230d495bec505139e16f6ffad Mon Sep 17 00:00:00 2001 From: touyu Date: Tue, 19 Mar 2019 18:26:38 +0900 Subject: [PATCH] Update some files --- FluxerKit.xcodeproj/project.pbxproj | 24 +++++++++++++----- FluxerKit/{ => Sources}/ActionSubject.swift | 0 .../{ => Sources}/AssociatedObjectStore.swift | 0 FluxerKit/{ => Sources}/Fluxer.swift | 0 FluxerKit/{ => Sources}/FluxerBindable.swift | 0 .../FluxerStoryboardBindable.swift | 16 ------------ FluxerKit/{ => Sources}/RecursiveLock.swift | 0 .../Sources/UIViewController+Extension.swift | 25 +++++++++++++++++++ 8 files changed, 43 insertions(+), 22 deletions(-) rename FluxerKit/{ => Sources}/ActionSubject.swift (100%) rename FluxerKit/{ => Sources}/AssociatedObjectStore.swift (100%) rename FluxerKit/{ => Sources}/Fluxer.swift (100%) rename FluxerKit/{ => Sources}/FluxerBindable.swift (100%) rename FluxerKit/{ => Sources}/FluxerStoryboardBindable.swift (78%) rename FluxerKit/{ => Sources}/RecursiveLock.swift (100%) create mode 100644 FluxerKit/Sources/UIViewController+Extension.swift diff --git a/FluxerKit.xcodeproj/project.pbxproj b/FluxerKit.xcodeproj/project.pbxproj index fac67d2..21aac25 100644 --- a/FluxerKit.xcodeproj/project.pbxproj +++ b/FluxerKit.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ D11AAD5922409FA100537CB0 /* RecursiveLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = D11AAD5822409FA100537CB0 /* RecursiveLock.swift */; }; D11AAD5B22409FB600537CB0 /* FluxerBindable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D11AAD5A22409FB600537CB0 /* FluxerBindable.swift */; }; D11AAD5D22409FF800537CB0 /* FluxerStoryboardBindable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D11AAD5C22409FF800537CB0 /* FluxerStoryboardBindable.swift */; }; + D11AAD842240ECBC00537CB0 /* UIViewController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D11AAD832240ECBC00537CB0 /* UIViewController+Extension.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -30,6 +31,7 @@ D11AAD5822409FA100537CB0 /* RecursiveLock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecursiveLock.swift; sourceTree = ""; }; D11AAD5A22409FB600537CB0 /* FluxerBindable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FluxerBindable.swift; sourceTree = ""; }; D11AAD5C22409FF800537CB0 /* FluxerStoryboardBindable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FluxerStoryboardBindable.swift; sourceTree = ""; }; + D11AAD832240ECBC00537CB0 /* UIViewController+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Extension.swift"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -65,14 +67,9 @@ D11AAD1F22409C4500537CB0 /* FluxerKit */ = { isa = PBXGroup; children = ( + D11AAD822240ECA200537CB0 /* Sources */, D11AAD2022409C4500537CB0 /* FluxerKit.h */, D11AAD2122409C4500537CB0 /* Info.plist */, - D11AAD4C22409D0100537CB0 /* Fluxer.swift */, - D11AAD5422409F7100537CB0 /* AssociatedObjectStore.swift */, - D11AAD5622409F8900537CB0 /* ActionSubject.swift */, - D11AAD5822409FA100537CB0 /* RecursiveLock.swift */, - D11AAD5A22409FB600537CB0 /* FluxerBindable.swift */, - D11AAD5C22409FF800537CB0 /* FluxerStoryboardBindable.swift */, ); path = FluxerKit; sourceTree = ""; @@ -86,6 +83,20 @@ name = Frameworks; sourceTree = ""; }; + D11AAD822240ECA200537CB0 /* Sources */ = { + isa = PBXGroup; + children = ( + D11AAD5622409F8900537CB0 /* ActionSubject.swift */, + D11AAD5422409F7100537CB0 /* AssociatedObjectStore.swift */, + D11AAD4C22409D0100537CB0 /* Fluxer.swift */, + D11AAD5A22409FB600537CB0 /* FluxerBindable.swift */, + D11AAD5C22409FF800537CB0 /* FluxerStoryboardBindable.swift */, + D11AAD5822409FA100537CB0 /* RecursiveLock.swift */, + D11AAD832240ECBC00537CB0 /* UIViewController+Extension.swift */, + ); + path = Sources; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -193,6 +204,7 @@ D11AAD5D22409FF800537CB0 /* FluxerStoryboardBindable.swift in Sources */, D11AAD5722409F8900537CB0 /* ActionSubject.swift in Sources */, D11AAD4D22409D0100537CB0 /* Fluxer.swift in Sources */, + D11AAD842240ECBC00537CB0 /* UIViewController+Extension.swift in Sources */, D11AAD5B22409FB600537CB0 /* FluxerBindable.swift in Sources */, D11AAD5922409FA100537CB0 /* RecursiveLock.swift in Sources */, ); diff --git a/FluxerKit/ActionSubject.swift b/FluxerKit/Sources/ActionSubject.swift similarity index 100% rename from FluxerKit/ActionSubject.swift rename to FluxerKit/Sources/ActionSubject.swift diff --git a/FluxerKit/AssociatedObjectStore.swift b/FluxerKit/Sources/AssociatedObjectStore.swift similarity index 100% rename from FluxerKit/AssociatedObjectStore.swift rename to FluxerKit/Sources/AssociatedObjectStore.swift diff --git a/FluxerKit/Fluxer.swift b/FluxerKit/Sources/Fluxer.swift similarity index 100% rename from FluxerKit/Fluxer.swift rename to FluxerKit/Sources/Fluxer.swift diff --git a/FluxerKit/FluxerBindable.swift b/FluxerKit/Sources/FluxerBindable.swift similarity index 100% rename from FluxerKit/FluxerBindable.swift rename to FluxerKit/Sources/FluxerBindable.swift diff --git a/FluxerKit/FluxerStoryboardBindable.swift b/FluxerKit/Sources/FluxerStoryboardBindable.swift similarity index 78% rename from FluxerKit/FluxerStoryboardBindable.swift rename to FluxerKit/Sources/FluxerStoryboardBindable.swift index 6c08697..a45af0f 100644 --- a/FluxerKit/FluxerStoryboardBindable.swift +++ b/FluxerKit/Sources/FluxerStoryboardBindable.swift @@ -7,7 +7,6 @@ // import RxSwift -import RxCocoa import UIKit public protocol FluxerStoryboardBindable: FluxerBindable {} @@ -51,18 +50,3 @@ extension FluxerStoryboardBindable { return (self as? UIViewController)?.isViewLoaded == false } } - -extension Reactive where Base: UIViewController { - var viewDidLoad: Observable { - return sentMessage(#selector(base.viewDidLoad)) - .map { _ in () } - .share(replay: 1) - } - - var viewDidLoadInvoked: Observable { - return methodInvoked(#selector(base.viewDidLoad)) - .map { _ in () } - .share(replay: 1) - } -} - diff --git a/FluxerKit/RecursiveLock.swift b/FluxerKit/Sources/RecursiveLock.swift similarity index 100% rename from FluxerKit/RecursiveLock.swift rename to FluxerKit/Sources/RecursiveLock.swift diff --git a/FluxerKit/Sources/UIViewController+Extension.swift b/FluxerKit/Sources/UIViewController+Extension.swift new file mode 100644 index 0000000..2c94ed0 --- /dev/null +++ b/FluxerKit/Sources/UIViewController+Extension.swift @@ -0,0 +1,25 @@ +// +// UIViewController+Extension.swift +// FluxerKit +// +// Created by Yuto Akiba on 2019/03/19. +// Copyright © 2019 Yuto Akiba. All rights reserved. +// + +import UIKit +import RxSwift +import RxCocoa + +extension Reactive where Base: UIViewController { + var viewDidLoad: Observable { + return sentMessage(#selector(base.viewDidLoad)) + .map { _ in () } + .share(replay: 1) + } + + var viewDidLoadInvoked: Observable { + return methodInvoked(#selector(base.viewDidLoad)) + .map { _ in () } + .share(replay: 1) + } +}