Releases: tbaranes/SwiftyUtils
Releases · tbaranes/SwiftyUtils
v5.5.2
v5.5.1
v5.5.0
Enhancements
- UIViewControllerExtension:
func addSubSwiftUIView<Content>(_ swiftUIView: Content, to view: UIView) where Content: View
- UIViewExtension:
var parentViewController: UIViewController?
func findView<T>() -> T?
func addSubSwiftUIView<Content>(_ swiftUIView: Content) where Content: View
func addBorders(to edges: UIRectEdge, borderColor: UIColor, borderWidth: CGFloat)
v5.4.0
v5.3.0
Enhancements
- UIViewControllerExtension:
var preview: some View
- BindingExtension:
static func mock(_ value: Value) -> Self {
- MutableCollection:
mutating func sort<T: Comparable>(by keyPath: KeyPath<Element, T>, order: (T, T) -> Bool = (<))
- SequenceExtension:
func sorted<T: Comparable>(by keyPath: KeyPath<Element, T>, order: (T, T) -> Bool = (<)) -> [Element]
- UITableViewExtension:
func register<T: UITableViewCell>(cellType: T.Type) where T: Reusable & NibLoadable
func register<T: UITableViewCell>(cellType: T.Type) where T: Reusable
func dequeueReusableCell<T: UITableViewCell>(for indexPath: IndexPath, cellType: T.Type = T.self) -> T where T: Reusable
func register<T: UITableViewHeaderFooterView>(headerFooterViewType: T.Type) where T: Reusable & NibLoadable
func register<T: UITableViewHeaderFooterView>(headerFooterViewType: T.Type) where T: Reusable
func dequeueReusableHeaderFooterView<T: UITableViewHeaderFooterView>(_ viewType: T.Type = T.self) -> T? where T: Reusable
- UICollectionViewCellExtension:
func register<T: UICollectionViewCell>(cellType: T.Type) where T: Reusable & NibLoadable
func register<T: UICollectionViewCell>(cellType: T.Type) where T: Reusable T.self) -> T where T: Reusable
func register<T: UICollectionReusableView>(supplementaryViewType: T.Type, ofKind elementKind: String) where T: Reusable & NibLoadable
func register<T: UICollectionReusableView>(supplementaryViewType: T.Type, ofKind elementKind: String) where T: Reusable
func dequeueReusableSupplementaryView<T: UICollectionReusableView>(ofKind elementKind: String, for indexPath: IndexPath, viewType: T.Type = T.self) -> T where T: Reusable
- Protocols:
protocol NibLoadable: AnyObject
protocol NibOwnerLoadable: AnyObject
protocol Reusable: AnyObject
typealias NibReusable = Reusable & NibLoadable
v5.2.0
Enhancements
- UIFontExtension:
class func dynamicStyle(_ style: UIFont.TextStyle, traits: UIFontDescriptor.SymbolicTraits?, sizeCategory: UIContentSizeCategory = .large) -> UIFont
- UILabelExtension:
func configureDynamicStyle(_ style: UIFont.TextStyle, traits: UIFontDescriptor.SymbolicTraits? = nil, minimumScaleFactor: CGFloat = 0.8)
- UITextFieldExtension:
func configureDynamicStyle(_ style: UIFont.TextStyle, traits: UIFontDescriptor.SymbolicTraits? = nil, adjustToFit: Bool = true)
- UITextViewExtension:
func configureDynamicStyle(_ style: UIFont.TextStyle, traits: UIFontDescriptor.SymbolicTraits? = nil)
Bugfixes
- Fixed missing swift sources added to the targets when using CocoaPods to embed SwiftyUtils
v5.1.0
Enhancements
- Completing missing unit tests
- Adding documentation to the code
- Adding
UIElementPreview
, an easy way to generate mulitple SwiftUI previews with different configuration - BundleExtension:
var displayName: String
- DictionaryExtension
func toData(options: JSONSerialization.WritingOptions = []) throws -> Data?
- DataExtension:
func toDictionary(options: JSONSerialization.ReadingOptions = []) throws -> [String: Any]?
- NSAttributedStringExtension:
func isAttributeActivated(_ attribute: NSAttributedString.Key, appliedOn text: String, value: Any) -> Bool
- UIApplicationExtension:
func openAppSettings()
func openAppStoreReviewPage(_ url: URL)
- UIButtonExtension:
func addRightImage(_ image: UIImage?, offset: CGFloat)
- UICollectionViewCellExtension:
func applyCornerRadius(_ radius: CGFloat)
func animate(scale: Bool, duration: TimeInterval = 0.35, transformScale: CGFloat = 0.97, damping: CGFloat = 0.7, options: UIView.AnimationOptions = [], delay: TimeInterval = 0.0, velocity: CGFloat = 0.0, completion: ((Bool) -> Void)? = nil)
- UIViewExtension:
func findView(forIdentifier identifier: String) -> UIView?
func addConstraints(to edges: UIRectEdge = .all, insets: UIEdgeInsets = .zero)
func applyCornerRadius(_ radius: CGFloat, maskedCorners: CACornerMask [.layerMaxXMaxYCorner, .layerMaxXMinYCorner, .layerMinXMaxYCorner, .layerMinXMinYCorner])
- UIViewController:
var isModal: Bool
func addChildController(_ controller: UIViewController, to subview: UIView, animated: Bool = true, duration: TimeInterval = 0.35, options: UIView.AnimationOptions = [.curveEaseInOut, .transitionCrossDissolve])
func addChild(_ child: UIViewController, in containerView: UIView)
func removeChildController(_ child: UIViewController)
func openSafariVC(withURL url: URL, delegate: SFSafariViewControllerDelegate, tintColor: UIColor = .black, barTintColor: UIColor = .white, barCollapsing: Bool = true)
- PropertyWrappers:
@UserDefaultsBacked(key: "defaults_key", defaultValue: 20)
var defaultValue: Int
@UserDefaultsBacked(key: "default_key2")
var defaultKey2: String?