SwifterSwift v5.3.0 Release Notes
-
๐ฅ Breaking Change
- Sequence
- UIView
- Rename
shadowColor
,shadowOffset
,shadowOpacity
andshadowRadius
tolayerShadowColor
,layerShadowOffset
,layerShadowOpacity
andlayerShadowRadius
to avoid naming collisions with subclasses properties defined in other modules e.g. UIKit. #897 by LucianoPAlmeida - Rename
borderColor
,borderWidth
andcornerRadius
tolayerBorderColor
,layerBorderWidth
, andlayerCornerRadius
to avoid naming collisions with subclasses properties defined in other modules e.g. UIKit. #972 by Jayxiang
- Rename
โ Added
- SCN3Vector
- Added
normalized
method, and basic division functions (SCNVector3 / scalar
, andSCNVector3 /= scalar
. #908 by thisIsTheFoxe
- Added
- Dictionary
- Added
pick(keys:)
to pick part of a dictionary with specified keys. #911 by MaratIbragimov
- Added
- UIScrollView
- โ XCTest
- BinaryInteger
- Added
bytes
andinit?(bytes:)
to make it easier to work with bytes (as[UInt8]
). #987 by thisIsTheFoxe
- Added
- FloatingPoint
- Collection
- UIViewController:
- String:
- Added
fullNSRange
,range(from:)
,nsRange(from:)
andsubscript
for converting betweenRange<String.Index>
andNSRange
. #902 by guykogus - Overloaded Swift's 'contains' operator (
~=
) forString
to check regex matching. #858 by VatoKo regexEscaped
, which returns an escaped string for inclusion in a regex pattern- Added
matches(regex:options:)
and the~= regex
to check directly against NSRegularExpression. Also addedreplacingOccurrences(regex:template:options:searchRange:)
as a more convenient way to replace NSRegularExpressions. #901 by gurgeous
- Added
- DispatchQueue:
- RangeReplaceableCollection:
- Sequence:
- Added
contains(_:)
forHashable
elements for performance improvement. #912 by guykogus - Added
first(where:equals:)
to find the first element of the sequence with having property by given key path equals to given value. #836 by hamtiko - Added
last(where:equals:)
to find the last element of the sequence with having property by given key path equals to given value. #838 by hamtiko
- Added
- SKNode:
- CGSize:
- WKWebView:
- HKActivitySummary:
- Added
isStandGoalMet
,isExerciseTimeGoalMet
, andisEnergyBurnedGoalMet
. #875 by lhygilbert
- Added
- UIView:
- Added
masksToBounds
(IBInspectable) extension. #877 by hamtiko - Added
loadFromNib(withClass:)
, which loads a UIView of a particular type from a nib file. #885 by gurgeous - Added
findConstraint
for finding an existing constraint. #886 by gurgeous - Added
widthConstraint
,heightConstraint
,leadingConstraint
,trailingConstraint
,topConstraint
, andbottomConstraint
for finding specific constraints. #886 by gurgeous - Added
UIView.subviews(ofType:)
extension which returns all the subviews of a given type recursively in the view hierarchy rooted on the view it its called. #993 by ashercoelho - Added
UIStackView.swap(_ view1:, _ view2:)
extension which exchanges two views that are arranged in the stack. #989 by salahamassi
- Added
- UIImage
- Added
averageColor
, which calculates the average UIColor for an entire image. #884 by gurgeous - Added
withAlwaysOriginalTintColor(_:)
returns a new version of the image with a tint color that uses the .alwaysOriginal rendering mode. #886 by [jayxiang][https://github.com/jayxiang]
- Added
- StringProtocol
- Measurement
- Added
.degrees(_:)
,arcMinutes(_:)
,arcSeconds(_:)
,radians(_:)
,gradians(_:)
andrevolutions(_:)
to conveniently initialize measurement with corresponding unit. #936 by Shiva Huang
- Added
- UITextField
- Added
addToolbar(items:height:)
to add a toolbar to aUITextField
. #954 by Randhir Kumar
- Added
- URL
- Added the
(unsafeString: String)
initializer forURL
as a more conveniently to construct unsafeURL
s fromString
by jevonmao
- Added the
- MKMultiPoint
- Added
.coordinates
property, to return an array of coordinates for the providedMKMultiPoint
. #990 by @rizwankce.
- Added
- NSAttributedString
- Added
Array.joined(separator:)
to create a newNSAttributedString
by concatenating the elements of the sequence, adding the given separator between each element. #985 by Roman Podymov.
- Added
- UIButton
- Added
setAttributedTitleForAllStates
,attributedTitleForDisabled
,attributedTitleForHighlighted
,attributedTitleForNormal
andattributedTitleForSelected
for convenient work with attributed strings. #1001 by Roman Podymov.
- Added
- Digest
- Added
hexString
to get a hexadecimal representation for all digest typed inCryptoKit
(e.g.SHA216Digest
,SHA512Digest
,MD5Digest
, ...). #1026 by Marco Eidinger.
- Added
๐ Changed
- NSAttributedString:
- Color:
- Refactored
init(light:dark:)
to remove deployment target version restrictions. #844 by VincentSit. - Use
enum
to declare namespace instead of usingstruct
. Thus private initializer is no longer needed. #927 by Shiva Huang - Add
init?(argbHexString:)
to support the common ARGB format used in Android. #971 by yonat
- Refactored
- CAGradientLayer:
- UITextField:
- UIAlertController:
- Mark
show
method as unavailable foriOSAppExtension
targets. #918 by LucianoPAlmeida
- Mark
- UIRefreshControl:
- SKSpriteNode:
- Added
aspectFill(to:)
to size SKSpriteNode with respect to aspect ratio. #490 by erikdrobne.
- Added
๐ Deprecated
- Sequence:
- Marked
map(by:)
,compactMap(by:)
,filter(by:)
as deprecated in favor use of Key Path expressions as functions feature in Swift 5.3. #862 by Roman Podymov.
- Marked
โ Removed
- UIDatePicker
- MKPolyline
- Removed
.coordinates
property, in favour of.coordinates
property fromMKMultiPoint
. SinceMKPolyline
extends fromMKMultiPoint
it should work fine. #990 by @rizwankce.
- Removed
๐ Fixed
- Collection
- CAGradientLayer:
- CAGradientLayer extensions inaccessible through internal level protection. #856 by Den Andreychuk.
- StringExtensions.swift:
- Fixed a bug: When the length of a string is 0, calling truncated method will crash. #866 by phil zhang
- Fixed
String.base64Decoded
making it a safe decode by ignore non-base64 characters. #961 by Jayxiang
- UITextField
- UIImage
- UIView
- ColorExtension:
- Fixed a bug:
Color.FlatUI
can be initialized. by Shiva Huang - Fixed
Color.init?(hexString: String, transparency: CGFloat = 1)
was not handling uppercase0X
in hex prefix #947 by Zero.D.Saber
- Fixed a bug:
- URLExtension
๐ Security