SwifterSwift v4.1.1 Release Notes

Release Date: 2018-01-06 // about 6 years ago
  • โž• Added

    • NSPredicate
      • Added operator ! to return a new predicate formed by NOT-ing a given predicate.
      • Added operator + to return a new predicate formed by AND-ing two given predicates.
      • Added operator | to return a new predicate formed by OR-ing a two given predicates.
      • Added operator - to return a new predicate formed by removing the argument from the second predicate. #345 by yycking.
    • NSAttributedString
      • Added attributes property to get the attributes that apply to a simple NSAttributedString. #333 by nathanbacon.
      • Added applying(attributes: , toRangesMatching: ) function to return an attributed string with attributes applied to substrings matching the passed regex pattern by nathanbacon.
      • Added applying(attributes: , toOccurrencesOf: ) function to return an attributed string with attributes applied to substrings matching the passed string by nathanbacon.
    • Array
      • Added sort(by: KeyPath) and sorted(by: KeyPath) to sort arrays based on Swift 4 keyPath. #343 by LucianoPAlmeida.
    • String
      • Added loremIpsum(ofLength: ) static function to return a lorem ipsum string. #318 by omaralbeik.
    • UIDatePicker
      • Added textColor to get and set the text color of a UIDatePicker. #328 by omaralbeik.
    • NSImage
      • Added write(to url: URL, fileType type: _, compressionFactor: _) to write NSImage to url. #320 by omaralbeik.
    • Date
      • Added random(from: Date, upTo: Date) -> Date method that return radom date in in the specified range #336 by akuzminskyi.
      • Added string(withFormat format: String) method to get a string from a date with the given format.
      • Added init?(integerLiteral value: Int) initializer to create date object from Int literal. #342 by n0an.
    • UIViewController

      • Added showAlert(title: String?, message: String?, buttonTitles: [String]?, highlightedButtonIndex: Int?, completion: ((Int) -> ())?) for conveniently displaying an alert from any view controller #364 by rkp1026 ### ๐Ÿ”„ Changed
    • Array

      • Breaking Change indexes(of:) has been renamed to indices(of:). #355 by Najdan
      • shuffle and shuffled are no more constrained to Equatable. #327 by LucianoPAlmeida.

    ๐Ÿ›  Fixed

    • Int
      • Fixed where the base in isPrime() was not correct. #323 by Asura19.
    • UINavigationBar
      • Fixed a bug where makeTransparent was keeping the background color. #344 by omaralbeik.
    • Continuous Integration
      • Fixed swiftlint warning in NSImageExtensions.