All notable changes to this project will be documented in this file.
ADUtils
adheres to Semantic Versioning.
- Add
PrivacyInfo.xcprivacy
to comply with Apple new privacy requirements
- Handle default system font weights for SwiftUI
- Add largeTitle style in font tests
- Add
String.attributedString(arguments:defaultAttributes:formatAttributes:)
andString.attributedString(arguments:defaultAttributes:differentFormatAttributes:)
utility methods to createAttributedString
from a list of strings and attributes. - Add
String.attributedString(arguments:defaultAttributes:)
utility method to createAttributedString
from aString
format and a list ofAttributedString
. - Add helper init for
AttributeContainer
to create one with a configuration closure.
- Fix iOS and tvOS supported versions in Package.swift
- Remove MainActor attribute from
DynamicFontProvider
as it is not required
- Add Swift Concurrency support
- Add
UIRectEdge.horizontal
andUIRectEdge.vertical
utility static variables. - Add
NSDirectionalRectEdge.horizontal
andNSDirectionalRectEdge.vertical
utility static variables.
- Drop support for iOS 11, 12 and 13
- Drop support for tvOS 11, 12 and 13
- Drop support for Swift below 5.7
- Add scale parameter to
UIImage.ad_filled
.
- Add a SwiftUI Font provider in
DynamicFont
- Add a subspec
ADUtils/Security
bundling security related tools. - Add
PostInstallationKeychainCleaner
usingUserDefaults
to check if keychain has to be wiped at launch - Add
SecureArchiver
, leveragingCryptoKit
and theKeychain
to add an encryption layer toUserDefaults
- iOS 14.0+ gives a new property on navigationItem :
backButtonDisplayMode
.ad_hideBackButtonTitle
now uses it.
- Add SPM support #21 via Alexandre Podlewski
verifyOrNil(_:over:)
Optional.verifying(_:)
UIImage.ad_filled(with:size:)
UIButton.ad_setBackgroundColor(:forState:)
UICollectionView.dequeueSupplementaryView<U: ClassIdentifiable>(_:ofKind:at:)
dequeue generic reusable view fromUICollectionView
UICollectionView.register(supplementaryView:kind:)
register generic reusable view fromUICollectionView
HStackView(spacing:alignment:distribution:arrangedSubviews:)
VStackView(spacing:alignment:distribution:arrangedSubviews:)
Debounced
property wrapper no longer has a retain cycle
ADUtils
is now usable on extensionsUIView.ad_pinToSuperviewSafeAreaLayoutGuide(edges:insets:priority:)
UIView.ad_pinToSuperviewSafeAreaLayoutGuide(insets:priority:)
UIView.ad_pinToSuperviewSafeAreaLayoutGuide()
UIView.ad_pinToSuperviewSafeAreaLayoutGuide(insets:)
UIView.ad_pinToSuperviewSafeAreaLayoutGuide(edges:)
UIView.ad_pinToSuperviewSafeAreaLayoutGuide(edges:insets:)
func ad_centerInSuperviewSafeAreaLayoutGuide(along:priority:)
func ad_centerInSuperviewSafeAreaLayoutGuide(along:)
func ad_centerInSuperviewSafeAreaLayoutGuide(priority:)
func ad_centerInSuperviewSafeAreaLayoutGuide()
ad_constrainInSuperviewSafeAreaLayoutGuide(edges:insets:priority:)
ad_constrainInSuperviewSafeAreaLayoutGuide()
ad_constrainInSuperviewSafeAreaLayoutGuide(insets:)
ad_constrainInSuperviewSafeAreaLayoutGuide(edges:)
ad_constrainInSuperviewSafeAreaLayoutGuide(edges:insets:)
ad_pinToSuperviewSafeAreaLayoutGuide(directionalEdges:insets:priority:)
ad_pinToSuperviewSafeAreaLayoutGuide(insets:priority:)
ad_pinToSuperviewSafeAreaLayoutGuide(insets:)
ad_pinToSuperviewSafeAreaLayoutGuide(directionalEdges:)
ad_pinToSuperviewSafeAreaLayoutGuide(directionalEdges:insets:)
ad_constrainInSuperviewSafeAreaLayoutGuide(directionalEdges:insets:priority:)
ad_constrainInSuperviewSafeAreaLayoutGuide(insets:)
ad_constrainInSuperviewSafeAreaLayoutGuide(directionalEdges:)
ad_constrainInSuperviewSafeAreaLayoutGuide(directionalEdges:insets:)
ProxyDetector
is now created with aProxyDetectorWindowProvider
allowing to embed it in extensions
ADUtils/Swift-ext
andADUtils/objc-ext
are no longer supported, asADUtils
is now usable on extensions
- Create
UINavigationController.ad_popViewController(animated:completion:)
- Create methods to set and layout
UITableView
header and footer
- Create
UIScreen.ad_pixelDimension
- Create
Optional.get()
- Create
UINavigationItem.ad_hideBackButtonTitle()
- Create
UITableView.ad_hideDefaultFooterCells()
- Create layout functions for iOS and tvOS 13+ using
NSDirectionalRectEdges
andNSDirectionalEdgeInsets
- Create
UIViewController.ad_insert(child:in:usingDirectionalEdges:)
- Create
UIViewController.ad_insert(child:in:usingDirectionalEdges:)
- Create
UILayoutGuide.ad_pin(to:directionalEdges:insets:priority:)
- Create
UILayoutGuide.ad_pin(to:directionalInsets:priority:)
- Create
UILayoutGuide.ad_pin(to:usingDirectionalEdges:)
- Create
UILayoutGuide.ad_pin(to:directionalEdges:)
- Create
UILayoutGuide.ad_pin(to:directionalInsets:)
- Create
UILayoutGuide.ad_pin(to:directionalEdges:insets:)
- Create
UILayoutGuide.ad_constrain(in:directionalEdges:insets:priority:)
- Create
UILayoutGuide.ad_constrain(in:usingDirectionalEdges:)
- Create
UILayoutGuide.ad_constrain(in:directionalInsets:)
- Create
UILayoutGuide.ad_constrain(in:directionalEdges:)
- Create
UILayoutGuide.ad_constrain(in:directionalEdges:insets:)
- Create
UILayoutGuide.constrainInOwningView(directionalEdges:insets:priority:)
- Create
UILayoutGuide.constrainInOwningView(directionalEdges:insets:)
- Create
UILayoutGuide.constrainInOwningView(directionalEdges:)
- Create
UILayoutGuide.constrainInOwningView(directionalInsets:)
- Create
UILayoutGuide.constrainInOwningView(usingDirectionalEdges:)
- Create
UILayoutGuide.ad_pinToOwningView(directionalEdges:insets:priority:)
- Create
UILayoutGuide.constrainInOwningView(directionalEdges:insets:)
- Create
UILayoutGuide.constrainInOwningView(directionalEdges:)
- Create
UILayoutGuide.constrainInOwningView(directionalInsets:)
- Create
UILayoutGuide.constrainInOwningView(usingDirectionalEdges:)
- Create
UIView.ad_constrainInSuperview(directionalEdges:insets:priority:)
- Create
UIView.ad_constrainInSuperview(directionalEdges:insets:)
- Create
UIView.ad_constrainInSuperview(directionalEdges:)
- Create
UIView.ad_constrainInSuperview(directionalInsets:)
- Create
UIView.ad_constrainInSuperview(usingDirectionalEdges:)
- Create
UIView.ad_pinToSuperview(directionalEdges:insets:priority:)
- Create
UIView.ad_pinToSuperview(directionalEdges:insets:)
- Create
UIView.ad_pinToSuperview(directionalEdges:priority:)
- Create
UIView.ad_pinToSuperview(directionalEdges:)
- Create
UIView.ad_pinToSuperview(directionalInsets:)
- Create
UIView.ad_pinToSuperview(usingDirectionalEdges:)
- Create
UIView.ad_pin(to:directionalEdges:insets:priority:)
- Create
UIView.ad_pin(to:directionalEdges:priority:)
- Create
UIView.ad_pin(usingDirectionalEdges:)
- Create
UIView.ad_pin(to:directionalInsets:)
- Create
UIView.ad_pin(to:directionalEdges:)
- Create
UIView.ad_pin(to:directionalEdges:insets:)
- Create
UIView.ad_constrain(in:directionalEdges:insets:priority:)
- Create
UIView.ad_constrain(usingDirectionalEdges:)
- Create
UIView.ad_constrain(in:directionalInsets:)
- Create
UIView.ad_constrain(in:directionalEdges:)
- Create
UIView.ad_constrain(in:directionalEdges:insets:)
- Create
NSDirectionalEdgeInsets+Utilities
extension
- Add left to right and right to left tests cases for iOS and tvOS 13+ when layout,
NSDirectionalRectEdges
andNSDirectionalEdgeInsets
are involved
- Allow user to choose computation type for ad_preferredLayoutSize method
- Create
UIView.ad_preferredLayoutSize(fittingWidth:)
- Create
UIView.ad_preferredLayoutSize(fittingHeight:)
- Create
UICollectionViewCell.ad_preferredCellLayoutSize(fittingWidth:)
- Create
UICollectionViewCell.ad_preferredCellLayoutSize(fittingHeight:)
- Create
@Debounced
property wrapper andDebouncer
class
- Remove side effects on contentView when calling
UIView.ad_preferredLayoutHeight(fittingWidth:)
,UITableViewCell.ad_preferredCellLayoutHeight(fittingWidth:)
,UICollectionViewCell.ad_preferredCellLayoutHeight(fittingWidth:)
andUITableViewHeaderFooterView.ad_preferredContentViewLayoutHeight(fittingWidth:)
UICollectionViewCell.ad_preferredCellLayoutHeight(fittingWidth:)
is now deprecated
Sequence
:ad_groupedBy(grouping:)
now uses theDictionary(grouping:by:)
function from standard library
- Utils: create
ad_removeAllArrangedSubviews
andad_addArrangedSubviews
methods onUIStackView
- Project now asks for swift 5.0
- Fixed some warnings regarding missing imports
- Fixed some warnings using @unknown default in enums
- Fixed possible retain cycles on
NavigationControllerObserver
attributedString(arguments:defaultAttributes:differentFormatAttributes:)
handles correctly variable-width unicode characters (like emojis) in the string format
- Set minimal requirements to iOS 10.0
DynamicFont
is now compliant with App Extensions
MKMapView
: adddequeueAnnotationView<U: MKAnnotationView>(annotationView:, annotation:) -> U
to dequeueMKAnnotationView
s similarly to cells and headers inTable|CollectionView
- Dequeuing methods for
UITableView
andUICollectionView
now have an optional parameter to indicate the class of the dequeued element, allowing to write for instancelet cell = tableView.dequeue(SomeTableViewCell.self, at: indexPath)
instead oflet cell: SomeTableViewCell = tableView.dequeue(at: indexPath)
JSONDecoder
andPropertyListDecoder
: addad_safelyDecodeArray<T>(of type: T.Type, from data: Data)
to decode a top-level array of values of the given type from the given JSON representation. If the decoding of a value fails, it is ignored and will not be present in the final arrayKeyedDecodingContainer
: addad_safelyDecodeArray<T>(of type: T.Type, forKey key: KeyedDecodingContainer.Key)
to decode an array of values of the given type for the given key. If the decoding of a value fails, it is ignored and will not be present in the final arrayCollection
ofNSLayoutConstraint
: addactivate()
which activate each constraint in the collectionCollection
ofNSLayoutConstraint
: adddeactivate()
which deactivate each constraint in the collection
UIViewController
: addad_insert(child:in:)
to insert a child viewController in a layoutGuide instead of a viewNSLayoutConstraint
: addpriority(_:)
that returns the constraint with the given priorityUILayoutPriority
: addapplyIfPossible
which is.required - 1
UITableViewHeaderFooterView
: addad_preferredContentViewLayoutHeight(fittingWidth:)
UILayoutGuide
: addad_pinTo(_: edges: UIRectEdge, insets: UIEdgeInsets, priority: UILayoutPriority)
UILayoutGuide
: addad_center(in: along axis: NSLayoutConstraint.Axis, priority: UILayoutPriority)
UILayoutGuide
: addad_constrain(in: edges: UIRectEdge, insets: UIEdgeInsets, priority: UILayoutPriority)
UILayoutGuide
: addad_constrain(to size: CGSize, priority: UILayoutPriority)
- Update pods for Xcode 10.2
UIView
: Add missing methodad_pinToLayoutGuide:insets:priority:
UILayoutGuide
: addad_pinToOwningView(edges: UIRectEdge, insets: UIEdgeInsets, priority: UILayoutPriority)
UILayoutGuide
: addad_centerInOwningView(along axis: NSLayoutConstraint.Axis, priority: UILayoutPriority)
UILayoutGuide
: addad_constrainInOwningView(edges: UIRectEdge, insets: UIEdgeInsets, priority: UILayoutPriority)
UILayoutGuide
: addad_constrain(to size: CGSize, priority: UILayoutPriority)
- Layout: method creating constraints now return an array containing thoses constraints as
@discardableResult
- Layout: create
ad_constrainInSuperview(edges:insets:priority:)
- LayoutGuide: create
ad_pin(to:edges:insets:priority:)
,ad_center(in:along:priority:)
,ad_center(in:priority:)
,ad_constrain(in:edges:insets:priority:)
UIEdgeInsets
: addinit(top:)
,init(bottom:)
,init(left:)
,init(right:)
- Utils: create
ad_isBlank
method onString?
Sequence
: createad_groupedBy(grouping:)
method
DeselectableView
: renamesmoothlyDeselectItems
toad_smoothlyDeselectItems
and makeDeselectableView
protocol private- Layout: rename
ad_constraint(to:with:)
toad_constrain(to:priority:)
- Layout: rename
ad_centerInSuperview(with:)
toad_centerInSuperview(priority:)
andad_centerInSuperview(along:with:)
toad_centerInSuperview(along:priority:)
UIEdgeInsets
: renamehorizontal
andvertical
properties tototalHorizontal
andtotalVertical
- Add missing unit tests (Swift & ObjC)
- Create
UICollectionViewCell.ad_preferredCellLayoutHeight(fittingWidth:)
- Swift 4.2 support
- Remove
EnumCollection
with Swift 4.2
- Fix layout tests
ad_filter(query:keyPath:)
now performs search insensitively to diacritics on iOS9+
NavigationControllerObserver
: add methods to stop observing view controllers
- Add objc methods from DeselectableView UITableView and UICollectionView implementations.
- Create subspecs to be used in application extension, removing application related code.
- Add documentation, readme, licence for opensource purpose.
- Pod source is now on Github.
attributedString(arguments:defaultAttributes:differentFormatAttributes:)
handles array of arguments bigger than 9 elements
ad_fromNib
is not optional anymore, meaning we do not have to specify the return type
ad_fromNib
type inference comes from the calling class instead of the generic return type
- Utils:
ad_filter(query: String, for keyPaths: [KeyPath<Element, String>])
to filter an array with a query (e.g search bar content) for specified keypaths.
- Fixed some deprecation warnings
- PropertyListArchiver: the PropertyListArchiver enables to set primitive types values for a given key and read them as well
- Layout:
ad_constraint(to size: CGSize)
second item is now nil as supposed to for height and width constraints - Layout:
ad_constraint(to size: CGSize)
second attribute is now notAnAttribute as supposed to for height and width constraint
- Layout:
UITableViewCell.ad_preferredCellLayoutHeight(fittingWidth: CGFloat)
calculates the height of the cell content view - Layout:
UIView.ad_preferredLayoutHeight(fittingWidth:)
andUIView.ad_preferredLayoutWidth(fittingHeight:)
UIView.ad_preferredLayoutSize(fittingSize:lockDirections:)
DynamicFont
is now able to use system font insideFontDescription
- Add
ad_localizedUppercaseString
andlocalized
for Objective-C files
- Layout:
ad_centerInSuperview(along axis:UILayoutConstraintAxis)
creates a constraint between centerX/Y anchors of a view and its superView - Layout:
ad_centerInSuperView()
creates constraints to center a view in its superview along both axes - Layout:
ad_constraint(to size:CGSize)
constraints a view width and height with the provided size - Layout: All method that create constraints now enable to take a priorityLayout parameter (default is
UILayoutPriority.required
) PropertyListArchiver
:array(for key: String)
decodes data for key and returns an empty array if no data is found- Unit tests are run to validate every commit
- Unit tests: Fix
PropertyListArchiver
unit tests - Do not notify proxy on simulator
NavigationControllerObserver
: fix a bug where bookeeping was done too late and view controller was not observed anymore
- Use
Decodable
instead ofPropertyListReadable
inPropertyListArchiver
- Add
center
toCGRect
DynamicFontProvider
: an helper to provide dynamic type with custom font before iOS 11
ProxyDetector
: Provide a way to notify the user if a proxy is running on the phone
ad_localizedUppercaseString
is now deprecated after iOS 9
- Swift 4 support
NavigationControllerObserver
: TheNavigationControllerObserver
class provides a simple API to observe the pop transitions that occur in a navigationController stack. One drawback ofUINavigationController
is that its delegate is shared among multiple view controllers and this requires a lot of bookkeeping to register multiple delegates.NavigationControllerObserver
allows to register a delegate per viewController we want to observe. What's more the class provides a navigationControllerDelegate property used to forward all theUINavigationControllerDelegate
methods to another navigationController delegate if need be.- important: The
NavigationControllerObserver
will observe only animated pop transitions. Indeed, if you callpopViewController(animated: false)
you won't be notified.
- UIView + preferred layout size: Provides the preferred layout size for the view, this is the smallest size the view and its content can fit. You should populate the view before calling this method
- Optional + unwrap: Provides syntactic sugar to unwrap and execute a closure with an optional
- Add parameters owner and bundle in
ad_fromNib
method