diff --git a/Package.swift b/Package.swift index 0edf613e..20b41c98 100644 --- a/Package.swift +++ b/Package.swift @@ -14,6 +14,7 @@ let package = Package( // MARK: - SwiftUI .library(name: "TISwiftUICore", targets: ["TISwiftUICore"]), + .library(name: "TISwiftUIElements", targets: ["TISwiftUIElements"]), // MARK: - Utils .library(name: "TISwiftUtils", targets: ["TISwiftUtils"]), @@ -55,6 +56,7 @@ let package = Package( // MARK: - SwiftUI .target(name: "TISwiftUICore", path: "TISwiftUICore/Sources"), + .target(name: "TISwiftUIElements", path: "TISwiftUIElements/Sources"), // MARK: - Utils .target(name: "TISwiftUtils", path: "TISwiftUtils/Sources"), diff --git a/TISwiftUIElements/README.md b/TISwiftUIElements/README.md new file mode 100644 index 00000000..6c804ac6 --- /dev/null +++ b/TISwiftUIElements/README.md @@ -0,0 +1,5 @@ +# TISwiftUIElements + +# Installation via SPM + +You can install this framework as a target of LeadKit. diff --git a/TIUIElements/Sources/Alerts/Helpers/View+Helpers.swift b/TISwiftUIElements/Sources/Alerts/Modifiers/View+Alerts.swift similarity index 98% rename from TIUIElements/Sources/Alerts/Helpers/View+Helpers.swift rename to TISwiftUIElements/Sources/Alerts/Modifiers/View+Alerts.swift index 2f9bea2d..1b3b4121 100644 --- a/TIUIElements/Sources/Alerts/Helpers/View+Helpers.swift +++ b/TISwiftUIElements/Sources/Alerts/Modifiers/View+Alerts.swift @@ -21,9 +21,10 @@ // import TISwiftUtils +import TIUIElements import SwiftUI -@available(iOS 13.0, *) +@available(iOS 13, *) public extension View { /// Presents an alert with a description on a context when a given condition is true. diff --git a/TIUIElements/Sources/Alerts/Protocols/SwiftUIAlertContext.swift b/TISwiftUIElements/Sources/Alerts/Protocols/SwiftUIAlertContext.swift similarity index 96% rename from TIUIElements/Sources/Alerts/Protocols/SwiftUIAlertContext.swift rename to TISwiftUIElements/Sources/Alerts/Protocols/SwiftUIAlertContext.swift index da9cd8e6..0ea6ad63 100644 --- a/TIUIElements/Sources/Alerts/Protocols/SwiftUIAlertContext.swift +++ b/TISwiftUIElements/Sources/Alerts/Protocols/SwiftUIAlertContext.swift @@ -21,14 +21,13 @@ // import TISwiftUtils -import SwiftUI +import TIUIElements +import UIKit -@available(iOS 13, *) public protocol SwiftUIAlertContext: AlertPresentationContext { var presentingViewController: UIViewController { get set } } -@available(iOS 13, *) public extension SwiftUIAlertContext { func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: VoidClosure?) { presentingViewController.present(viewControllerToPresent, animated: flag, completion: completion) diff --git a/TISwiftUIElements/TISwiftUIElements.podspec b/TISwiftUIElements/TISwiftUIElements.podspec new file mode 100644 index 00000000..c99bcd30 --- /dev/null +++ b/TISwiftUIElements/TISwiftUIElements.podspec @@ -0,0 +1,17 @@ +Pod::Spec.new do |s| + s.name = 'TISwiftUIElements' + s.version = '1.24.0' + s.summary = 'Bunch of useful protocols and views.' + s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name + s.license = { :type => 'MIT', :file => 'LICENSE' } + s.author = { 'petropavel13' => 'ivan.smolin@touchin.ru' } + s.source = { :git => 'https://github.com/TouchInstinct/LeadKit.git', :tag => s.version.to_s } + + s.ios.deployment_target = '13.0' + s.swift_versions = ['5.3'] + + s.source_files = s.name + '/Sources/**/*' + + s.dependency 'TIUIElements', s.version.to_s + s.dependency 'TISwiftUtils', s.version.to_s +end diff --git a/TIUIElements/Sources/Alerts/Helpers/UIAlertController+AlertPresentable.swift b/TIUIElements/Sources/Alerts/Helpers/UIAlertController+AlertPresentable.swift index a2a5458a..d40ca0ef 100644 --- a/TIUIElements/Sources/Alerts/Helpers/UIAlertController+AlertPresentable.swift +++ b/TIUIElements/Sources/Alerts/Helpers/UIAlertController+AlertPresentable.swift @@ -20,7 +20,7 @@ // THE SOFTWARE. // -import typealias TISwiftUtils.VoidClosure +import TISwiftUtils import UIKit public extension UIAlertController { diff --git a/TIUIElements/Sources/Alerts/Protocols/AlertPresentable.swift b/TIUIElements/Sources/Alerts/Protocols/AlertPresentable.swift index 142f5b89..64eda4e1 100644 --- a/TIUIElements/Sources/Alerts/Protocols/AlertPresentable.swift +++ b/TIUIElements/Sources/Alerts/Protocols/AlertPresentable.swift @@ -21,7 +21,6 @@ // import TISwiftUtils -import Foundation public protocol AlertPresentable { func present(on context: AlertPresentationContext, completion: VoidClosure?)