Skip to content

Commit

Permalink
Xcode 10.2 Swift 5
Browse files Browse the repository at this point in the history
  • Loading branch information
ekazaev committed Apr 4, 2019
1 parent 8ed5e1f commit ce822c4
Show file tree
Hide file tree
Showing 17 changed files with 1,175 additions and 1,173 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ before_install:
- pod install --project-directory=Example
script:
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/RouteComposer.xcworkspace -scheme RouteComposer-Example -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone X,OS=12.1' ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint --allow-warnings
- pod lib lint
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- RouteComposer (1.3.4)
- RouteComposer (1.5.0)

DEPENDENCIES:
- RouteComposer (from `../`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
RouteComposer: 2379ff5f6e66016b27a2523d73f693536eb350ca
RouteComposer: 2e3a290122f0ef9926bdec015297c73ad01c721c

PODFILE CHECKSUM: 42df1440502a2c666dc2402d2027b25de2a00f46

Expand Down
5 changes: 2 additions & 3 deletions Example/Pods/Local Podspecs/RouteComposer.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2,279 changes: 1,145 additions & 1,134 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Example/RouteComposer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand Down Expand Up @@ -1097,7 +1097,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -260,6 +261,7 @@
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -288,7 +290,6 @@
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -314,7 +315,6 @@
PRODUCT_BUNDLE_IDENTIFIER = ie.saks.ContainerViewController;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -264,6 +265,7 @@
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -292,7 +294,6 @@
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -318,7 +319,6 @@
PRODUCT_BUNDLE_IDENTIFIER = ie.saks.ImageDetailsController;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -264,6 +265,7 @@
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -292,7 +294,6 @@
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -318,7 +319,6 @@
PRODUCT_BUNDLE_IDENTIFIER = ie.saks.ImagesController;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
8 changes: 4 additions & 4 deletions Example/Tests/BoxTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class BoxTests: XCTestCase {
children.append(FactoryBox(EmptyFactory(), action: ActionBox(ViewControllerActions.NilAction()))!)

let resultChildren = try? box?.scrapeChildren(from: children)
XCTAssertEqual(resultChildren??.count, 1)
XCTAssertEqual(resultChildren?.count, 1)
XCTAssertEqual(box?.children.count, 2)
}

Expand All @@ -50,11 +50,11 @@ class BoxTests: XCTestCase {
children.append(FactoryBox(ClassNameFactory<UIViewController, Any?>(), action: ContainerActionBox(UINavigationController.push()))!)

let resultChildren = try? box?.scrapeChildren(from: children)
XCTAssertEqual(resultChildren??.count, 3)
XCTAssertEqual(resultChildren?.count, 3)
XCTAssertEqual(box?.children.count, 2)
XCTAssertTrue(resultChildren??.first! is ContainerFactoryBox<NavigationControllerFactory<Any?>>)
XCTAssertTrue(resultChildren?.first! is ContainerFactoryBox<NavigationControllerFactory<Any?>>)
XCTAssertTrue(box?.children.first!.factory is FactoryBox<ClassNameFactory<UIViewController, Any?>>)
XCTAssertTrue(resultChildren??.last! is FactoryBox<ClassNameFactory<UIViewController, Any?>>)
XCTAssertTrue(resultChildren?.last! is FactoryBox<ClassNameFactory<UIViewController, Any?>>)
}

func testNilInAssembly() {
Expand Down
5 changes: 0 additions & 5 deletions Example/Tests/FactoryTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ class FactoryTest: XCTestCase {
var buildCount = 0

class TestFactory: Factory {

typealias ViewController = UIViewController

typealias Context = Any?


typealias ViewController = UIViewController

Expand Down
5 changes: 0 additions & 5 deletions Example/Tests/Helpers/EmptyContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import UIKit
@testable import RouteComposer

struct EmptyContainer: SimpleContainerFactory {

typealias ViewController = UINavigationController

typealias Context = Any?


typealias ViewController = UINavigationController

Expand Down
5 changes: 0 additions & 5 deletions Example/Tests/RouterTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ class RouterTests: XCTestCase {

// Factory that produces TestViewController
struct TestViewControllerFactory: Factory {

typealias ViewController = TestViewController

typealias Context = Any?


typealias ViewController = TestViewController

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Release](https://img.shields.io/github/release/saksdirect/route-composer.svg?style=flat&color=darkcyan)](https://github.com/saksdirect/route-composer/releases)
[![Cocoapods](https://img.shields.io/cocoapods/v/RouteComposer.svg?style=flat)](http://cocoapods.org/pods/RouteComposer)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Swift 4.2](https://img.shields.io/badge/language-Swift4.2-orange.svg?style=flat)](https://developer.apple.com/swift)
[![Swift 5.0](https://img.shields.io/badge/language-Swift5.0-orange.svg?style=flat)](https://developer.apple.com/swift)
[![Platform iOS](https://img.shields.io/badge/platform-iOS-yellow.svg)](https://www.apple.com/ios)
[![Documentation](https://saksdirect.github.io/route-composer/badge.svg)](https://saksdirect.github.io/route-composer)
![Code coverage](https://img.shields.io/badge/code%20coverage-86%25-green.svg?style=flat)
Expand Down Expand Up @@ -48,6 +48,12 @@ it, simply add the following line to your Podfile:
pod 'RouteComposer'
```

**For XCode 10.1 / Swift 4.2 Support**

```ruby
pod 'RouteComposer', '~> 1.4'
```

And then run `pod install`.

Once successfully integrated, just add the following statement to any Swift file where you want to use RouteComposer:
Expand Down Expand Up @@ -409,6 +415,7 @@ Russian:

- [Композиция UIViewController-ов и навигация между ними](https://habr.com/post/421097/)
- [Примеры конфигурации UIViewController-ов используя RouteComposer](https://habr.com/post/428990/)
- [Проблемы паттерна Координатор и при чем тут RouteComposer](https://habr.com/ru/post/446550/)

## Author

Expand Down
2 changes: 1 addition & 1 deletion RouteComposer.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'RouteComposer'
s.version = '1.4.1'
s.version = '1.5.0'
s.summary = 'Protocol oriented library that helps to handle view controllers composition, navigation and deep linking tasks.'

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion RouteComposer/Classes/Assemblies/SwitchAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public final class SwitchAssembly<ViewController: UIViewController, Context> {
}

func resolve<C>(with context: C) -> RoutingStep? {
guard let viewController = try? finder?.findViewController(with: context), viewController != nil else {
guard (try? finder?.findViewController(with: context)) != nil else {
return nil
}
return step
Expand Down

0 comments on commit ce822c4

Please sign in to comment.