diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/StoryFlow.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/StoryFlow.xcscheme new file mode 100644 index 0000000..40beab1 --- /dev/null +++ b/.swiftpm/xcode/xcshareddata/xcschemes/StoryFlow.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Package.swift b/Package.swift index e276ba2..a7d5fb3 100644 --- a/Package.swift +++ b/Package.swift @@ -1,26 +1,22 @@ -// swift-tools-version:5.0 -// The swift-tools-version declares the minimum version of Swift required to build this package. +// swift-tools-version:5.6 import PackageDescription let package = Package( name: "StoryFlow", platforms: [ .iOS(.v10), - ], products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. + ], + products: [ .library( name: "StoryFlow", targets: ["StoryFlow"]), ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( - name: "StoryFlow", - dependencies: []), + name: "StoryFlow"), + .testTarget( + name: "StoryFlowTests", + dependencies: ["StoryFlow"] + ) ] ) diff --git a/Sources/StoryFlow/Info.plist b/Sources/StoryFlow/Info.plist deleted file mode 100644 index 1007fd9..0000000 --- a/Sources/StoryFlow/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/Sources/StoryFlow/Interfaces/Helpers/Internal/FatalError.swift b/Sources/StoryFlow/Interfaces/Helpers/Internal/FatalError.swift index d1e8606..31a8434 100644 --- a/Sources/StoryFlow/Interfaces/Helpers/Internal/FatalError.swift +++ b/Sources/StoryFlow/Interfaces/Helpers/Internal/FatalError.swift @@ -1,7 +1,6 @@ import Foundation import UIKit -#if TESTING func fatalError(_ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line) -> Never { FatalErrorUtil.fatalErrorClosure(message(), file, line) } @@ -23,4 +22,3 @@ struct FatalErrorUtil { fatalErrorClosure = defaultFatalErrorClosure } } -#endif diff --git a/Sources/StoryFlow/StoryFlow.h b/Sources/StoryFlow/StoryFlow.h deleted file mode 100644 index 32f409c..0000000 --- a/Sources/StoryFlow/StoryFlow.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// StoryFlow.h -// StoryFlow -// -// Created by Domas on 16/05/2018. -// Copyright © 2018 Trafi. All rights reserved. -// - -#import - -//! Project version number for StoryFlow. -FOUNDATION_EXPORT double StoryFlowVersionNumber; - -//! Project version string for StoryFlow. -FOUNDATION_EXPORT const unsigned char StoryFlowVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - - diff --git a/StoryFlowTests/ContainerApp/Info.plist b/StoryFlowTests/ContainerApp/Info.plist deleted file mode 100644 index 703b90d..0000000 --- a/StoryFlowTests/ContainerApp/Info.plist +++ /dev/null @@ -1,39 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/StoryFlowTests/Info.plist b/StoryFlowTests/Info.plist deleted file mode 100644 index 6c40a6c..0000000 --- a/StoryFlowTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/StoryFlowTests/ContainerApp/AppDelegate.swift b/Tests/StoryFlowTests/ContainerApp/AppDelegate.swift similarity index 100% rename from StoryFlowTests/ContainerApp/AppDelegate.swift rename to Tests/StoryFlowTests/ContainerApp/AppDelegate.swift diff --git a/StoryFlowTests/ExplicitFlowTests.swift b/Tests/StoryFlowTests/ExplicitFlowTests.swift similarity index 96% rename from StoryFlowTests/ExplicitFlowTests.swift rename to Tests/StoryFlowTests/ExplicitFlowTests.swift index 7b505d2..762aeea 100644 --- a/StoryFlowTests/ExplicitFlowTests.swift +++ b/Tests/StoryFlowTests/ExplicitFlowTests.swift @@ -1,5 +1,5 @@ import XCTest -import StoryFlow +@testable import StoryFlow class ExplicitFlowTests: XCTestCase { @@ -216,13 +216,13 @@ class ExplicitFlowTests: XCTestCase { start.produce("") XCTAssert(currentVc.didAppear()) - (currentVc as! InStringOutIntDoubleFloat).produce(0 as Double) + (currentVc as? InStringOutIntDoubleFloat)?.produce(0 as Double) XCTAssert(currentVc.didAppear()) - (currentVc as! InDoubleOutFloat).produce(0) + (currentVc as? InDoubleOutFloat)?.produce(0) XCTAssert(currentVc.didAppear()) - (currentVc as! InFloatOutFloat).produce(3.14) + (currentVc as? InFloatOutFloat)?.produce(3.14) XCTAssert(currentVc.didDismiss()) // Assert diff --git a/StoryFlowTests/FailureTests.swift b/Tests/StoryFlowTests/FailureTests.swift similarity index 100% rename from StoryFlowTests/FailureTests.swift rename to Tests/StoryFlowTests/FailureTests.swift diff --git a/StoryFlowTests/Helpers.swift b/Tests/StoryFlowTests/Helpers.swift similarity index 98% rename from StoryFlowTests/Helpers.swift rename to Tests/StoryFlowTests/Helpers.swift index 39d48b9..86e99a2 100644 --- a/StoryFlowTests/Helpers.swift +++ b/Tests/StoryFlowTests/Helpers.swift @@ -47,7 +47,7 @@ extension UIViewController { extension XCTWaiter { func completed(description: String = #function, - timeout: TimeInterval = 1, + timeout: TimeInterval = 2, interval: TimeInterval = 0.002, condition: @escaping () -> Bool) -> Bool { diff --git a/StoryFlowTests/ImplicitFlowTests.swift b/Tests/StoryFlowTests/ImplicitFlowTests.swift similarity index 99% rename from StoryFlowTests/ImplicitFlowTests.swift rename to Tests/StoryFlowTests/ImplicitFlowTests.swift index a9b0214..dbb1aa2 100644 --- a/StoryFlowTests/ImplicitFlowTests.swift +++ b/Tests/StoryFlowTests/ImplicitFlowTests.swift @@ -414,6 +414,7 @@ class ImplicitFlowTests: XCTestCase { // Act from.produce(output) + XCTAssert(currentVc.didAppear()) // Assert diff --git a/StoryFlowTests/TestabilityTests.swift b/Tests/StoryFlowTests/TestabilityTests.swift similarity index 97% rename from StoryFlowTests/TestabilityTests.swift rename to Tests/StoryFlowTests/TestabilityTests.swift index 2756265..3c58d98 100644 --- a/StoryFlowTests/TestabilityTests.swift +++ b/Tests/StoryFlowTests/TestabilityTests.swift @@ -1,5 +1,5 @@ import XCTest -import StoryFlow +@testable import StoryFlow class TestabilityTests: XCTestCase {