diff --git a/.gitmodules b/.gitmodules index af2dbee6..3e7fa1a8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "build-scripts"] path = build-scripts - url = https://github.com/TouchInstinct/BuildScripts.git + url = https://gitlab.ti/touchinstinct/BuildScripts.git diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c3fc4d0..ed2000e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,13 @@ # Changelog +### 1.37.0 + +- **Added**: API for converting view hierarchy to skeletons + ### 1.36.0 -- **Added**: API for converting view hierarchy to skeletons +- **Removed**: `TILogger`module +- **Updated**: moved `LoggingPresenter` to `TIDeveloperUtils` module. ### 1.35.1 diff --git a/LeadKit.podspec b/LeadKit.podspec index 74bc50d0..fa413634 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -2,10 +2,10 @@ Pod::Spec.new do |s| s.name = "LeadKit" s.version = "1.35.0" s.summary = "iOS framework with a bunch of tools for rapid development" - s.homepage = "https://github.com/TouchInstinct/LeadKit" + s.homepage = "https://gitlab.ti/touchinstinct/LeadKit" s.license = "Apache License, Version 2.0" s.author = "Touch Instinct" - s.source = { :git => "https://github.com/TouchInstinct/LeadKit.git", :tag => s.version } + s.source = { :git => "https://gitlab.ti/touchinstinct/LeadKit.git", :tag => s.version } s.platform = :ios, '10.0' s.swift_versions = ['5.1'] diff --git a/Package.swift b/Package.swift index 32aff137..642b75ae 100644 --- a/Package.swift +++ b/Package.swift @@ -21,7 +21,6 @@ let package = Package( .library(name: "TIFoundationUtils", targets: ["TIFoundationUtils"]), .library(name: "TIKeychainUtils", targets: ["TIKeychainUtils"]), .library(name: "TITableKitUtils", targets: ["TITableKitUtils"]), - .library(name: "TILogging", targets: ["TILogging"]), .library(name: "TIDeveloperUtils", targets: ["TIDeveloperUtils"]), // MARK: - Networking @@ -67,8 +66,7 @@ let package = Package( .target(name: "TIFoundationUtils", dependencies: ["TISwiftUtils"], path: "TIFoundationUtils", exclude: ["TIFoundationUtils.app"]), .target(name: "TIKeychainUtils", dependencies: ["TIFoundationUtils", "KeychainAccess"], path: "TIKeychainUtils/Sources"), .target(name: "TITableKitUtils", dependencies: ["TIUIElements", "TableKit"], path: "TITableKitUtils/Sources"), - .target(name: "TILogging", dependencies: ["TIUIElements", "TISwiftUtils", "TIUIKitCore"], path: "TILogging/Sources"), - .target(name: "TIDeveloperUtils", dependencies: [], path: "TIDeveloperUtils/Sources"), + .target(name: "TIDeveloperUtils", dependencies: ["TISwiftUtils", "TIUIKitCore", "TIUIElements"], path: "TIDeveloperUtils/Sources"), // MARK: - Networking .target(name: "TINetworking", dependencies: ["TIFoundationUtils", "Alamofire"], path: "TINetworking/Sources"), diff --git a/README.md b/README.md index 6d3552a7..78bbc14b 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ ${SRCROOT}/TIModuleName/TIModuleName.app" ./setup ``` -- If legacy [Source](https://github.com/TouchInstinct/LeadKit/tree/master/Sources) folder needed, [build dependencies for LeadKit.xcodeproj](https://github.com/TouchInstinct/LeadKit/blob/master/docs/snippets.md#build-dependencies-for-LeadKit.xcodeproj). +- If legacy [Source](https://gitlab.ti/touchinstinct/LeadKit/tree/master/Sources) folder needed, [build dependencies for LeadKit.xcodeproj](https://gitlab.ti/touchinstinct/LeadKit/blob/master/docs/snippets.md#build-dependencies-for-LeadKit.xcodeproj). - Make sure the commit message codestyle is followed. More about [Semantic Commit Messages](docs/semantic-commit-messages.md). @@ -105,14 +105,14 @@ ${SRCROOT}/TIModuleName/TIModuleName.app" ```swift dependencies: [ - .package(url: "https://github.com/TouchInstinct/LeadKit.git", from: "x.y.z"), + .package(url: "https://gitlab.ti/touchinstinct/LeadKit.git", from: "x.y.z"), ], ``` ### Cocoapods ```ruby -source 'https://github.com/TouchInstinct/Podspecs.git' +source 'https://gitlab.ti/touchinstinct/Podspecs.git' pod 'TISwiftUtils', 'x.y.z' pod 'TIFoundationUtils', 'x.y.z' diff --git a/TIAppleMapUtils/TIAppleMapUtils.podspec b/TIAppleMapUtils/TIAppleMapUtils.podspec index dc80fcdc..a34512ab 100644 --- a/TIAppleMapUtils/TIAppleMapUtils.podspec +++ b/TIAppleMapUtils/TIAppleMapUtils.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = 'TIAppleMapUtils' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Set of helpers for map objects clustering and interacting using Apple MapKit.' - s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name + s.homepage = 'https://gitlab.ti/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.source = { :git => 'https://gitlab.ti/touchinstinct/LeadKit.git', :tag => s.version.to_s } s.ios.deployment_target = '11.0' s.swift_versions = ['5.3'] diff --git a/TIAuth/TIAuth.podspec b/TIAuth/TIAuth.podspec index 8b7fcfec..01745b46 100644 --- a/TIAuth/TIAuth.podspec +++ b/TIAuth/TIAuth.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIAuth' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Login, registration, confirmation and other related actions' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TILogging/Sources/LoggingPresenter.swift b/TIDeveloperUtils/Sources/LoggingPresenter/LoggingPresenter.swift similarity index 100% rename from TILogging/Sources/LoggingPresenter.swift rename to TIDeveloperUtils/Sources/LoggingPresenter/LoggingPresenter.swift diff --git a/TILogging/Sources/Views/LoggerList/LogEntryCellView.swift b/TIDeveloperUtils/Sources/LoggingPresenter/Views/LoggerList/LogEntryCellView.swift similarity index 100% rename from TILogging/Sources/Views/LoggerList/LogEntryCellView.swift rename to TIDeveloperUtils/Sources/LoggingPresenter/Views/LoggerList/LogEntryCellView.swift diff --git a/TILogging/Sources/Views/LoggerList/LogEntryTableViewCell.swift b/TIDeveloperUtils/Sources/LoggingPresenter/Views/LoggerList/LogEntryTableViewCell.swift similarity index 100% rename from TILogging/Sources/Views/LoggerList/LogEntryTableViewCell.swift rename to TIDeveloperUtils/Sources/LoggingPresenter/Views/LoggerList/LogEntryTableViewCell.swift diff --git a/TILogging/Sources/Views/LoggerList/LogsListViewController.swift b/TIDeveloperUtils/Sources/LoggingPresenter/Views/LoggerList/LogsListViewController.swift similarity index 100% rename from TILogging/Sources/Views/LoggerList/LogsListViewController.swift rename to TIDeveloperUtils/Sources/LoggingPresenter/Views/LoggerList/LogsListViewController.swift diff --git a/TILogging/Sources/Views/LoggerWindow/LoggingTogglingViewController.swift b/TIDeveloperUtils/Sources/LoggingPresenter/Views/LoggerWindow/LoggingTogglingViewController.swift similarity index 100% rename from TILogging/Sources/Views/LoggerWindow/LoggingTogglingViewController.swift rename to TIDeveloperUtils/Sources/LoggingPresenter/Views/LoggerWindow/LoggingTogglingViewController.swift diff --git a/TILogging/Sources/Views/LoggerWindow/LoggingTogglingWindow.swift b/TIDeveloperUtils/Sources/LoggingPresenter/Views/LoggerWindow/LoggingTogglingWindow.swift similarity index 100% rename from TILogging/Sources/Views/LoggerWindow/LoggingTogglingWindow.swift rename to TIDeveloperUtils/Sources/LoggingPresenter/Views/LoggerWindow/LoggingTogglingWindow.swift diff --git a/TILogging/Sources/Views/ViewModels/FileCreator.swift b/TIDeveloperUtils/Sources/LoggingPresenter/Views/ViewModels/FileCreator.swift similarity index 100% rename from TILogging/Sources/Views/ViewModels/FileCreator.swift rename to TIDeveloperUtils/Sources/LoggingPresenter/Views/ViewModels/FileCreator.swift diff --git a/TILogging/Sources/Views/ViewModels/Helpers/DefaultLogsListManipulator.swift b/TIDeveloperUtils/Sources/LoggingPresenter/Views/ViewModels/Helpers/DefaultLogsListManipulator.swift similarity index 100% rename from TILogging/Sources/Views/ViewModels/Helpers/DefaultLogsListManipulator.swift rename to TIDeveloperUtils/Sources/LoggingPresenter/Views/ViewModels/Helpers/DefaultLogsListManipulator.swift diff --git a/TILogging/Sources/Views/ViewModels/Helpers/LogsListManipulatorProtocol.swift b/TIDeveloperUtils/Sources/LoggingPresenter/Views/ViewModels/Helpers/LogsListManipulatorProtocol.swift similarity index 100% rename from TILogging/Sources/Views/ViewModels/Helpers/LogsListManipulatorProtocol.swift rename to TIDeveloperUtils/Sources/LoggingPresenter/Views/ViewModels/Helpers/LogsListManipulatorProtocol.swift diff --git a/TILogging/Sources/Views/ViewModels/LogsListViewOutput.swift b/TIDeveloperUtils/Sources/LoggingPresenter/Views/ViewModels/LogsListViewOutput.swift similarity index 100% rename from TILogging/Sources/Views/ViewModels/LogsListViewOutput.swift rename to TIDeveloperUtils/Sources/LoggingPresenter/Views/ViewModels/LogsListViewOutput.swift diff --git a/TILogging/Sources/Views/ViewModels/LogsStorageViewModel.swift b/TIDeveloperUtils/Sources/LoggingPresenter/Views/ViewModels/LogsStorageViewModel.swift similarity index 100% rename from TILogging/Sources/Views/ViewModels/LogsStorageViewModel.swift rename to TIDeveloperUtils/Sources/LoggingPresenter/Views/ViewModels/LogsStorageViewModel.swift diff --git a/TIDeveloperUtils/TIDeveloperUtils.podspec b/TIDeveloperUtils/TIDeveloperUtils.podspec index a2580e31..0f6f94c0 100644 --- a/TIDeveloperUtils/TIDeveloperUtils.podspec +++ b/TIDeveloperUtils/TIDeveloperUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIDeveloperUtils' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Universal web view API' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIEcommerce/TIEcommerce.podspec b/TIEcommerce/TIEcommerce.podspec index a7adf60b..854e0ad7 100644 --- a/TIEcommerce/TIEcommerce.podspec +++ b/TIEcommerce/TIEcommerce.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIEcommerce' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Cart, products, promocodes, bonuses and other related actions' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIFoundationUtils/TIFoundationUtils.podspec b/TIFoundationUtils/TIFoundationUtils.podspec index 3d89b8f3..e3721de7 100644 --- a/TIFoundationUtils/TIFoundationUtils.podspec +++ b/TIFoundationUtils/TIFoundationUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIFoundationUtils' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Set of helpers for Foundation framework classes.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIGoogleMapUtils/TIGoogleMapUtils.podspec b/TIGoogleMapUtils/TIGoogleMapUtils.podspec index 31195b66..0f5c3c6d 100644 --- a/TIGoogleMapUtils/TIGoogleMapUtils.podspec +++ b/TIGoogleMapUtils/TIGoogleMapUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIGoogleMapUtils' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Set of helpers for map objects clustering and interacting using Google Maps SDK.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIKeychainUtils/TIKeychainUtils.podspec b/TIKeychainUtils/TIKeychainUtils.podspec index 57162d4a..97f19406 100644 --- a/TIKeychainUtils/TIKeychainUtils.podspec +++ b/TIKeychainUtils/TIKeychainUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIKeychainUtils' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Set of helpers for Keychain classes.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TILogging/Sources/Logger/Logger.swift b/TILogging/Sources/Logger/Logger.swift deleted file mode 100644 index 07507989..00000000 --- a/TILogging/Sources/Logger/Logger.swift +++ /dev/null @@ -1,77 +0,0 @@ -// -// Copyright (c) 2022 Touch Instinct -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the Software), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -import Foundation -import os - -public struct TILogger: LoggerRepresentable { - - // MARK: - Properties - - @available(iOS 12, *) - public static let defaultLogger = TILogger(subsystem: .defaultSubsystem ?? "", category: .pointsOfInterest) - - public let logInfo: OSLog - - // MARK: - Init - - public init(subsystem: String, category: String) { - self.logInfo = .init(subsystem: subsystem, category: category) - } - - @available(iOS 12, *) - public init(subsystem: String, category: OSLog.Category) { - self.logInfo = .init(subsystem: subsystem, category: category) - } - - // MARK: - LoggerRepresentable - - public func log(_ message: StaticString, log: OSLog?, type: OSLogType, _ arguments: CVarArg...) { - os_log(message, log: log ?? logInfo, type: type, arguments) - } - - // MARK: - Public methods - - public func verbose(_ message: StaticString, _ arguments: CVarArg...) { - self.log(message, log: logInfo, type: .default, arguments) - } - - public func info(_ message: StaticString, _ arguments: CVarArg...) { - self.log(message, log: logInfo, type: .info, arguments) - } - - public func debug(_ message: StaticString, _ arguments: CVarArg...) { - self.log(message, log: logInfo, type: .debug, arguments) - } - - public func error(_ message: StaticString, _ arguments: CVarArg...) { - self.log(message, log: logInfo, type: .error, arguments) - } - - public func fault(_ message: StaticString, _ arguments: CVarArg...) { - self.log(message, log: logInfo, type: .fault, arguments) - } -} - -private extension String { - static let defaultSubsystem = Bundle.main.bundleIdentifier -} diff --git a/TILogging/TILogging.podspec b/TILogging/TILogging.podspec deleted file mode 100644 index d5070666..00000000 --- a/TILogging/TILogging.podspec +++ /dev/null @@ -1,20 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'TILogging' - s.version = '1.36.0' - s.summary = 'Logging API' - 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', - 'castlele' => 'nikita.semenov@touchin.ru' } - s.source = { :git => 'https://github.com/TouchInstinct/LeadKit.git', :tag => s.version.to_s } - - s.ios.deployment_target = '11.0' - s.swift_versions = ['5.3'] - - s.source_files = s.name + '/Sources/**/*' - - s.dependency 'TIUIKitCore', s.version.to_s - s.dependency 'TISwiftUtils', s.version.to_s - s.dependency 'TIUIElements', s.version.to_s - -end diff --git a/TIMapUtils/Sources/Managers/BaseMapManager.swift b/TIMapUtils/Sources/Managers/BaseMapManager.swift index a8dc5b37..43345bf0 100644 --- a/TIMapUtils/Sources/Managers/BaseMapManager.swift +++ b/TIMapUtils/Sources/Managers/BaseMapManager.swift @@ -23,7 +23,7 @@ import Foundation import UIKit.UIGeometry -open class BaseMapManager where PM.Position: LocationCoordinate, @@ -79,16 +79,20 @@ open class BaseMapManager 'MIT', :file => 'LICENSE' } diff --git a/TIMoyaNetworking/TIMoyaNetworking.podspec b/TIMoyaNetworking/TIMoyaNetworking.podspec index 46259090..239184e5 100644 --- a/TIMoyaNetworking/TIMoyaNetworking.podspec +++ b/TIMoyaNetworking/TIMoyaNetworking.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIMoyaNetworking' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Moya + Swagger network service.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TINetworking/TINetworking.podspec b/TINetworking/TINetworking.podspec index 0e403b87..d1c1ef32 100644 --- a/TINetworking/TINetworking.podspec +++ b/TINetworking/TINetworking.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TINetworking' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Swagger-frendly networking layer helpers.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TINetworkingCache/TINetworkingCache.podspec b/TINetworkingCache/TINetworkingCache.podspec index 3a151388..64831b1f 100644 --- a/TINetworkingCache/TINetworkingCache.podspec +++ b/TINetworkingCache/TINetworkingCache.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TINetworkingCache' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Caching results of EndpointRequests.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIPagination/TIPagination.podspec b/TIPagination/TIPagination.podspec index ffcc30e5..3ee3bb66 100644 --- a/TIPagination/TIPagination.podspec +++ b/TIPagination/TIPagination.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIPagination' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Generic pagination component.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TISwiftUICore/TISwiftUICore.podspec b/TISwiftUICore/TISwiftUICore.podspec index 6a2a4a42..be59b9b8 100644 --- a/TISwiftUICore/TISwiftUICore.podspec +++ b/TISwiftUICore/TISwiftUICore.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TISwiftUICore' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Core UI elements: protocols, views and helpers.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TISwiftUtils/TISwiftUtils.podspec b/TISwiftUtils/TISwiftUtils.podspec index f927fd06..ab75d35d 100644 --- a/TISwiftUtils/TISwiftUtils.podspec +++ b/TISwiftUtils/TISwiftUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TISwiftUtils' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Bunch of useful helpers for Swift development.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TITableKitUtils/TITableKitUtils.podspec b/TITableKitUtils/TITableKitUtils.podspec index cf268632..d0938b2e 100644 --- a/TITableKitUtils/TITableKitUtils.podspec +++ b/TITableKitUtils/TITableKitUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TITableKitUtils' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Set of helpers for TableKit classes.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TITransitions/TITransitions.podspec b/TITransitions/TITransitions.podspec index 9923841f..39a30619 100644 --- a/TITransitions/TITransitions.podspec +++ b/TITransitions/TITransitions.podspec @@ -2,10 +2,10 @@ Pod::Spec.new do |s| s.name = 'TITransitions' s.version = '1.34.1' s.summary = 'Set of custom transitions to present controller. ' - s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name + s.homepage = 'https://gitlab.ti/touchinstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { 'Loupehope' => 'vladislav.suhomlinov@touchin.ru' } - s.source = { :git => 'https://github.com/TouchInstinct/LeadKit.git', :tag => s.version.to_s } + s.source = { :git => 'https://gitlab.ti/touchinstinct/LeadKit.git', :tag => s.version.to_s } s.ios.deployment_target = '11.0' s.swift_versions = ['5.0'] diff --git a/TIUIElements/Sources/Views/Skeletons/Helpers/UIView+Skeletons.swift b/TIUIElements/Sources/Views/Skeletons/Helpers/UIView+Skeletons.swift index 5eb42a77..85803073 100644 --- a/TIUIElements/Sources/Views/Skeletons/Helpers/UIView+Skeletons.swift +++ b/TIUIElements/Sources/Views/Skeletons/Helpers/UIView+Skeletons.swift @@ -20,8 +20,33 @@ // THE SOFTWARE. // +import TIUIKitCore import UIKit +// MARK: - UITextView + is multiline + +extension UITextView { + var isMultiline: Bool { + isMultiline(text: text, + attributedText: attributedText, + font: font, + textAlignment: textAlignment) + } +} + +// MARK: - UILabel + is multiline + +extension UILabel { + var isMultiline: Bool { + isMultiline(text: text, + attributedText: attributedText, + font: font, + textAlignment: textAlignment) + } +} + +// MARK: - UIView + Skeleton helpers + extension UIView { public var skeletonableViews: [UIView] { if let skeletonableView = self as? Skeletonable { @@ -56,29 +81,39 @@ extension UIView { return .generic(self) } } -} -extension UITextView { - var isMultiline: Bool { - guard let text = attributedText?.string ?? text, let font = font else { + fileprivate func isMultiline(text: String?, + attributedText: NSAttributedString?, + font: UIFont?, + textAlignment: NSTextAlignment) -> Bool { + let _text: String + let _font: UIFont + + if let attributedText = attributedText, let maxFont = attributedText.getMaxFont() { + _text = attributedText.string + _font = maxFont + + } else if let text = text, let font = font { + _text = text + _font = font + + } else { return false } - let labelTextSize = (text as NSString).size(withAttributes: [.font: font]) + let textAttributes = BaseTextAttributes(font: _font, color: .black, alignment: textAlignment, isMultiline: true) + let labelTextSize = textAttributes.size(of: _text, with: .zero) return labelTextSize.width > bounds.width } } -extension UILabel { - var isMultiline: Bool { - // Unwrapping font to mute warning while casting UIFont! to Any - guard let text = attributedText?.string ?? text, let font = font else { - return false - } +// MARK: - NSAttributedString helper extension - let labelTextSize = (text as NSString).size(withAttributes: [.font: font]) - - return labelTextSize.width > bounds.width +extension NSAttributedString { + func getMaxFont() -> UIFont? { + (0.. [SkeletonLayer] { - let skeletonLayer = skeletonsConfiguration.createSkeletonLayer(for: baseView) - var subviewSkeletonLayers = [SkeletonLayer]() - - if view.isSkeletonsContainer { - if skeletonsConfiguration.borderWidth != .zero { - skeletonLayer.bind(to: .container(view)) - } - - subviewSkeletonLayers = view.skeletonableViews - .map(getSkeletonLayer(forView:)) - .flatMap { $0 } - - } else { - skeletonLayer.bind(to: view.viewType) - } - - return [skeletonLayer] + subviewSkeletonLayers - } } // MARK: - UIView + SkeletonsPresenter extension SkeletonsPresenter where Self: UIView { - public var baseView: UIView? { - self - } - public var isSkeletonsHidden: Bool { (layer.sublayers ?? []).first { $0 is SkeletonLayer } == nil } @@ -130,30 +52,26 @@ extension SkeletonsPresenter where Self: UIView { public var viewsToSkeletone: [UIView] { skeletonableViews } + + public func showSkeletons() { + showSkeletons(viewsToSkeletone: viewsToSkeletone, + skeletonsConfiguration) + } } // MARK: - UIViewController + SkeletonsPresenter extension SkeletonsPresenter where Self: UIViewController { - public var baseView: UIView? { - view - } - public var isSkeletonsHidden: Bool { (view.layer.sublayers ?? []).first { $0 is SkeletonLayer } == nil } public var viewsToSkeletone: [UIView] { - baseView?.skeletonableViews ?? view.skeletonableViews - } -} - -// MARK: - Helper extension - -extension Array where Element: CALayer { - public func insert(onto view: UIView, at index: UInt32 = .max) { - self.forEach { subLayer in - view.layer.insertSublayer(subLayer, at: index) - } + view.skeletonableViews + } + + public func showSkeletons() { + showSkeletons(viewsToSkeletone: viewsToSkeletone, + skeletonsConfiguration) } } diff --git a/TIUIElements/Sources/Views/Skeletons/UIView+PresentingSkeletons.swift b/TIUIElements/Sources/Views/Skeletons/UIView+PresentingSkeletons.swift new file mode 100644 index 00000000..9addca50 --- /dev/null +++ b/TIUIElements/Sources/Views/Skeletons/UIView+PresentingSkeletons.swift @@ -0,0 +1,111 @@ +// +// Copyright (c) 2023 Touch Instinct +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the Software), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import UIKit + +extension UIView { + + // MARK: - Public methods + + /// Shows skeletons on the view + /// + /// - Parameters: + /// - viewsToSkeletone: views that will be converted to skeletones. If nil was passed subviews will be converted to skeletons + /// - config: configuration of the skeletons' layers + public func showSkeletons(viewsToSkeletone: [UIView]?, + _ config: SkeletonsConfiguration) { + + let viewsToSkeletone = viewsToSkeletone ?? skeletonableViews + isUserInteractionEnabled = false + + subviews.forEach { $0.isHidden = true } + + viewsToSkeletone + .flatMap { view in + getSkeletonLayer(forView: view, withConfiguration: config) + } + .map { layer in + layer.startAnimation() + + return layer + } + .insert(onto: self) + } + + public func hideSkeletons() { + isUserInteractionEnabled = true + + layer.sublayers?.forEach { layer in + if let layer = layer as? SkeletonLayer { + layer.remove(from: self) + } + } + + subviews.forEach { $0.isHidden = false} + } + + public func startAnimation() { + layer.skeletonLayers.forEach { layer in + layer.startAnimation() + } + } + + public func stopAnimation() { + layer.skeletonLayers.forEach { layer in + layer.stopAnimation() + } + } + + // MARK: - Private methods + + private func getSkeletonLayer(forView view: UIView, + withConfiguration conf: SkeletonsConfiguration) -> [SkeletonLayer] { + + let skeletonLayer = conf.createSkeletonLayer(for: self) + var subviewSkeletonLayers = [SkeletonLayer]() + + if view.isSkeletonsContainer { + if conf.borderWidth != .zero { + skeletonLayer.bind(to: .container(view)) + } + + subviewSkeletonLayers = view.skeletonableViews + .map { getSkeletonLayer(forView: $0, withConfiguration: conf) } + .flatMap { $0 } + + } else { + skeletonLayer.bind(to: view.viewType) + } + + return [skeletonLayer] + subviewSkeletonLayers + } +} + +// MARK: - Helper extension + +extension Array where Element: CALayer { + public func insert(onto view: UIView, at index: UInt32 = .max) { + self.forEach { subLayer in + view.layer.insertSublayer(subLayer, at: index) + } + } +} diff --git a/TILogging/Sources/Logger/LoggerRepresentable.swift b/TIUIElements/Sources/Views/Skeletons/UIViewController+PresentingSkeletons.swift similarity index 59% rename from TILogging/Sources/Logger/LoggerRepresentable.swift rename to TIUIElements/Sources/Views/Skeletons/UIViewController+PresentingSkeletons.swift index 5337fcfe..3af38aa4 100644 --- a/TILogging/Sources/Logger/LoggerRepresentable.swift +++ b/TIUIElements/Sources/Views/Skeletons/UIViewController+PresentingSkeletons.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2022 Touch Instinct +// Copyright (c) 2023 Touch Instinct // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal @@ -20,8 +20,30 @@ // THE SOFTWARE. // -import os +import UIKit -public protocol LoggerRepresentable { - func log(_ message: StaticString, log: OSLog?, type: OSLogType, _ arguments: CVarArg...) +extension UIViewController { + + /// Shows skeletons + /// + /// - Parameters: + /// - viewsToSkeletone: views that will be converted to skeletones. If nil was passed subviews of the view will be converted to skeletons + /// - config: configuration of the skeletons' layers + public func showSkeletons(viewsToSkeletone: [UIView]?, + _ config: SkeletonsConfiguration) { + + view.showSkeletons(viewsToSkeletone: viewsToSkeletone, config) + } + + public func hideSkeletons() { + view.hideSkeletons() + } + + public func startAnimation() { + view.startAnimation() + } + + public func stopAnimation() { + view.stopAnimation() + } } diff --git a/TIUIElements/TIUIElements.podspec b/TIUIElements/TIUIElements.podspec index b2e04081..60c2bc98 100644 --- a/TIUIElements/TIUIElements.podspec +++ b/TIUIElements/TIUIElements.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIUIElements' - s.version = '1.36.0' + s.version = '1.37.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' } diff --git a/TIUIKitCore/TIUIKitCore.podspec b/TIUIKitCore/TIUIKitCore.podspec index e8bededa..e68a1d70 100644 --- a/TIUIKitCore/TIUIKitCore.podspec +++ b/TIUIKitCore/TIUIKitCore.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIUIKitCore' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Core UI elements: protocols, views and helpers.' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIWebView/TIWebView.podspec b/TIWebView/TIWebView.podspec index c6c2afeb..269c97dc 100644 --- a/TIWebView/TIWebView.podspec +++ b/TIWebView/TIWebView.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'TIWebView' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Universal web view API' s.homepage = 'https://github.com/TouchInstinct/LeadKit/tree/' + s.version.to_s + '/' + s.name s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/TIYandexMapUtils/TIYandexMapUtils.podspec b/TIYandexMapUtils/TIYandexMapUtils.podspec index b3d899dc..f53a2d90 100644 --- a/TIYandexMapUtils/TIYandexMapUtils.podspec +++ b/TIYandexMapUtils/TIYandexMapUtils.podspec @@ -1,13 +1,13 @@ Pod::Spec.new do |s| s.name = 'TIYandexMapUtils' - s.version = '1.36.0' + s.version = '1.37.0' s.summary = 'Set of helpers for map objects clustering and interacting using Yandex Maps SDK.' 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 = '10.0' + s.ios.deployment_target = '12.0' s.swift_versions = ['5.3'] s.source_files = s.name + '/Sources/**/*' @@ -17,5 +17,5 @@ Pod::Spec.new do |s| s.pod_target_xcconfig = { 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } s.dependency 'TIMapUtils', s.version.to_s - s.dependency 'YandexMapsMobile', '4.0.0-lite' + s.dependency 'YandexMapsMobile', '4.3.1-lite' end diff --git a/project-scripts/ordered_modules_list.txt b/project-scripts/ordered_modules_list.txt index 46127ea8..71f5d1ca 100644 --- a/project-scripts/ordered_modules_list.txt +++ b/project-scripts/ordered_modules_list.txt @@ -5,7 +5,6 @@ TIKeychainUtils TIUIKitCore TISwiftUICore TIUIElements -TILogging TIAuth TITableKitUtils TINetworking @@ -17,4 +16,4 @@ TIGoogleMapUtils TIYandexMapUtils TIEcommerce TIWebView -TIDeveloperUtils \ No newline at end of file +TIDeveloperUtils diff --git a/project-scripts/push_to_podspecs.sh b/project-scripts/push_to_podspecs.sh index e96cdebd..b3a69986 100755 --- a/project-scripts/push_to_podspecs.sh +++ b/project-scripts/push_to_podspecs.sh @@ -14,5 +14,5 @@ # for module_name in $(cat ${SRCROOT}/project-scripts/ordered_modules_list.txt); do - bundle exec pod repo push git@github.com:TouchInstinct/Podspecs ${SRCROOT}/${module_name}/${module_name}.podspec "$@" --allow-warnings + bundle exec pod repo push git@gitlab.ti:touchinstinct/Podspecs ${SRCROOT}/${module_name}/${module_name}.podspec "$@" --allow-warnings done