SwifterSwift v3.1.0 Release Notes
-
API Breaking
String
firstCharacter
has been renamed tofirstCharacterAsString
. #208 by @omaralbeiklastCharacter
has been renamed tolastCharacterAsString
. #208 by @omaralbeikfirstCharacter
has been renamed tofirstCharacterAsString
. #208 by @omaralbeikfloat
has been renamed tofloat(locale: Locale = .current)
. #208 by @omaralbeikdouble
has been renamed todouble(locale: Locale = .current)
. #208 by @omaralbeiksubscript(i: Int)
has been renamed tosubscript(safe i: Int)
. #208 by @omaralbeiksubscript(range: CountableRange<Int>)
has been renamed tosubscript(safe range: CountableRange<Int>)
. #208 by @omaralbeiksubscript(range: ClosedRange<Int>)
has been renamed tosubscript(safe range: ClosedRange<Int>)
. #208 by @omaralbeikreplacing(_ substring: String, with newString: String)
is deprecated, use Apple'sreplacingOccurrences(of: substring, with: newString)
instead. #208 by @omaralbeikint8
is deprecated, useInt8(string)
instead. #208 by @omaralbeikint16
is deprecated, useInt16(string)
instead. #208 by @omaralbeikint32
is deprecated, useInt32(string)
instead. #208 by @omaralbeikint64
is deprecated, useInt64(string)
instead. #208 by @omaralbeikfloat32
is deprecated, useFloat32(string)
instead. #208 by @omaralbeikfloat64
is deprecated, useFloat64(string)
instead. #208 by @omaralbeik
UIColor
init(hex: Int, transparency: CGFloat = 1)
is now a failable initializerinit?
. #208 by @omaralbeikinit(red: Int, green: Int, blue: Int, transparency: CGFloat = 1)
is now a failable initializerinit?
. #208 by @omaralbeikredComponent
is deprecated, use the newrgbComponenets.red
instead. #208 by @omaralbeikgreenComponent
is deprecated, use the newrgbComponenets.green
instead. #208 by @omaralbeikblueComponent
is deprecated, use the newrgbComponenets.blue
instead. #208 by @omaralbeik
โจ Enhancements
- New String extensions
- added
cgFloat(locale: Locale = .current)
to get CGFloat value from string. #208 by @omaralbeik - added
words
to return an array of all words in a string. #208 by @omaralbeik - added
wordCount
to get count of words in a string. #208 by @omaralbeik
- added
- New Int extensions
- added
countableRange
to get CountableRange 0..<Int. #208 by @omaralbeik - added
uInt
to get UInt from Int. #208 by @omaralbeik
- added
- New Array extensions
- added
group(size:)
to split in an array of slices of a size. #199. #208 by @LucianoPAlmeida - added
rotated(by:)
to return a new rotated array by the given places. #207 by @LucianoPAlmeida - added
rotate(by:)
to rotate the array by the given places. #207 by @LucianoPAlmeida
- added
- New UITextField extensions
- added
addPaddingLeftIcon(_ image: UIImage, padding: CGFloat)
to add padding to the left of the textfield rect. #203 by @xingfuqiu - added
hasValidEmail
to check if textFields text is a valid email format. #208 by @omaralbeik - added
textType
to set textField for common text types like email addresses & passwords. #208 by @omaralbeik
- added
- New UIColor extensions
- added
rgbComponenets
to get RGB components for a UIColor. #208 by @omaralbeik
- added
- โ Added usage examples in documentation for Foundation extensions. #208 by @omaralbeik
- ๐ Moved many duplicated extensions from
DoubleExtensions
andFloatExtensions
into the newFloatingPointExtensions
, this makes the code easier to maintain and brings support for other FloatingPoint types like CGFloat, Double32, ... #208 by @omaralbeik
๐ Bugfixes
- ๐ Fixed XCTAssertNotNil cannot handle optionals. #188. by @omaralbeik
- ๐ Fixed Tests are failing at non-english machine / Bug in String.double #187. by @omaralbeik