From b785b6abf9d3542995526da88d39a3ab14fb1d67 Mon Sep 17 00:00:00 2001 From: Vlad Alexa Date: Wed, 7 Dec 2016 16:46:48 +0000 Subject: [PATCH] TD-222 updated to swift 3, moved from carthage cocoapods --- Cartfile | 2 - Cartfile.resolved | 3 - .../Implementations/AnalyticEntities.swift | 6 +- .../Implementations/AppDependencies.swift | 12 +- .../TestAnalyticsReporter.swift | 8 +- .../Implementations/TestCrashReporter.swift | 10 +- .../Protocols/AnalyticsReporter.swift | 10 +- .../Protocols/AppDependenciesProtocol.swift | 4 +- .../Protocols/CrashReporter.swift | 6 +- .../Protocols/PreferencesInteractor.swift | 8 +- .../TDCAppDependenciesTests.swift | 2 +- TDCContentLoading/Model/Changeset.swift | 24 +-- TDCContentLoading/Model/PagedOutput.swift | 2 +- .../Protocols/ListLoadingContainer.swift | 4 +- .../Protocols/ListLoadingModel.swift | 4 +- .../ReactiveAppearanceViewController.swift | 28 +-- .../View Model/ContentLoadingViewModel.swift | 44 ++--- .../View Model/ListLoadingViewModel.swift | 6 +- .../PagedContentLoadingViewModel.swift | 10 +- .../TDCContentLoadingTests.swift | 2 +- .../TestContentLoadingModel.swift | 4 +- TheDistanceComponents.podspec | 34 ++++ .../project.pbxproj | 167 +++++++++++++----- .../xcschemes/TDCAppDependencies.xcscheme | 2 +- .../xcschemes/TDCContentLoading.xcscheme | 2 +- .../contents.xcworkspacedata | 10 ++ podfile | 35 ++++ 27 files changed, 302 insertions(+), 147 deletions(-) delete mode 100644 Cartfile delete mode 100644 Cartfile.resolved create mode 100644 TheDistanceComponents.podspec create mode 100644 TheDistanceComponents.xcworkspace/contents.xcworkspacedata create mode 100644 podfile diff --git a/Cartfile b/Cartfile deleted file mode 100644 index d9eb092..0000000 --- a/Cartfile +++ /dev/null @@ -1,2 +0,0 @@ -github "Quick/Nimble" ~> 4.0 -github "ReactiveCocoa/ReactiveCocoa" ~> 4.2.2 diff --git a/Cartfile.resolved b/Cartfile.resolved deleted file mode 100644 index b7c165f..0000000 --- a/Cartfile.resolved +++ /dev/null @@ -1,3 +0,0 @@ -github "Quick/Nimble" "v4.1.0" -github "antitypical/Result" "2.1.3" -github "ReactiveCocoa/ReactiveCocoa" "v4.2.2" diff --git a/TDCAppDependencies/Implementations/AnalyticEntities.swift b/TDCAppDependencies/Implementations/AnalyticEntities.swift index 0259f32..69e4cee 100644 --- a/TDCAppDependencies/Implementations/AnalyticEntities.swift +++ b/TDCAppDependencies/Implementations/AnalyticEntities.swift @@ -19,7 +19,7 @@ public struct AnalyticEvent: CustomStringConvertible, Equatable { public let label:String? /// Internal variable used to highlight the mutability implications of the addInfo(_:value:) and setUserInfo(_:) methods. - private var _userInfo = [String:Any]() + fileprivate var _userInfo = [String:Any]() /// Extra info specifc to this analytic event. public var userInfo:[String:Any] { @@ -56,7 +56,7 @@ public struct AnalyticEvent: CustomStringConvertible, Equatable { - parameter key: The key to which the value will be assigned. - parameter value: The value to be stored. */ - public mutating func addInfo(key:String, value:Any) { + public mutating func addInfo(_ key:String, value:Any) { _userInfo[key] = value } @@ -67,7 +67,7 @@ public struct AnalyticEvent: CustomStringConvertible, Equatable { - parameter info: The info to be set. */ - public mutating func setUserInfo(info:[String:Any]) { + public mutating func setUserInfo(_ info:[String:Any]) { _userInfo = info } diff --git a/TDCAppDependencies/Implementations/AppDependencies.swift b/TDCAppDependencies/Implementations/AppDependencies.swift index 864d2ea..407ed9e 100644 --- a/TDCAppDependencies/Implementations/AppDependencies.swift +++ b/TDCAppDependencies/Implementations/AppDependencies.swift @@ -9,7 +9,7 @@ import Foundation /// Class that can be overriden that implements the properties required for the `_AppDependencies` protocol. Adopts `PreferencesInteractor` and all of its default ipmlementations. -public class AppDependencies: AppDependenciesSingleton, PreferencesInteractor { +open class AppDependencies: AppDependenciesSingleton, PreferencesInteractor { /// The shared instance of an `AppDependenciesSingleton` or its subclass, whichever is referenced in execution first. This is achieved using `AppDependenciesSingleton`: a class that offers a singleton property that initialises as a subclass' type. This cannot be acheived in Swift, but can in Objective-C. static func shared() -> Self { @@ -26,26 +26,26 @@ public class AppDependencies: AppDependenciesSingleton, PreferencesInteractor { } /// The class that creates and returns `UIViewController`s for navigation. - public var viewLoader:ViewLoader? + open var viewLoader:ViewLoader? /// Global variable for reporting crash related information. - public var crashReporter:CrashReporter? { + open var crashReporter:CrashReporter? { didSet { crashReporter?.setupCrashReporting() } } /// Global variable for reporting analytics. - public var analyticsReporter:AnalyticsReporter? { + open var analyticsReporter:AnalyticsReporter? { didSet { analyticsReporter?.setupAnalytics() } } /// Global variable for querying the user's preferences for crash reporting and analytics. - public var preferencesInteractor:PreferencesInteractor? { + open var preferencesInteractor:PreferencesInteractor? { didSet { preferencesInteractor?.setDefaultPreferences() } } -} \ No newline at end of file +} diff --git a/TDCAppDependencies/Implementations/TestAnalyticsReporter.swift b/TDCAppDependencies/Implementations/TestAnalyticsReporter.swift index 3a0024f..a92607a 100644 --- a/TDCAppDependencies/Implementations/TestAnalyticsReporter.swift +++ b/TDCAppDependencies/Implementations/TestAnalyticsReporter.swift @@ -10,10 +10,10 @@ import Foundation final public class TestAnalyticsReporter:AnalyticsReporter { /// Internal variable for saving the events that are sent. - public private(set) var trackedEvents = [AnalyticEvent]() + public fileprivate(set) var trackedEvents = [AnalyticEvent]() /// Empty method for protocol conformance. - public func enableAnalytics(enable: Bool) { } + public func enableAnalytics(_ enable: Bool) { } /// Resets `tackedEvents` to an empty array. This can be called on `setup()` for any testing classes. public func setupAnalytics() { @@ -21,7 +21,7 @@ final public class TestAnalyticsReporter:AnalyticsReporter { } /// Appends the new `event` to `trackedEvents. If `asNewSession` is not `nil`, `trackedEvents` is cleared before the event is append to the array. The event has the session added as an info element with key `session`. - public func sendAnalytic(event: AnalyticEvent, asNewSession session: AnalyticSession? = nil) { + public func sendAnalytic(_ event: AnalyticEvent, asNewSession session: AnalyticSession? = nil) { // append the with new events. var toRecord = event @@ -35,4 +35,4 @@ final public class TestAnalyticsReporter:AnalyticsReporter { } public init() { } -} \ No newline at end of file +} diff --git a/TDCAppDependencies/Implementations/TestCrashReporter.swift b/TDCAppDependencies/Implementations/TestCrashReporter.swift index dd4da7d..58dfe2e 100644 --- a/TDCAppDependencies/Implementations/TestCrashReporter.swift +++ b/TDCAppDependencies/Implementations/TestCrashReporter.swift @@ -10,10 +10,10 @@ import Foundation final public class TestCrashReporter: CrashReporter { /// Internal variable for saving the log messages. - public private(set) var messages = [String]() + public fileprivate(set) var messages = [String]() /// Internal variable for saving non-fatal errors. - public private(set) var nonFatals = [NSError]() + public fileprivate(set) var nonFatals = [NSError]() /// Resets `messages` and `nonFatals` to empty arrays. This can be called on `setup()` for any testing classes. public func setupCrashReporting() { @@ -22,7 +22,7 @@ final public class TestCrashReporter: CrashReporter { } /// Appends `message` to the `messages` array. - public func logToCrashReport(message: String) { + public func logToCrashReport(_ message: String) { messages.append(message) } @@ -32,9 +32,9 @@ final public class TestCrashReporter: CrashReporter { } /// Appends `error` to the `nonFatals` array. - public func logNonFatalError(error: NSError) { + public func logNonFatalError(_ error: NSError) { nonFatals.append(error) } public init() { } -} \ No newline at end of file +} diff --git a/TDCAppDependencies/Protocols/AnalyticsReporter.swift b/TDCAppDependencies/Protocols/AnalyticsReporter.swift index e402f87..819b255 100644 --- a/TDCAppDependencies/Protocols/AnalyticsReporter.swift +++ b/TDCAppDependencies/Protocols/AnalyticsReporter.swift @@ -20,7 +20,7 @@ public protocol AnalyticSession { public protocol AnalyticsReporter { /// Should enable / disable further analytics from be sent. - func enableAnalytics(enable:Bool) + func enableAnalytics(_ enable:Bool) /// Should be called before any other analytics methods to set the default properties, such as tracking ids. func setupAnalytics() @@ -32,7 +32,7 @@ public protocol AnalyticsReporter { - parameter event: The event to send. - parameter session: If this value is not nil, this should begin a new analytics session with the given configuration, closing a previously opened session. This should be called whenever anyhting in the session configuration changes, e.g. user logs out / in. */ - func sendAnalytic(event:AnalyticEvent, asNewSession session:AnalyticSession?) + func sendAnalytic(_ event:AnalyticEvent, asNewSession session:AnalyticSession?) /** @@ -40,14 +40,14 @@ public protocol AnalyticsReporter { - parameter event: The event to send. */ - func sendAnalytic(event:AnalyticEvent) + func sendAnalytic(_ event:AnalyticEvent) } public extension AnalyticsReporter { /// Calls `sendAnalytic(_:asNewSession:)` without starting a new session. - public func sendAnalytic(event:AnalyticEvent){ + public func sendAnalytic(_ event:AnalyticEvent){ sendAnalytic(event, asNewSession: nil) } -} \ No newline at end of file +} diff --git a/TDCAppDependencies/Protocols/AppDependenciesProtocol.swift b/TDCAppDependencies/Protocols/AppDependenciesProtocol.swift index 72c867e..854c3ef 100644 --- a/TDCAppDependencies/Protocols/AppDependenciesProtocol.swift +++ b/TDCAppDependencies/Protocols/AppDependenciesProtocol.swift @@ -30,5 +30,5 @@ public protocol _AppDependencies { - parameter window: The window to add the root `UIViewController` to. */ - func installRootViewControllerIntoWindow(window:UIWindow) -} \ No newline at end of file + func installRootViewControllerIntoWindow(_ window:UIWindow) +} diff --git a/TDCAppDependencies/Protocols/CrashReporter.swift b/TDCAppDependencies/Protocols/CrashReporter.swift index d0bb192..3f32c1b 100644 --- a/TDCAppDependencies/Protocols/CrashReporter.swift +++ b/TDCAppDependencies/Protocols/CrashReporter.swift @@ -22,7 +22,7 @@ public protocol CrashReporter { - parameter message: The message to be appended to the crash report. */ - func logToCrashReport(message:String) + func logToCrashReport(_ message:String) /** @@ -30,6 +30,6 @@ public protocol CrashReporter { - parameter error: The error to report. */ - func logNonFatalError(error: NSError) + func logNonFatalError(_ error: NSError) -} \ No newline at end of file +} diff --git a/TDCAppDependencies/Protocols/PreferencesInteractor.swift b/TDCAppDependencies/Protocols/PreferencesInteractor.swift index 60d2769..835c743 100644 --- a/TDCAppDependencies/Protocols/PreferencesInteractor.swift +++ b/TDCAppDependencies/Protocols/PreferencesInteractor.swift @@ -37,17 +37,17 @@ public extension PreferencesInteractor { */ public func setDefaultPreferences() { let prefs = [EnableCrashReportingPreferenceKey: true, EnableAnalyticsPreferenceKey: true] - NSUserDefaults.standardUserDefaults().registerDefaults(prefs) + UserDefaults.standard.register(defaults: prefs) } /// Queries settings bundle with `EnableAnalyticsPreferenceKey`. public func canSendAnalytics() -> Bool { - return NSUserDefaults.standardUserDefaults().boolForKey(EnableAnalyticsPreferenceKey) + return UserDefaults.standard.bool(forKey: EnableAnalyticsPreferenceKey) } /// Queries settings bundle with `EnableCrashReportingPreferenceKey`. public func canSendCrashReports() -> Bool { - return NSUserDefaults.standardUserDefaults().boolForKey(EnableCrashReportingPreferenceKey) + return UserDefaults.standard.bool(forKey: EnableCrashReportingPreferenceKey) } -} \ No newline at end of file +} diff --git a/TDCAppDependenciesTests/TDCAppDependenciesTests.swift b/TDCAppDependenciesTests/TDCAppDependenciesTests.swift index d9aab9d..ea59f7c 100644 --- a/TDCAppDependenciesTests/TDCAppDependenciesTests.swift +++ b/TDCAppDependenciesTests/TDCAppDependenciesTests.swift @@ -28,7 +28,7 @@ class TDCAppDependenciesTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } } diff --git a/TDCContentLoading/Model/Changeset.swift b/TDCContentLoading/Model/Changeset.swift index c96d9ae..f6ea6ef 100755 --- a/TDCContentLoading/Model/Changeset.swift +++ b/TDCContentLoading/Model/Changeset.swift @@ -20,7 +20,7 @@ public protocol ContentEquatable: Equatable { - parameter other: The object to compare content against. - returns: `true` if the content of `other` is the same as the content of `self`, `false` otherwise. */ - @warn_unused_result + func contentMatches(other:Self) -> Bool } @@ -55,26 +55,26 @@ public struct Changeset { self.oldItems = oldItems self.newItems = newItems - deletions = oldItems.difference(newItems).map { item in - return Changeset.indexPathForIndex(oldItems.indexOf(item)!) + deletions = oldItems.difference(otherArray: newItems).map { item in + return Changeset.indexPathForIndex(index: oldItems.index(of: item)!) } - modifications = oldItems.intersection(newItems) + modifications = oldItems.intersection(otherArray: newItems) .filter({ item in - let newItem = newItems[newItems.indexOf(item)!] - return item.contentMatches(newItem) + let newItem = newItems[newItems.index(of: item)!] + return item.contentMatches(other: newItem) }) .map({ item in - return Changeset.indexPathForIndex(oldItems.indexOf(item)!) + return Changeset.indexPathForIndex(index: oldItems.index(of: item)!) }) - insertions = newItems.difference(oldItems).map { item in - return NSIndexPath(forRow: newItems.indexOf(item)!, inSection: 0) + insertions = newItems.difference(otherArray: oldItems).map { item in + return NSIndexPath(row: newItems.index(of: item)!, section: 0) } } private static func indexPathForIndex(index: Int) -> NSIndexPath { - return NSIndexPath(forRow: index, inSection: 0) + return NSIndexPath(row: index, section: 0) } } @@ -99,12 +99,12 @@ extension Changeset: ChangesetLoadingModel { /// `ListLoadingModel` conformance using `newItems` as an Array conforming to `ListLoadingModel`. public func numberOfEntitiesInSection(section:Int) -> Int { - return newItems.numberOfEntitiesInSection(section) + return newItems.numberOfEntitiesInSection(section: section) } /// `ListLoadingModel` conformance using `newItems` as an Array conforming to `ListLoadingModel`. public func entityForIndexPath(indexPath:NSIndexPath) -> ValueType? { - return newItems.entityForIndexPath(indexPath) + return newItems.entityForIndexPath(indexPath: indexPath) } /// - returns: The `newItems` as this represents the current content of this change. diff --git a/TDCContentLoading/Model/PagedOutput.swift b/TDCContentLoading/Model/PagedOutput.swift index ec83d3f..adcb4d0 100644 --- a/TDCContentLoading/Model/PagedOutput.swift +++ b/TDCContentLoading/Model/PagedOutput.swift @@ -40,7 +40,7 @@ extension PagedOutput: ChangesetLoadingModel { /// - returns: The number of objects in section 0. Paging sections is not yet implemented. public func totalNumberOfEntities() -> Int { - return numberOfEntitiesInSection(0) + return numberOfEntitiesInSection(section: 0) } /// - returns: The specific object for a given `NSIndexPath` from `currentContent`, or `nil` if the `indexPath.row` is above the count of objects in `currentContent`, this occurs if there is more content available. diff --git a/TDCContentLoading/Protocols/ListLoadingContainer.swift b/TDCContentLoading/Protocols/ListLoadingContainer.swift index 392ce81..554f108 100644 --- a/TDCContentLoading/Protocols/ListLoadingContainer.swift +++ b/TDCContentLoading/Protocols/ListLoadingContainer.swift @@ -35,11 +35,11 @@ public extension ListLoadingContainer { /// - returns: `numberOfEntitiesInSection(_:)` for the contained `ListLoadingModel`. public func numberOfEntitiesInSection(section: Int) -> Int { - return listLoadingModel.numberOfEntitiesInSection(section) + return listLoadingModel.numberOfEntitiesInSection(section: section) } /// - returns: `entityForIndexPath(_:)` as given by the contained `ListLoadingModel`. public func entityForIndexPath(indexPath: NSIndexPath) -> ModelType.ValueType? { - return listLoadingModel.entityForIndexPath(indexPath) + return listLoadingModel.entityForIndexPath(indexPath: indexPath) } } diff --git a/TDCContentLoading/Protocols/ListLoadingModel.swift b/TDCContentLoading/Protocols/ListLoadingModel.swift index b447f3f..eec4fd8 100644 --- a/TDCContentLoading/Protocols/ListLoadingModel.swift +++ b/TDCContentLoading/Protocols/ListLoadingModel.swift @@ -7,7 +7,7 @@ // import Foundation -import ReactiveCocoa +import ReactiveSwift import Result /** @@ -49,4 +49,4 @@ public protocol ChangesetLoadingModel: ListLoadingModel { /// Should return the current array of items that can populate the `Changeset`. func currentItems() -> [ValueType] -} \ No newline at end of file +} diff --git a/TDCContentLoading/ReactiveAppearanceViewController.swift b/TDCContentLoading/ReactiveAppearanceViewController.swift index ea654c0..59855a4 100644 --- a/TDCContentLoading/ReactiveAppearanceViewController.swift +++ b/TDCContentLoading/ReactiveAppearanceViewController.swift @@ -7,7 +7,7 @@ // import Foundation -import ReactiveCocoa +import ReactiveSwift import Result /// Enum sent from a `ReactiveAppearanceViewController` on view lifetime methods. This allows listening to when appearance events occur to allow for deep linking. @@ -42,52 +42,52 @@ public class ReactiveAppearanceViewController: UIViewController { public required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) - lifetimeObserver.sendNext(.Init) + lifetimeObserver.send(value: .Init) } /// Standard initialiser sending the `.Init` lifetime event to `lifetimeObserver`. - public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { + public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) - lifetimeObserver.sendNext(.Init) + lifetimeObserver.send(value: .Init) } /// Sends `.DidLoad` lifetime event to `lifetimeObserver`. public override func viewDidLoad() { super.viewDidLoad() - lifetimeObserver.sendNext(.DidLoad) + lifetimeObserver.send(value: .DidLoad) } /// Sends `.WillAppear` lifetime event to `lifetimeObserver`. - public override func viewWillAppear(animated: Bool) { + public override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - lifetimeObserver.sendNext(.WillAppear) + lifetimeObserver.send(value: .WillAppear) } /// Sends `.DidAppear` lifetime event to `lifetimeObserver`. - public override func viewDidAppear(animated: Bool) { + public override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - lifetimeObserver.sendNext(.DidAppear) + lifetimeObserver.send(value: .DidAppear) } /// Sends `.WillDisappear` lifetime event to `lifetimeObserver`. - public override func viewWillDisappear(animated: Bool) { + public override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) - lifetimeObserver.sendNext(.WillDisappear) + lifetimeObserver.send(value: .WillDisappear) } /// Sends `.DidDisappear` lifetime event to `lifetimeObserver`. - public override func viewDidDisappear(animated: Bool) { + public override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) - lifetimeObserver.sendNext(.DidDisappear) + lifetimeObserver.send(value: .DidDisappear) } deinit { lifetimeObserver.sendCompleted() } -} \ No newline at end of file +} diff --git a/TDCContentLoading/View Model/ContentLoadingViewModel.swift b/TDCContentLoading/View Model/ContentLoadingViewModel.swift index 88cbfad..fd31622 100644 --- a/TDCContentLoading/View Model/ContentLoadingViewModel.swift +++ b/TDCContentLoading/View Model/ContentLoadingViewModel.swift @@ -7,7 +7,7 @@ // import Foundation -import ReactiveCocoa +import ReactiveSwift import Result /** @@ -58,7 +58,7 @@ public class ContentLoadingViewModel { public let errorObserver: Observer /// Responds to the `refreshObserver`, chaining to a new `loadingProducerWithInput(_:)`. `Next` events are forwarded to the `contentChangesSignal` whilst errors are flattened out and forwarded to the `errorSignal`. - public let refreshSignal: SignalProducer + public let refreshSignal: Signal /// Assigned on `.Next` events of the `loadingProducerWithInput()`. public var loadedContent:OutputType? @@ -75,9 +75,12 @@ public class ContentLoadingViewModel { - parameter refreshFlattenStrategy: The `FlattenStrategy` applied to the `SignalProducer` returned from `loadingProducerWithInput(_:)`. */ - public init(lifetimeTrigger:ViewLifetime? = .WillAppear, refreshFlattenStrategy:FlattenStrategy = .Latest) { + public init(lifetimeTrigger:ViewLifetime? = .WillAppear, refreshFlattenStrategy:FlattenStrategy = .latest) { + + let (refreshSignal, refreshObserver) = Signal.pipe() + let replayedProducer = SignalProducer(signal: refreshSignal).replayLazily(upTo: 2) + replayedProducer.start() - let (refreshSignal, refreshObserver) = SignalProducer.buffer(2) self.refreshSignal = refreshSignal self.refreshObserver = refreshObserver @@ -96,28 +99,28 @@ public class ContentLoadingViewModel { }.map { _ in nil } .start(refreshObserver) } - - refreshSignal - .flatMap(refreshFlattenStrategy) { (input) -> SignalProducer in - - let p = self.loadingProducerWithInput(input) - .on(started: { self.isLoading.value = true }, terminated: { self.isLoading.value = false }) - .flatMapError({ (error) -> SignalProducer in - self.errorObserver.sendNext(error) - return SignalProducer.empty - }) - - return p - } - .observeOn(UIScheduler()) - .startWithNext { [weak self] (nextValue) in + + _ = refreshSignal.flatMap(refreshFlattenStrategy) { (input) -> SignalProducer in + + let p = self.loadingProducerWithInput(input: input) + .on(started: { self.isLoading.value = true }, terminated: { self.isLoading.value = false }) + .flatMapError({ (error) -> SignalProducer in + self.errorObserver.send(value: error) + return SignalProducer.empty + }) + + return p + } + _ = refreshSignal.observe(on: UIScheduler()) +/* + _ = refreshSignal.startWithNext { [weak self] (nextValue) in self?.loadedContent = nextValue if let obs = self?.contentChangesObserver { obs.sendNext(nextValue) } } - // merge the content change signals into a single signal for ContentLoadingState + // merge the content change signals into a single signal for ContentLoadingState let successStateSignal = contentChangesSignal .map { ContentLoadingState.Success($0) } @@ -143,6 +146,7 @@ public class ContentLoadingViewModel { stateObserver.sendCompleted() state <~ stateSignal.flatten(.Merge) +*/ } // MARK: Content Loading diff --git a/TDCContentLoading/View Model/ListLoadingViewModel.swift b/TDCContentLoading/View Model/ListLoadingViewModel.swift index 621552b..583b3ff 100644 --- a/TDCContentLoading/View Model/ListLoadingViewModel.swift +++ b/TDCContentLoading/View Model/ListLoadingViewModel.swift @@ -7,7 +7,7 @@ // import Foundation -import ReactiveCocoa +import ReactiveSwift /// Convenience subclass of `ContentLoadingViewModel` for `OutputType`s that conform to `ListLoadingModel`. This allows this class itself to conform to `ListLoadingModel`. public class ListLoadingViewModel: ContentLoadingViewModel, ListLoadingModel { @@ -40,12 +40,12 @@ public class ListLoadingViewModel: Content /// - returns: The number of objects in a given section from `loadedContent` or zero if `loadedContent` is `nil`. public func numberOfEntitiesInSection(section:Int) -> Int { - return loadedContent?.numberOfEntitiesInSection(section) ?? 0 + return loadedContent?.numberOfEntitiesInSection(section: section) ?? 0 } /// - returns: The specific object for a given `NSIndexPath` from `loadedContent`. public func entityForIndexPath(indexPath:NSIndexPath) -> ListType.ValueType? { - return loadedContent?.entityForIndexPath(indexPath) + return loadedContent?.entityForIndexPath(indexPath: indexPath) } diff --git a/TDCContentLoading/View Model/PagedContentLoadingViewModel.swift b/TDCContentLoading/View Model/PagedContentLoadingViewModel.swift index b73b86d..52b47cc 100644 --- a/TDCContentLoading/View Model/PagedContentLoadingViewModel.swift +++ b/TDCContentLoading/View Model/PagedContentLoadingViewModel.swift @@ -8,7 +8,7 @@ import Foundation -import ReactiveCocoa +import ReactiveSwift /** Subclass of `ContentLoadingViewModel` for loading paged content. This class handles the aggregation of the loaded content allowing subclasses to provide only the content for a given page. The current page and whether there is more content available is handled automatically. @@ -21,10 +21,10 @@ public class PagingContentLoadingViewModel: ListLoadingViewModel(25) /// Default initialiser passing the parameters through to `super`. - public override init(lifetimeTrigger: ViewLifetime? = .WillAppear, refreshFlattenStrategy: FlattenStrategy = .Latest) { + public override init(lifetimeTrigger: ViewLifetime? = .WillAppear, refreshFlattenStrategy: FlattenStrategy = .latest) { super.init(lifetimeTrigger: lifetimeTrigger, refreshFlattenStrategy: refreshFlattenStrategy) - pageCount.producer.combinePrevious(25).filter { $0 != $1 }.startWithNext { _ in self.refreshObserver.sendNext(false) } + pageCount.producer.combinePrevious(25).filter { $0 != $1 }.startWithValues { _ in self.refreshObserver.send(value: false) } } /** @@ -43,7 +43,7 @@ public class PagingContentLoadingViewModel: ListLoadingViewModel SignalProducer, NSError> { + override public func loadingProducerWithInput(input nextPage: Bool?) -> SignalProducer, NSError> { let page:UInt @@ -61,7 +61,7 @@ public class PagingContentLoadingViewModel: ListLoadingViewModel { }) }) } -} \ No newline at end of file +} diff --git a/TheDistanceComponents.podspec b/TheDistanceComponents.podspec new file mode 100644 index 0000000..ceda030 --- /dev/null +++ b/TheDistanceComponents.podspec @@ -0,0 +1,34 @@ +Pod::Spec.new do |s| + + s.name = "TheDistanceComponents" + s.version = "0.3" + s.summary = "Building Blocks for Great iOS Apps from The Distance." + s.homepage = "https://github.com/thedistance" + s.license = "MIT" + s.author = { "The Distance" => "dev@thedistance.co.uk" } + s.platform = :ios + s.source = { :git => "https://github.com/thedistance/TheDistanceComponents.git", :tag => "#{s.version}" } + + s.ios.deployment_target = "8.0" + + s.requires_arc = true + + s.module_name = "TDCAppDependencies" + + s.default_subspec = "TDCAppDependencies" + + s.subspec 'TDCContentLoading' do |cont| + cont.source_files = 'TDCContentLoading/**/*.swift' + cont.dependency 'ReactiveSwift', '~> 1.0.0-alpha.4' + cont.dependency 'Nimble' + #cont.dependency 'Result' + end + + s.subspec 'TDCAppDependencies' do |app| + app.source_files = 'TDCAppDependencies/**/*.{h,m,swift}' + app.dependency 'ReactiveSwift', '~> 1.0.0-alpha.4' + app.dependency 'Nimble' + #app.dependency 'Result' + end + +end diff --git a/TheDistanceComponents.xcodeproj/project.pbxproj b/TheDistanceComponents.xcodeproj/project.pbxproj index ac2aa5c..bf8d980 100644 --- a/TheDistanceComponents.xcodeproj/project.pbxproj +++ b/TheDistanceComponents.xcodeproj/project.pbxproj @@ -7,10 +7,9 @@ objects = { /* Begin PBXBuildFile section */ + 21A4692C787B0EC553F48395 /* Pods_TDCContentLoading.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F21966CCA64F69FD7A8F92EB /* Pods_TDCContentLoading.framework */; }; + 38CB5DDF0F3807C8B4559B4D /* Pods_TDCAppDependencies.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C2FCCAFE638B3FAFA4DBBA3 /* Pods_TDCAppDependencies.framework */; }; A54167461CF3A236002F4BA8 /* TestContentLoadingModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54167451CF3A236002F4BA8 /* TestContentLoadingModel.swift */; }; - A54167471CF3A264002F4BA8 /* ReactiveCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5501B521CF3652700022D04 /* ReactiveCocoa.framework */; }; - A54167481CF3A264002F4BA8 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5501B531CF3652700022D04 /* Result.framework */; }; - A541674A1CF3A286002F4BA8 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A54167491CF3A286002F4BA8 /* Nimble.framework */; }; A5501AD81CF361F100022D04 /* TDCAppDependencies.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5501ACE1CF361F100022D04 /* TDCAppDependencies.framework */; }; A5501ADD1CF361F100022D04 /* TDCAppDependenciesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5501ADC1CF361F100022D04 /* TDCAppDependenciesTests.swift */; }; A5501AF41CF361FD00022D04 /* TDCContentLoading.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5501AEA1CF361FD00022D04 /* TDCContentLoading.framework */; }; @@ -33,8 +32,6 @@ A5501B4E1CF362DE00022D04 /* PagedContentLoadingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5501B481CF362DE00022D04 /* PagedContentLoadingViewModel.swift */; }; A5501B4F1CF3634400022D04 /* TDCAppDependencies.h in Headers */ = {isa = PBXBuildFile; fileRef = A5501AD01CF361F100022D04 /* TDCAppDependencies.h */; settings = {ATTRIBUTES = (Public, ); }; }; A5501B511CF3640600022D04 /* ViewLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5501B501CF3640600022D04 /* ViewLoader.swift */; }; - A5501B571CF3657000022D04 /* ReactiveCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5501B521CF3652700022D04 /* ReactiveCocoa.framework */; }; - A5501B581CF3657000022D04 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5501B531CF3652700022D04 /* Result.framework */; }; A5501B5A1CF4458100022D04 /* ListLoadingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5501B591CF4458100022D04 /* ListLoadingViewModel.swift */; }; A5501B631CF44FFA00022D04 /* Array+Changeset.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5501B601CF44FFA00022D04 /* Array+Changeset.swift */; }; A5501B641CF44FFA00022D04 /* Changeset.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5501B611CF44FFA00022D04 /* Changeset.swift */; }; @@ -60,6 +57,11 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 11A59081F18C67E5F72BCA71 /* Pods-TDCContentLoading.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TDCContentLoading.release.xcconfig"; path = "Pods/Target Support Files/Pods-TDCContentLoading/Pods-TDCContentLoading.release.xcconfig"; sourceTree = ""; }; + 5A471BC41DF835F200044362 /* Pods_TDCContentLoading.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Pods_TDCContentLoading.framework; path = "../../Library/Developer/Xcode/DerivedData/TheDistanceComponents-cepijioqczlbryddybqjcvllcret/Build/Products/Debug-iphonesimulator/Pods_TDCContentLoading.framework"; sourceTree = ""; }; + 5C2FCCAFE638B3FAFA4DBBA3 /* Pods_TDCAppDependencies.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TDCAppDependencies.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 79AFFFDE9D96A38973A89044 /* Pods-TDCContentLoading.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TDCContentLoading.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TDCContentLoading/Pods-TDCContentLoading.debug.xcconfig"; sourceTree = ""; }; + 9B11E7AAD6CCFD745A517CE0 /* Pods-TDCAppDependencies.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TDCAppDependencies.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TDCAppDependencies/Pods-TDCAppDependencies.debug.xcconfig"; sourceTree = ""; }; A54167451CF3A236002F4BA8 /* TestContentLoadingModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestContentLoadingModel.swift; sourceTree = ""; }; A54167491CF3A286002F4BA8 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nimble.framework; path = Carthage/Build/iOS/Nimble.framework; sourceTree = ""; }; A5501ACE1CF361F100022D04 /* TDCAppDependencies.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TDCAppDependencies.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -98,6 +100,8 @@ A5501B611CF44FFA00022D04 /* Changeset.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Changeset.swift; sourceTree = ""; }; A5501B621CF44FFA00022D04 /* PagedOutput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PagedOutput.swift; sourceTree = ""; }; A5501B661CF4500900022D04 /* ContentLoadingState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentLoadingState.swift; sourceTree = ""; }; + F1C5E8FAEB71F8ED06EBC15B /* Pods-TDCAppDependencies.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TDCAppDependencies.release.xcconfig"; path = "Pods/Target Support Files/Pods-TDCAppDependencies/Pods-TDCAppDependencies.release.xcconfig"; sourceTree = ""; }; + F21966CCA64F69FD7A8F92EB /* Pods_TDCContentLoading.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TDCContentLoading.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -105,6 +109,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 38CB5DDF0F3807C8B4559B4D /* Pods_TDCAppDependencies.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -120,8 +125,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A5501B571CF3657000022D04 /* ReactiveCocoa.framework in Frameworks */, - A5501B581CF3657000022D04 /* Result.framework in Frameworks */, + 21A4692C787B0EC553F48395 /* Pods_TDCContentLoading.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -130,15 +134,23 @@ buildActionMask = 2147483647; files = ( A5501AF41CF361FD00022D04 /* TDCContentLoading.framework in Frameworks */, - A54167471CF3A264002F4BA8 /* ReactiveCocoa.framework in Frameworks */, - A54167481CF3A264002F4BA8 /* Result.framework in Frameworks */, - A541674A1CF3A286002F4BA8 /* Nimble.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 1F0AFC2F76FDA948D0321A34 /* Pods */ = { + isa = PBXGroup; + children = ( + 9B11E7AAD6CCFD745A517CE0 /* Pods-TDCAppDependencies.debug.xcconfig */, + F1C5E8FAEB71F8ED06EBC15B /* Pods-TDCAppDependencies.release.xcconfig */, + 79AFFFDE9D96A38973A89044 /* Pods-TDCContentLoading.debug.xcconfig */, + 11A59081F18C67E5F72BCA71 /* Pods-TDCContentLoading.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; A5501A7B1CF35F7700022D04 = { isa = PBXGroup; children = ( @@ -148,6 +160,7 @@ A5501AEB1CF361FD00022D04 /* TDCContentLoading */, A5501AF71CF361FD00022D04 /* TDCContentLoadingTests */, A5501A861CF35F7700022D04 /* Products */, + 1F0AFC2F76FDA948D0321A34 /* Pods */, ); sourceTree = ""; }; @@ -253,9 +266,12 @@ A5501B561CF3652B00022D04 /* Frameworks */ = { isa = PBXGroup; children = ( + 5A471BC41DF835F200044362 /* Pods_TDCContentLoading.framework */, A54167491CF3A286002F4BA8 /* Nimble.framework */, A5501B521CF3652700022D04 /* ReactiveCocoa.framework */, A5501B531CF3652700022D04 /* Result.framework */, + 5C2FCCAFE638B3FAFA4DBBA3 /* Pods_TDCAppDependencies.framework */, + F21966CCA64F69FD7A8F92EB /* Pods_TDCContentLoading.framework */, ); name = Frameworks; sourceTree = ""; @@ -297,10 +313,12 @@ isa = PBXNativeTarget; buildConfigurationList = A5501ADF1CF361F100022D04 /* Build configuration list for PBXNativeTarget "TDCAppDependencies" */; buildPhases = ( + 7F3FDE908F7E7C9AF74CE3E7 /* [CP] Check Pods Manifest.lock */, A5501AC91CF361F100022D04 /* Sources */, A5501ACA1CF361F100022D04 /* Frameworks */, A5501ACB1CF361F100022D04 /* Headers */, A5501ACC1CF361F100022D04 /* Resources */, + 354BBFD23971581741E0FCA6 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -333,10 +351,12 @@ isa = PBXNativeTarget; buildConfigurationList = A5501AFB1CF361FD00022D04 /* Build configuration list for PBXNativeTarget "TDCContentLoading" */; buildPhases = ( + B9752D034F4CCF2055A70984 /* [CP] Check Pods Manifest.lock */, A5501AE51CF361FD00022D04 /* Sources */, A5501AE61CF361FD00022D04 /* Frameworks */, A5501AE71CF361FD00022D04 /* Headers */, A5501AE81CF361FD00022D04 /* Resources */, + E556C10A4EB07CE50A1BFB6F /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -373,16 +393,16 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0730; + LastUpgradeCheck = 0810; ORGANIZATIONNAME = "The Distance"; TargetAttributes = { A5501ACD1CF361F100022D04 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0810; }; A5501AD61CF361F100022D04 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0810; }; A5501AE91CF361FD00022D04 = { CreatedOnToolsVersion = 7.3.1; @@ -446,6 +466,36 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 354BBFD23971581741E0FCA6 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TDCAppDependencies/Pods-TDCAppDependencies-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 7F3FDE908F7E7C9AF74CE3E7 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; A541674B1CF3A7A2002F4BA8 /* Carthage Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -463,6 +513,36 @@ shellPath = /bin/sh; shellScript = "/usr/local/bin/carthage copy-frameworks"; }; + B9752D034F4CCF2055A70984 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + E556C10A4EB07CE50A1BFB6F /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TDCContentLoading/Pods-TDCContentLoading-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -548,8 +628,10 @@ 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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -577,6 +659,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0.1; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -597,8 +680,10 @@ 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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -618,6 +703,8 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.3; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0.1; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -627,15 +714,14 @@ }; A5501AE01CF361F100022D04 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 9B11E7AAD6CCFD745A517CE0 /* Pods-TDCAppDependencies.debug.xcconfig */; buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = TDCAppDependencies/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -643,21 +729,20 @@ PRODUCT_BUNDLE_IDENTIFIER = uk.co.thedistance.TDCAppDependencies; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 2.3; + SWIFT_VERSION = 3.0.1; }; name = Debug; }; A5501AE11CF361F100022D04 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = F1C5E8FAEB71F8ED06EBC15B /* Pods-TDCAppDependencies.release.xcconfig */; buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = TDCAppDependencies/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -665,7 +750,7 @@ PRODUCT_BUNDLE_IDENTIFIER = uk.co.thedistance.TDCAppDependencies; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 2.3; + SWIFT_VERSION = 3.0.1; }; name = Release; }; @@ -676,7 +761,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = uk.co.thedistance.TDCAppDependenciesTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 2.3; + SWIFT_VERSION = 3.0.1; }; name = Debug; }; @@ -687,22 +772,21 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = uk.co.thedistance.TDCAppDependenciesTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 2.3; + SWIFT_VERSION = 3.0.1; }; name = Release; }; A5501AFC1CF361FD00022D04 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 79AFFFDE9D96A38973A89044 /* Pods-TDCContentLoading.debug.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = TDCContentLoading/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -711,22 +795,21 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 2.3; + SWIFT_VERSION = 3.0.1; }; name = Debug; }; A5501AFD1CF361FD00022D04 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 11A59081F18C67E5F72BCA71 /* Pods-TDCContentLoading.release.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = TDCContentLoading/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -734,37 +817,31 @@ PRODUCT_BUNDLE_IDENTIFIER = uk.co.thedistance.TDCContentLoading; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 2.3; + SWIFT_VERSION = 3.0.1; }; name = Release; }; A5501AFF1CF361FD00022D04 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = TDCContentLoadingTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = uk.co.thedistance.TDCContentLoadingTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 2.3; + SWIFT_VERSION = 3.0.1; }; name = Debug; }; A5501B001CF361FD00022D04 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = TDCContentLoadingTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = uk.co.thedistance.TDCContentLoadingTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 2.3; + SWIFT_VERSION = 3.0.1; }; name = Release; }; diff --git a/TheDistanceComponents.xcodeproj/xcshareddata/xcschemes/TDCAppDependencies.xcscheme b/TheDistanceComponents.xcodeproj/xcshareddata/xcschemes/TDCAppDependencies.xcscheme index 980c6dd..5782186 100644 --- a/TheDistanceComponents.xcodeproj/xcshareddata/xcschemes/TDCAppDependencies.xcscheme +++ b/TheDistanceComponents.xcodeproj/xcshareddata/xcschemes/TDCAppDependencies.xcscheme @@ -1,6 +1,6 @@ + + + + + + diff --git a/podfile b/podfile new file mode 100644 index 0000000..3e64e6d --- /dev/null +++ b/podfile @@ -0,0 +1,35 @@ +# Master Pods Repo +source 'https://github.com/CocoaPods/Specs.git' + +# pod configuration +platform :ios, '8.0' +inhibit_all_warnings! +use_frameworks! + +# define +workspace 'TheDistanceComponents' +project 'TheDistanceComponents' + +# define groups of pods + +def core_pods + pod 'Nimble' + pod 'ReactiveSwift', '~> 1.0.0-alpha.4' +end + + +# set pods for each target + +target 'TDCAppDependencies' do + + core_pods + +end + +target 'TDCContentLoading' do + + core_pods + +end + +