feat: SUI alerts added to different library

This commit is contained in:
Nikita Semenov 2022-07-26 13:40:56 +03:00
parent 7b79d6b250
commit 8138291153
7 changed files with 29 additions and 6 deletions

View File

@ -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"),

View File

@ -0,0 +1,5 @@
# TISwiftUIElements
# Installation via SPM
You can install this framework as a target of LeadKit.

View File

@ -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.

View File

@ -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)

View File

@ -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

View File

@ -20,7 +20,7 @@
// THE SOFTWARE.
//
import typealias TISwiftUtils.VoidClosure
import TISwiftUtils
import UIKit
public extension UIAlertController {

View File

@ -21,7 +21,6 @@
//
import TISwiftUtils
import Foundation
public protocol AlertPresentable {
func present(on context: AlertPresentationContext, completion: VoidClosure?)