From a5abea15030599ae1805888a766ad78ed79cd28e Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Thu, 16 Jul 2020 15:56:14 +0300 Subject: [PATCH] fix(dependencies): update dependencies and remove macOS support --- Package.resolved | 24 +++++++++++----------- Package.swift | 3 +-- Sources/Extensions/UIView+Extensions.swift | 10 +++++---- Sources/RxSwift/ReachabilityService.swift | 2 +- Sources/Shared/PaddingLabel.swift | 10 +++++---- Sources/Shared/RoundImageView.swift | 2 +- 6 files changed, 27 insertions(+), 24 deletions(-) diff --git a/Package.resolved b/Package.resolved index cd57bc8..475450b 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/Alamofire/Alamofire.git", "state": { "branch": null, - "revision": "fca036f7aeca07124067cb6e0c12b0ad6359e3d4", - "version": "5.1.0" + "revision": "2777659076fda38bd4e487739ee331c7a65b5924", + "version": "5.2.1" } }, { @@ -42,8 +42,8 @@ "repositoryURL": "https://github.com/airbnb/lottie-ios", "state": { "branch": null, - "revision": "8f81de8d81da8631fd95ff81a9db133b76e13ea4", - "version": "3.1.6" + "revision": "4e5877425dae5c10792fc9d22d53dc6bf6824dc1", + "version": "3.1.8" } }, { @@ -68,9 +68,9 @@ "package": "Moya-ModelMapper", "repositoryURL": "https://github.com/sunshinejr/Moya-ModelMapper", "state": { - "branch": "master", + "branch": null, "revision": "3f0b7d953bedd2c61570bec7110fb30b720f028b", - "version": null + "version": "10.0.0" } }, { @@ -96,8 +96,8 @@ "repositoryURL": "https://github.com/realm/realm-cocoa.git", "state": { "branch": null, - "revision": "07734d6ee4b49b5656c51dab51c20a2d59b9de45", - "version": "4.4.0" + "revision": "fa43b8e2909334c79f233ce472332c136ca108da", + "version": "4.4.1" } }, { @@ -132,8 +132,8 @@ "repositoryURL": "https://github.com/rxswiftcommunity/rxflow", "state": { "branch": null, - "revision": "16e63a1d10f1e9de2393d4ec984deb5f53a9e8ee", - "version": "2.7.0" + "revision": "31557fa4a216387134c93db14130dfc45574b67d", + "version": "2.9.0" } }, { @@ -177,8 +177,8 @@ "repositoryURL": "https://github.com/bizz84/SwiftyStoreKit", "state": { "branch": null, - "revision": "6de7077c6cd15435c53d8ecfb1a09a371c83c4df", - "version": "0.15.1" + "revision": "a45217b2cf7c9bfea3139dc45afa06ca9cf6c4e6", + "version": "0.16.0" } } ] diff --git a/Package.swift b/Package.swift index 6ac28c8..5a9d0e6 100644 --- a/Package.swift +++ b/Package.swift @@ -5,7 +5,7 @@ import PackageDescription let rxDependencies: [Package.Dependency] = [ .package(url: "https://github.com/rxswiftcommunity/rxflow", from: "2.7.0"), - .package(url: "https://github.com/sunshinejr/Moya-ModelMapper", .branch("master")), + .package(url: "https://github.com/sunshinejr/Moya-ModelMapper", from: "10.0.0"), .package(url: "https://github.com/RxSwiftCommunity/RxRealm", from: "2.0.0"), .package(url: "https://github.com/RxSwiftCommunity/RxDataSources", from: "4.0.1"), .package(url: "https://github.com/RxSwiftCommunity/RxGesture", from: "3.0.3") @@ -14,7 +14,6 @@ let rxDependencies: [Package.Dependency] = [ let package = Package( name: "Toolkit", platforms: [ - .macOS(.v10_12), .iOS(.v12), .tvOS(.v10), .watchOS(.v3) diff --git a/Sources/Extensions/UIView+Extensions.swift b/Sources/Extensions/UIView+Extensions.swift index e0edfe3..8b3a681 100644 --- a/Sources/Extensions/UIView+Extensions.swift +++ b/Sources/Extensions/UIView+Extensions.swift @@ -11,10 +11,12 @@ import UIKit import SnapKit public extension UIView { - public static func container(_ insertedView: UIView, - centerHorizontally: Bool = false, - centerVertically: Bool = false, - insets: UIEdgeInsets = .init()) -> UIView { + + static func container(_ insertedView: UIView, + centerHorizontally: Bool = false, + centerVertically: Bool = false, + insets: UIEdgeInsets = .init()) -> UIView { + let view = UIView() view.addSubview(insertedView) insertedView.snp.makeConstraints { diff --git a/Sources/RxSwift/ReachabilityService.swift b/Sources/RxSwift/ReachabilityService.swift index fcd4e13..f4bbf9f 100644 --- a/Sources/RxSwift/ReachabilityService.swift +++ b/Sources/RxSwift/ReachabilityService.swift @@ -35,7 +35,7 @@ public enum ReachabilityServiceError: Error { case failedToCreate } -public class DefaultReachabilityService: HasReachabilityService { +public final class DefaultReachabilityService: HasReachabilityService { private let _reachabilitySubject: BehaviorSubject public var reachability: Observable { diff --git a/Sources/Shared/PaddingLabel.swift b/Sources/Shared/PaddingLabel.swift index 261cdc9..e00c7e3 100644 --- a/Sources/Shared/PaddingLabel.swift +++ b/Sources/Shared/PaddingLabel.swift @@ -7,7 +7,7 @@ import UIKit -public class PaddingLabel: UILabel { +public final class PaddingLabel: UILabel { private struct AssociatedKeys { static var padding = UIEdgeInsets() } @@ -23,7 +23,7 @@ public class PaddingLabel: UILabel { } } - override open func draw(_ rect: CGRect) { + public override func draw(_ rect: CGRect) { if let insets = padding { self.drawText(in: rect.inset(by: insets)) } else { @@ -31,7 +31,7 @@ public class PaddingLabel: UILabel { } } - override open var intrinsicContentSize: CGSize { + public override var intrinsicContentSize: CGSize { guard let text = self.text else { return super.intrinsicContentSize } var contentSize = super.intrinsicContentSize @@ -45,9 +45,11 @@ public class PaddingLabel: UILabel { textWidth -= insetsWidth } + let customFont: UIFont = font ?? .systemFont(ofSize: 16, weight: .regular) let newSize = text.boundingRect(with: CGSize(width: textWidth, height: CGFloat.greatestFiniteMagnitude), options: NSStringDrawingOptions.usesLineFragmentOrigin, - attributes: [NSAttributedString.Key.font: self.font ?? UIFont.systemFont(ofSize: 16, weight: .regular)], context: nil) + attributes: [.font: customFont], + context: nil) contentSize.height = ceil(newSize.size.height) + insetsHeight contentSize.width = ceil(newSize.size.width) + insetsWidth diff --git a/Sources/Shared/RoundImageView.swift b/Sources/Shared/RoundImageView.swift index 3fd715d..5fae12f 100644 --- a/Sources/Shared/RoundImageView.swift +++ b/Sources/Shared/RoundImageView.swift @@ -7,7 +7,7 @@ import UIKit -public class RoundImageView: UIImageView { +public final class RoundImageView: UIImageView { public override func layoutSubviews() { super.layoutSubviews() self.layer.cornerRadius = self.bounds.size.width / 2.0