Skip to content

Commit

Permalink
Fixed SPM builds (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
almazrafi authored Mar 8, 2021
1 parent bb98002 commit ba16ec0
Show file tree
Hide file tree
Showing 68 changed files with 155 additions and 19 deletions.
6 changes: 4 additions & 2 deletions Nivelir.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -922,8 +922,8 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1130;
LastUpgradeCheck = 1130;
ORGANIZATIONNAME = "HeadHunter";
LastUpgradeCheck = 1240;
ORGANIZATIONNAME = HeadHunter;
TargetAttributes = {
C057F00D23CB8EEB00C2D895 = {
CreatedOnToolsVersion = 11.3;
Expand Down Expand Up @@ -1295,6 +1295,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -1359,6 +1360,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

extension UINavigationController {
Expand All @@ -14,3 +15,4 @@ extension UINavigationController {
visibleViewController
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/Extensions/UIKit/UITabBarController+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

extension UITabBarController {
Expand All @@ -7,3 +8,4 @@ extension UITabBarController {
set { selectedViewController = newValue }
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/Extensions/UIKit/UIViewController+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

extension UIViewController {
Expand All @@ -18,3 +19,4 @@ extension UIViewController {
tabBarController
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/Extensions/UIKit/UIWindow+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

extension UIWindow {
Expand All @@ -6,3 +7,4 @@ extension UIWindow {
rootViewController
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/Screen/Actions/Generic/From/ScreenFromAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ extension ScreenRoute {
}
}

#if canImport(UIKit)
extension ScreenNavigator {

public func navigate<Container: ScreenContainer>(
Expand Down Expand Up @@ -77,3 +78,4 @@ extension ScreenNavigator {
)
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public struct ScreenFromFirstAction<
return false
}

return predicate(container)
return self.predicate.checkContainer(container)
}

guard let output = first as? Output else {
Expand Down Expand Up @@ -57,6 +57,7 @@ extension ScreenRoute {
}
}

#if canImport(UIKit)
extension ScreenNavigator {

public func navigate<Container: ScreenContainer>(
Expand Down Expand Up @@ -85,3 +86,4 @@ extension ScreenNavigator {
)
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#if canImport(UIKit)
import UIKit
#else
import Foundation
#endif

public struct ScreenFromPredicate<Container: ScreenContainer> {

Expand All @@ -8,7 +12,7 @@ public struct ScreenFromPredicate<Container: ScreenContainer> {
self.box = box
}

internal func callAsFunction(_ container: Container) -> Bool {
internal func checkContainer(_ container: Container) -> Bool {
box(container)
}
}
Expand All @@ -30,6 +34,7 @@ extension ScreenFromPredicate {
}
}

#if canImport(UIKit)
extension ScreenFromPredicate where Container == UIViewController {

public static var modalContainer: Self {
Expand Down Expand Up @@ -62,3 +67,4 @@ extension ScreenFromPredicate where Container == UITabBarController {
container(of: Container.self, key: key)
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public struct ScreenFromTopAction<
return false
}

return predicate(container)
return self.predicate.checkContainer(container)
}

guard let output = top as? Output else {
Expand Down Expand Up @@ -57,6 +57,7 @@ extension ScreenRoute {
}
}

#if canImport(UIKit)
extension ScreenNavigator {

public func navigate<Container: ScreenContainer>(
Expand Down Expand Up @@ -85,3 +86,4 @@ extension ScreenNavigator {
)
}
}
#endif
2 changes: 1 addition & 1 deletion Sources/Screen/Actions/Generic/ScreenJoinAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public struct ScreenJoinAction<
first.perform(container: container, navigation: navigation) { result in
switch result {
case let .success(container):
second.perform(
self.second.perform(
container: container,
navigation: navigation,
completion: completion
Expand Down
2 changes: 2 additions & 0 deletions Sources/Screen/Actions/Generic/ScreenNavigateToAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public struct ScreenNavigateToAction<Container: ScreenContainer>: ScreenAction {
}
}

#if canImport(UIKit)
extension ScreenNavigator {

public func navigate(
Expand All @@ -78,3 +79,4 @@ extension ScreenNavigator {
)
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/Screen/Actions/Modal/ScreenDismissAction.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenDismissAction<Container: UIViewController>: ScreenAction {
Expand Down Expand Up @@ -33,3 +34,4 @@ extension ScreenRoute where Container: UIViewController {
then(action: ScreenDismissAction<Container>(animated: animated))
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/Screen/Actions/Modal/ScreenPresentAction.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenPresentAction<
Expand Down Expand Up @@ -58,3 +59,4 @@ extension ScreenRoute where Container: UIViewController {
)
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/Screen/Actions/Modal/ScreenPresentedAction.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenPresentedAction<
Expand Down Expand Up @@ -62,3 +63,4 @@ extension ScreenRoute where Container: UIViewController {
)
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/Screen/Actions/Modal/ScreenPresentingAction.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenPresentingAction<
Expand Down Expand Up @@ -62,3 +63,4 @@ extension ScreenRoute where Container: UIViewController {
)
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/Screen/Actions/Modal/ScreenStackAction.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenStackAction<
Expand Down Expand Up @@ -62,3 +63,4 @@ extension ScreenRoute where Container: UIViewController {
)
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/Screen/Actions/Modal/ScreenTabsAction.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenTabsAction<
Expand Down Expand Up @@ -62,3 +63,4 @@ extension ScreenRoute where Container: UIViewController {
)
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/Screen/Actions/Stack/ScreenStackTopAction.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenStackTopAction<
Expand Down Expand Up @@ -60,3 +61,4 @@ extension ScreenRoute where Container: UINavigationController {
)
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/Screen/Actions/Stack/ScreenStackVisibleAction.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenStackVisibleAction<
Expand Down Expand Up @@ -60,3 +61,4 @@ extension ScreenRoute where Container: UINavigationController {
)
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public enum ScreenStackAnimation {
Expand Down Expand Up @@ -55,3 +56,4 @@ extension ScreenStackAnimation: Equatable {
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public protocol ScreenStackCustomAnimation {
Expand All @@ -20,3 +21,4 @@ extension ScreenStackCustomAnimation where Self: Equatable {
return self == other
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenStackTransitionAnimation: ScreenStackCustomAnimation, Equatable {
Expand Down Expand Up @@ -44,3 +45,4 @@ extension ScreenStackAnimation {
ScreenStackTransitionAnimation.crossDissolve
)
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenStackPopToModifier: ScreenStackModifier {
Expand All @@ -16,7 +17,7 @@ public struct ScreenStackPopToModifier: ScreenStackModifier {
in stack: [UIViewController],
navigation: ScreenNavigation
) throws -> [UIViewController] {
guard let stackIndex = predicate(stack) else {
guard let stackIndex = predicate.containerIndex(in: stack) else {
throw ScreenContainerNotFoundError<UIViewController>(for: self)
}

Expand All @@ -36,3 +37,4 @@ extension ScreenRoute where Container: UINavigationController {
)
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenStackPopToPredicate {
Expand All @@ -8,7 +9,7 @@ public struct ScreenStackPopToPredicate {
self.box = box
}

internal func callAsFunction(_ stack: [UIViewController]) -> Int? {
internal func containerIndex(in stack: [UIViewController]) -> Int? {
box(stack)
}
}
Expand All @@ -29,3 +30,4 @@ extension ScreenStackPopToPredicate {
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenStackClearModifier: ScreenStackModifier {
Expand Down Expand Up @@ -25,3 +26,4 @@ extension ScreenRoute where Container: UINavigationController {
)
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public protocol ScreenStackModifier: CustomStringConvertible {
Expand All @@ -6,3 +7,4 @@ public protocol ScreenStackModifier: CustomStringConvertible {
navigation: ScreenNavigation
) throws -> [UIViewController]
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenStackPopModifier: ScreenStackModifier {
Expand Down Expand Up @@ -29,3 +30,4 @@ extension ScreenRoute where Container: UINavigationController {
)
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenStackPopToRootModifier: ScreenStackModifier {
Expand Down Expand Up @@ -29,3 +30,4 @@ extension ScreenRoute where Container: UINavigationController {
)
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenStackPushModifier<
Expand Down Expand Up @@ -58,3 +59,4 @@ extension ScreenRoute where Container: UINavigationController {
)
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenStackReplaceModifier<
Expand Down Expand Up @@ -60,3 +61,4 @@ extension ScreenRoute where Container: UINavigationController {
)
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(UIKit)
import UIKit

public struct ScreenSetStackAction<Container: UINavigationController>: ScreenAction {
Expand Down Expand Up @@ -144,3 +145,4 @@ extension ScreenRoute where Container: UINavigationController {
)
}
}
#endif
Loading

0 comments on commit ba16ec0

Please sign in to comment.