Releases: tbaranes/SwiftyUtils
v3.0.0
v2.0.0
API breaking changes
- Xcode 9 and Swift 4 support
- Removing
String.length
, starting with swift 4, you can directly userString.count
Enhancements
- Each
UIButton
'sUIControlState
will be translated when usingtranslateSubviews
- UIApplicationExtension (iOS only)
public static func delegate<T: UIApplicationDelegate>(_ type: T.Type) -> T?
- NSMutableAttributedString:
public static func font(inText text: String, font: SwiftyFont, afterOcurrence occurence: String) -> NSMutableAttributedString
public func font(_ font: SwiftyFont, afterOcurrence occurence: String)
public static func font(inText text: String, font: SwiftyFont, occurences searchString: String) -> NSMutableAttributedString
public func font(_ font: SwiftyFont, occurences searchString: String)
Bugfixes
- Make Array subscript public
- No more duplicate letter when using String's
capitalizedFirst
v1.0.0
In order to reach 1.0, SwiftyUtils got a huge cleanup:
- Removing extensions /classes that didn't fit in the library's spirit
- Renaming methods to make them more Swifty
- Introducing dozens of new extensions
- Adding a few missing tests
- Updating the docs
- ...
Since that release contains a lot of changes we won't details them all.
We are really sorry to introduce that many breaking changes, but it was a mandatory cost to release 1.0! Also, the future release should have none (or a very low number) breaking changes and a lot of new features 🎉
Many thanks to Sweepr777 for reviewing all the PRs!
v0.7.0
API breaking changes
- Some APIs have been updated to follow the Swift 3 API guidelines, check out the README for more information
Enhancements
Note: Take a look into the README to see the details of all the following enhancements
- UILabelExtension (iOS only)
public func setLineHeight(_ lineHeight: CGFloat)
- CGRectExtension
public var x: CGFloat
public var y: CGFloat
public func with(x: CGFloat) -> CGRect
public func with(y: CGFloat) -> CGRect
public func with(width: CGFloat) -> CGRect
public func with(height: CGFloat) -> CGRect
public func with(origin: CGPoint) -> CGFloat
public func with(size: CGSize) -> CGFloat
- UIViewExtension and NSViewExtension
public var x: CGFloat
public var y: CGFloat
public var width: CGFloat
public var height: CGFloat
v0.6.0
API breaking changes
NSDate
is now used asDate
Enhancements
Note: Take a look into the README to see the details of all the following enhancements
New protocols available:
- Iteratable
New extensions:
- CGFloatLiteral (Integer / Float extension):
public var f: CGFloat
- Array
subscript(safe index: Int) -> Element?
- Sugar syntax for
Date
Too many things to be described here... check the README
- UILabelExtension (iOS only)
func isTruncated() -> Bool
func setText(_ text: String, truncatedText: String)
New extensions for macOS:
- NSView:
func convertLocalizables()
v0.5.0
API breaking changes
- Swift 3 support. README is up to date, please report if you find any diffs
- Some APIs have been updated to be more swifty, check out the README for more information
Classes removed:
- Async
Extensions removed:
- {UI/NS}Color:
convenience init(hex: String, alpha: Float)
- UIDevice:
class func deviceModel() -> String
Enhancements
Note: Take a look into the README to see the details of all the following enhancements
- watchOS support
New classes:
- UITesting
- UnitTesting
New iOS classes:
- Simulator
New extensions:
- Color:
var redComponent: Int
var greenComponent: Int
var blueComponent: Int
var alpha: CGFloat
- String:
init?(value: Float, maxDigits: Int)
init?(value: Double, maxDigits: Int)
- Bundle (now available for the fourth platforms):
var appName: String
var appVersion: String
var appBuild: String
var schemes: String
var mainScheme: String
New iOS extensions:
- UIStoryboard:
static var main: UIStoryboard
- UISwitch:
func toggle(animated: Bool = true)
- UIImage:
var original: UIImage
var template: UIImage
v0.4.0
API breaking changes
- Color extension initializer has been updated:
convenience init?(hexString: String)
convenience init?(hexString: String, alpha: Float)
becomes
convenience init(hex: String)
convenience init(hex: String, alpha: Float)
Enhancements
Note: Take a look into the README to see the details of all the following enhancements
New protocols available:
- Then
- NSBundle is now available for macOS
New extensions:
- Color:
func darker(amount: CGFloat = 0.25) -> SwiftyColor
func lighter(amount: CGFloat = 0.25) -> SwiftyColor
- UIImage:
func filled(with color: UIColor?) -> UIImage
v0.3.0
API breaking changes
- Creating an UIImage from UIColor is now more swifty:
UIImage(color: .orangeColor())
instead ofUIImage.imageWithTintColor(.orangeColor())
Enhancements
Note: Take a look into the README to see the details of all the following enhancements
New extensions:
- NSNotificationCenter:
func postNotification(name name: String, object: AnyObject? = nil, userInfo: [NSObject : AnyObject]? = nil, queue: dispatch_queue_t)
New iOS extensions:
- UIAlertController:
static func show(title title: String, message: String, cancelTitle: String = "OK")
- UIApplication:
func topViewController() -> UIViewController?
- UIDevice
func forceRotation(orientation: UIInterfaceOrientation)
v0.2.0
Enhancements
Note: Take a look into the README to see the details of all the following enhancements
New extensions:
- CollectionType:
func shuffle()
- MutableCollectionType:
func shuffleInPlace()
- NSLayoutConstraint:
func applyMultiplier(multiplier: CGFloat, toView: SwiftyView)
- NSURL:
func addSkipBackupAttribute()
- NSRange:
init(rangeOf textToFind: String, in text: String)
New iOS extensions:
- UIViewController:
func deletePreviousViewControllers()
func setupBackButton(hidden hidden: Bool = false, title: String = "", backIndicatorImage: UIImage? = nil, tintColor: UIColor? = UIColor.whiteColor())
func setupRightBarView(view: UIView)
func setupLeftBarView(view: UIView)