Skip to content

Commit

Permalink
make library compatible with ios under 16
Browse files Browse the repository at this point in the history
  • Loading branch information
r.paraschenko committed Sep 12, 2024
1 parent af8811a commit 4359979
Show file tree
Hide file tree
Showing 51 changed files with 162 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -502,7 +502,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
Expand All @@ -529,7 +529,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -566,7 +566,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D953891C2B643BAD000E3357"
BuildableName = "SUICoordinatorExample.app"
BlueprintName = "SUICoordinatorExample"
ReferencedContainer = "container:SUICoordinatorExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D953891C2B643BAD000E3357"
BuildableName = "SUICoordinatorExample.app"
BlueprintName = "SUICoordinatorExample"
ReferencedContainer = "container:SUICoordinatorExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D953891C2B643BAD000E3357"
BuildableName = "SUICoordinatorExample.app"
BlueprintName = "SUICoordinatorExample"
ReferencedContainer = "container:SUICoordinatorExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>SUICoordinatorExample.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>D953891C2B643BAD000E3357</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import SwiftUI
import SUICoordinator

@available(iOS 16.0, *)
class AppDelegate: NSObject, UIApplicationDelegate {

var mainCoodinator: (any CoordinatorType)?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import SwiftUI

@available(iOS 16.0, *)
@main
struct SUICoordinatorExampleApp: App {
@UIApplicationDelegateAdaptor private var appDelegate: AppDelegate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import Foundation
import Combine
import SUICoordinator

@available(iOS 16.0, *)
public class CustomTabbarCoordinator: TabbarCoordinator<MyTabbarPage> {

// ---------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import SwiftUI

@available(iOS 16.0, *)
struct CustomTabbarView: View {

// ---------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import Foundation
import SUICoordinator

@available(iOS 16.0, *)
class CustomTabbarViewModel: ObservableObject {


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import Foundation
import SUICoordinator

@available(iOS 16.0, *)
class DefaultTabbarCoordinator: TabbarCoordinator<MyTabbarPage> {

// ---------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import SUICoordinator
import SwiftUI


@available(iOS 16.0, *)
public enum MyTabbarPage: TabbarPage, CaseIterable {

case first
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import SUICoordinator
import Foundation

@available(iOS 16.0, *)
class HomeCoordinator: Coordinator<HomeRoute> {

private let animated: Bool = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import Foundation
import SUICoordinator

@available(iOS 16.0, *)
enum HomeRoute: RouteType {

case push(viewModel: PushViewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import SUICoordinator

@available(iOS 16.0, *)
class MainCoordinator: Coordinator<MainRoute> {

override init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ enum MainRoute: RouteType {
// MARK: RouteType
// ---------------------------------------------------------

@available(iOS 16.0, *)
public var presentationStyle: TransitionPresentationStyle {
switch self {
case .splash:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import Foundation
import SUICoordinator

@available(iOS 16.0, *)
class TabbarFlowCoordinator: Coordinator<DefaultRoute> {

// ---------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import Foundation

@available(iOS 16.0, *)
class ActionListViewModel: ObservableObject {

let coordinator: HomeCoordinator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import SwiftUI

@available(iOS 16.0, *)
struct NavigationActionListView: View {

typealias ViewModel = ActionListViewModel
Expand Down Expand Up @@ -66,6 +67,7 @@ struct NavigationActionListView: View {
}
}

@available(iOS 16.0, *)
#Preview {
NavigationActionListView(viewModel: .init(coordinator: .init()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import SwiftUI

@available(iOS 16.0, *)
struct DetentsView: View {

typealias ViewModel = DetentsViewModel
Expand All @@ -50,6 +51,7 @@ struct DetentsView: View {
}
}

@available(iOS 16.0, *)
#Preview {
DetentsView(viewModel: .init(coordinator: .init()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import Foundation

@available(iOS 16.0, *)
class DetentsViewModel: ObservableObject {

let coordinator: HomeCoordinator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import SwiftUI

@available(iOS 16.0, *)
struct FullscreenView: View {

typealias ViewModel = FullscreenViewModel
Expand All @@ -50,6 +51,7 @@ struct FullscreenView: View {
}
}

@available(iOS 16.0, *)
#Preview {
FullscreenView(viewModel: .init(coordinator: .init()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import Foundation

@available(iOS 16.0, *)
class FullscreenViewModel: ObservableObject {

let coordinator: HomeCoordinator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import SwiftUI

@available(iOS 16.0, *)
struct PushView: View {

typealias ViewModel = PushViewModel
Expand All @@ -50,6 +51,7 @@ struct PushView: View {
}
}

@available(iOS 16.0, *)
#Preview {
PushView(viewModel: .init(coordinator: .init()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import Foundation

@available(iOS 16.0, *)
class PushViewModel: ObservableObject {

unowned var coordinator: HomeCoordinator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import SwiftUI

@available(iOS 16.0, *)
struct SheetView: View {

typealias ViewModel = SheetViewModel
Expand All @@ -50,6 +51,7 @@ struct SheetView: View {
}
}

@available(iOS 16.0, *)
#Preview {
SheetView(viewModel: .init(coordinator: .init()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import Foundation

@available(iOS 16.0, *)
class SheetViewModel: ObservableObject {

let coordinator: HomeCoordinator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import SwiftUI

@available(iOS 16.0, *)
struct TabbarActionListView: View {

typealias ViewModel = TabbarActionListViewModel
Expand Down Expand Up @@ -56,6 +57,7 @@ struct TabbarActionListView: View {
}
}

@available(iOS 16.0, *)
#Preview {
NavigationActionListView(viewModel: .init(coordinator: .init()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import Foundation

@available(iOS 16.0, *)
class TabbarActionListViewModel: ObservableObject {

let coordinator: TabbarFlowCoordinator
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PackageDescription

let package = Package(
name: "SUICoordinator",
platforms: [.iOS(.v16)],
platforms: [.iOS(.v15)],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
// .executable(name: "SUICoordinator", targets: ["SUICoordinator"]),
Expand Down
1 change: 1 addition & 0 deletions Sources/SUICoordinator/Coordinator/Coordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import SwiftUI
/// An open class representing a coordinator in a coordinator-based architecture.
///
/// Coordinators are responsible for coordinating the navigation and flow within an application.
@available(iOS 16.0, *)
open class Coordinator<Route: RouteType>: ObservableObject, CoordinatorType {

// --------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 4359979

Please sign in to comment.