Skip to content

Commit

Permalink
Merge pull request #23 from saksdirect/feature/swift5
Browse files Browse the repository at this point in the history
Feature/swift5
  • Loading branch information
Eugene Kazaev authored Apr 5, 2019
2 parents ce0ea5e + 68a28f6 commit 1f7cabb
Show file tree
Hide file tree
Showing 116 changed files with 31,545 additions and 1,159 deletions.
5 changes: 5 additions & 0 deletions .slather.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
xcodeproj: ./Example/RouteComposer.xcodeproj
workspace: ./Example/RouteComposer.xcworkspace/
scheme: RouteComposer-Example
source_directory: ./RouteComposer/Classes
binary_basename: RouteComposer
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# references:
# * http://www.objc.io/issue-6/travis-ci.html
# * https://github.com/supermarin/xcpretty#usage
# *slather coverage --html --output-directory ./docs/tests --arch x86_64

osx_image: xcode10.2
language: swift
cache: cocoapods
podfile: Example/Podfile
before_install:
- gem install slather
- gem install cocoapods # Since Travis is not always on latest version
- 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
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/RouteComposer.xcworkspace -scheme RouteComposer-Example -sdk iphonesimulator -derivedDataPath ${TRAVIS_BUILD_DIR}/myDerivedData -destination 'platform=iOS Simulator,name=iPhone X,OS=12.2' ONLY_ACTIVE_ARCH=YES | xcpretty
- pod lib lint
after_success: slather coverage -t -b ${TRAVIS_BUILD_DIR}/myDerivedData --arch x86_64 --verbose
2 changes: 2 additions & 0 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
platform :ios, '9.3'
use_frameworks!

plugin 'slather'

target 'RouteComposer_Example' do
pod 'RouteComposer', :path => '../'

Expand Down
6 changes: 3 additions & 3 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,8 +9,8 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
RouteComposer: 2379ff5f6e66016b27a2523d73f693536eb350ca
RouteComposer: 2e3a290122f0ef9926bdec015297c73ad01c721c

PODFILE CHECKSUM: 42df1440502a2c666dc2402d2027b25de2a00f46
PODFILE CHECKSUM: 6dc3a094906d5a0f701bcb325869e4a05ad2ae57

COCOAPODS: 1.6.0
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.

6 changes: 3 additions & 3 deletions Example/Pods/Manifest.lock

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

2,262 changes: 1,135 additions & 1,127 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.

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
3 changes: 1 addition & 2 deletions Example/Tests/ExtrasTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ class ExtrasTest: XCTestCase {
typealias DismissalTargetContext = Void
}

// This warning is here for the compability with the swift version 4.2 in XCode 10.1.
var viewController = DismissingViewController()
let viewController = DismissingViewController()
var wasInCompletion = false
viewController.dismissalBlock = { context, animated, completion in
wasInCompletion = true
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
[![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)
[![Code coverage](https://img.shields.io/badge/code%20coverage-83%25-green.svg?style=flat)](https://saksdirect.github.io/route-composer/tests/index.html)
[![MIT License](https://img.shields.io/cocoapods/l/RouteComposer.svg?style=flat)](https://github.com/saksdirect/RouteComposer/blob/master/LICENSE)
[![Twitter](https://img.shields.io/twitter/url/https/github.com/saksdirect/route-composer.svg?style=flat)](https://twitter.com/intent/tweet?text=Check%20it%20out:&url=https%3A%2F%2Fgithub.com%2Fsaksdirect%2Froute-composer)

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
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public struct DismissalMethodProvidingContextTask<VC: Dismissible, C>: ContextTa
}

public func apply(on viewController: VC, with context: C) throws {
// This warning is here for the compability with the swift version 4.2 in XCode 10.1.
var viewController = viewController
viewController.dismissalBlock = dismissalBlock
}

Expand Down
Loading

0 comments on commit 1f7cabb

Please sign in to comment.