diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index c80a764..273bedb 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -14,16 +14,5 @@ jobs: - name: Run StoryFlow tests run: | set -eo pipefail - xcodebuild test -scheme StoryFlow -destination "platform=iOS Simulator,name=iPhone 11" | xcpretty - - uses: codecov/codecov-action@v1 - test-iOS-12: - runs-on: macOS-latest - env: - DEVELOPER_DIR: /Applications/Xcode_10.3.app/Contents/Developer - steps: - - uses: actions/checkout@v1 - - name: Run StoryFlow tests on iOS 12 - run: | - set -eo pipefail - xcodebuild test -scheme StoryFlow -destination "platform=iOS Simulator,OS=12.4,name=iPhone 8" | xcpretty - + xcodebuild test -scheme StoryFlow -destination "platform=iOS Simulator,name=iPhone 13" | xcpretty + - uses: codecov/codecov-action@v1 \ No newline at end of file diff --git a/Sources/StoryFlow/Flow/ImplicitFlow/ImplicitFlow.swift b/Sources/StoryFlow/Flow/ImplicitFlow/ImplicitFlow.swift index 4bc8f2a..0e85f5d 100644 --- a/Sources/StoryFlow/Flow/ImplicitFlow/ImplicitFlow.swift +++ b/Sources/StoryFlow/Flow/ImplicitFlow/ImplicitFlow.swift @@ -16,8 +16,16 @@ extension Flow { private static func destination(for output: ValueAndType) -> UIViewController? { let (value, type) = OutputTransform.apply(output) - - for inType in inputRequiringTypes where oneOf(inType._inputType, contains: type) { + + let candidates = inputRequiringTypes.filter { oneOf($0._inputType, contains: type) } + let supers = candidates.compactMap { class_getSuperclass($0 as? AnyClass) } + + let remainingCandidates = candidates.filter { c in + let isSuper = supers.contains { s in s == (c as? AnyClass) } + return !isSuper + } + + for inType in remainingCandidates { return inType._create(input: value) }