diff --git a/CHANGELOG.md b/CHANGELOG.md index 51319d1..638454a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [2.1.0] - 2024-04-01 +### Changed +- Изменил template на создание SwiftUI приложения + ## [2.0.1] - 2024-03-28 ### Changed - Обновил SwiftGen до версии 6.6.3 diff --git a/cookiecutter.json b/cookiecutter.json index f0dac49..c882a7e 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -2,7 +2,7 @@ "name": "Project", "organization": "Organization", "bundle_id": "com.organization", - "deployment_target": "11.0", + "deployment_target": "14.0", "development_team_id": "", "match_repo_url": "", "ipad": [ diff --git a/{{ cookiecutter.name }}/README.md b/{{ cookiecutter.name }}/README.md index cb99fbf..0380dfd 100644 --- a/{{ cookiecutter.name }}/README.md +++ b/{{ cookiecutter.name }}/README.md @@ -28,4 +28,4 @@ The resulted encrypted file should be committed to the repository. --- -This project was created using [the project template](https://github.com/alphatroya/swift-project-template) version 2.0.1. +This project was created using [the project template](https://github.com/alphatroya/swift-project-template) version 2.1.0. diff --git a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/AppDelegate.swift b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/AppDelegate.swift deleted file mode 100644 index e722d75..0000000 --- a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/AppDelegate.swift +++ /dev/null @@ -1,31 +0,0 @@ -import UIKit - -@main -class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? - - func application( - _: UIApplication, - didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - if #available(iOS 13, *) {} else { - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIViewController() - window.makeKeyAndVisible() - self.window = window - } - - return true - } - - // MARK: UISceneSession Lifecycle - - @available(iOS 13.0, *) - func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { - return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) - } - - @available(iOS 13.0, *) - func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { - } -} diff --git a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Application.swift b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Application.swift new file mode 100644 index 0000000..4e70360 --- /dev/null +++ b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Application.swift @@ -0,0 +1,10 @@ +import SwiftUI + +@main +struct Application: App { + var body: some Scene { + WindowGroup { + RootView() + } + } +} diff --git a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Common/LineView.swift b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Common/LineView.swift deleted file mode 100644 index 717dfac..0000000 --- a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Common/LineView.swift +++ /dev/null @@ -1,65 +0,0 @@ -import UIKit - -class LineView: UIView { - enum LineAxis { - case horizontal, vertical - } - - static let separatorInsets = UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 0) - - private let axis: LineAxis - - @available(*, unavailable) - required init(coder _: NSCoder) { - preconditionFailure("NSCoding not supported") - } - - init(axis: LineAxis, color: UIColor, thickness: CGFloat = 1) { - self.axis = axis - super.init(frame: CGRect.zero) - translatesAutoresizingMaskIntoConstraints = false - backgroundColor = color - switch axis { - case .horizontal: - heightAnchor.constraint(equalToConstant: thickness).isActive = true - case .vertical: - widthAnchor.constraint(equalToConstant: thickness).isActive = true - } - } - - func placeAboveView(_ view: UIView, insets: UIEdgeInsets = .zero) { - view.addSubview(self) - switch axis { - case .horizontal: - NSLayoutConstraint.activate([ - leftAnchor.constraint(equalTo: view.leftAnchor, constant: insets.left), - rightAnchor.constraint(equalTo: view.rightAnchor, constant: -insets.right), - topAnchor.constraint(equalTo: view.topAnchor, constant: insets.top), - ]) - case .vertical: - NSLayoutConstraint.activate([ - leftAnchor.constraint(equalTo: view.leftAnchor, constant: insets.left), - bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -insets.bottom), - topAnchor.constraint(equalTo: view.topAnchor, constant: insets.top), - ]) - } - } - - func placeBelowView(_ view: UIView, insets: UIEdgeInsets = .zero) { - view.addSubview(self) - switch axis { - case .horizontal: - NSLayoutConstraint.activate([ - leftAnchor.constraint(equalTo: view.leftAnchor, constant: insets.left), - rightAnchor.constraint(equalTo: view.rightAnchor, constant: -insets.right), - bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -insets.bottom), - ]) - case .vertical: - NSLayoutConstraint.activate([ - rightAnchor.constraint(equalTo: view.rightAnchor, constant: -insets.left), - bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -insets.bottom), - topAnchor.constraint(equalTo: view.topAnchor, constant: insets.top), - ]) - } - } -} diff --git a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Parent/NavigationController.swift b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Parent/NavigationController.swift deleted file mode 100644 index cc919c6..0000000 --- a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Parent/NavigationController.swift +++ /dev/null @@ -1,12 +0,0 @@ -import UIKit - -class NavigationController: UINavigationController, UIGestureRecognizerDelegate { - override func viewDidLoad() { - super.viewDidLoad() - interactivePopGestureRecognizer?.delegate = self - } - - func gestureRecognizerShouldBegin(_: UIGestureRecognizer) -> Bool { - return viewControllers.count > 1 - } -} diff --git a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Parent/NavigationStatusBarConfigurator.swift b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Parent/NavigationStatusBarConfigurator.swift deleted file mode 100644 index 3ebb481..0000000 --- a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Parent/NavigationStatusBarConfigurator.swift +++ /dev/null @@ -1,16 +0,0 @@ -import UIKit - -protocol NavigationStatusBarConfigurator { - func configureStatusBar() -} - -extension NavigationStatusBarConfigurator where Self: UIViewController { - func configureStatusBar() { - switch preferredStatusBarStyle { - case .lightContent: - navigationController?.navigationBar.barStyle = .black - default: - navigationController?.navigationBar.barStyle = .default - } - } -} diff --git a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Parent/ParentVC.swift b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Parent/ParentVC.swift deleted file mode 100644 index 42260bd..0000000 --- a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/Parent/ParentVC.swift +++ /dev/null @@ -1,22 +0,0 @@ -import UIKit - -class ParentVC: UIViewController { - override var preferredStatusBarStyle: UIStatusBarStyle { - if #available(iOS 13.0, *) { - return .darkContent - } else { - return .default - } - } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - configureStatusBar() - } - - deinit { - print("%{public}@ released 🙌", String(describing: type(of: self))) - } -} - -extension ParentVC: NavigationStatusBarConfigurator {} diff --git a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/RootView.swift b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/RootView.swift new file mode 100644 index 0000000..59e5f3d --- /dev/null +++ b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Classes/Modules/RootView.swift @@ -0,0 +1,7 @@ +import SwiftUI + +struct RootView: View { + var body: some View { + Text("Hello, App") + } +} diff --git a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Resources/Info.plist b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Resources/Info.plist index bf52ecc..1231f37 100644 --- a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Resources/Info.plist +++ b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/Resources/Info.plist @@ -2,23 +2,8 @@ - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - - - - + UILaunchScreen + ITSAppUsesNonExemptEncryption UIViewControllerBasedStatusBarAppearance diff --git a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/SceneDelegate.swift b/{{ cookiecutter.name }}/{{ cookiecutter.name }}/SceneDelegate.swift deleted file mode 100644 index 4aec3d9..0000000 --- a/{{ cookiecutter.name }}/{{ cookiecutter.name }}/SceneDelegate.swift +++ /dev/null @@ -1,17 +0,0 @@ -import UIKit - -@available(iOS 13.0, *) -class SceneDelegate: UIResponder, UIWindowSceneDelegate { - - var window: UIWindow? - - func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - - if let windowScene = scene as? UIWindowScene { - let window = UIWindow(windowScene: windowScene) - window.rootViewController = UIViewController() - self.window = window - window.makeKeyAndVisible() - } - } -}