SwifterSwift v4.1.0 Release Notes
Release Date: 2017-11-16 // over 6 years ago-
API Breaking
- String
length
is deprecated, use nativecount
instead.slicing(i:)
is deprecated, usestring[safe: i]
instead.slicing(from: to:)
is deprecated, usestring[safe: start..<end]
.firstIndex(of:)
is deprecated, use the nativesindex(of: Character)
orrange(of: StringProtocol)
instead.splitted(by:)
is deprecated, use the nativesplit(separator: )
instead.reversed() -> String
is deprecated, use the Swift 4 newreversed() -> ReversedCollection<String>
. #305 by LucianoPAlmeida.
- Date
✨ Enhancements
- New String extensions
- added
padStart(length: with:)
andpadEnd(length: with:)
to pad the string to a length on the start or end. - added
paddingStart(length: with:)
andpaddingEnd(length: with:)
to return a padding string to a length on the start or end. #300 by LucianoPAlmeida
- added
- New NSImage extensions
- New Date extensions
- New Optional extensions
- New Calendar extensions
- added
numberOfDaysInMonth
to get number of days in the month for a specified date. #311 by chaithanyaprathyush.
- added
- New Color tests
- added tests for
cgFloatComponents
. #297 by stupergenius. - added
lighten(by percentage:)
anddarken(by percentage:)
methods to change the hue of a color. #325 by oettingerj.
- added tests for
- New CGColor tests
- New Date tests
- ⚡️ Updated Travis image to Xcode 9.1. #314 by kaphacius
- ✂ Removed cross references from extensions. #297 by stupergenius.
- Updated copyright headers to Copyright © 2017 SwifterSwift everywhere. #308 by camdeardorff.
🛠 Bugfixes
- Date
- complete rewrite for most extensions. #309 by [omaralbeik](https:github.com/omaralbeik)
- fixed a bug in
year
where setting year was resetting all smaller components to zero. - fixed a bug in
month
where setting month was resetting all smaller components to zero. - fixed a bug in
day
where setting day was resetting all smaller components to zero. - fixed a bug in
hour
where setting hour was resetting all smaller components to zero. - fixed a bug in
minute
where setting minute was resetting all smaller components to zero. - fixed a bug in
second
where setting second was resetting all smaller components to zero. - added validation to setters for properties above.
- fixed the above bugs in
changing
method as well. - fixed a bug where
quarter
was returning 1 always. - Added more tests to edge cases.
- String