SwifterSwift v4.4.0 Release Notes

Release Date: 2018-06-29 // almost 6 years ago
  • βž• Added

    • SKNode:
      • Added descendants method to get an array of all descendants of an SKNode. #490 by oliviabrown9.
    • Comparable:
      • Added isBetween(min:max:) and clamped(min:max:) to confirm a value is between bounds or limit it between bounds. #466 by freak4pc.
    • UIScrollView:
      • Added snapshot method to get a full snapshot of a rendered scroll view. #457 by aliamcami.
    • UIGestureRecognizer:
      • Added removeFromView() method to remove recognizer from the view the recognizer is attached to. #456 by mmdock
    • Character:
      • Added randomAlphanumeric() method to generate a random alphanumeric Character. #462 by oliviabrown9
    • String:
      • Added firstCharacterUppercased() method to return a string with only the first character uppercased. #505 by happiehappie
    • UITextView:
      • Added wrapToContent() method which will remove insets, offsets, paddings which lies within UITextView's bounds and contenSize. #458 by ratulSharker
    • URL
      • Added deletingAllPathComponents() and deleteAllPathComponents() to delete all path components from a URL. #441 by setoelkahfi.
      • Added queryValue(for:) to get the value of a query key from a URL. #467 by jdisho.
    • UITableView:
      • Added isValidIndexPath(_:) method to check whether given IndexPath is valid within UITableView. #441 by setoelkahfi.
      • Added safeScrollToRow(at:at:animated:) method to safely scroll UITableView to the given IndexPath. #445 by setoelkahfi.
      • Fixed lastSection, and indexPathForLastRow and indexPathForLastRow(inSection: 0) methods to get last section, get the lastIndexPath for section 0 if exists and get the lastIndexPath for a given section respectively . #694 by mohshin-shah.
    • Optional:
      • Added isNilOrEmpty property to check whether an optional is nil or empty collection.
    • UIWindow:
      • Added switchRootViewController method to switch root view controller with animation. #494 by omaralbeik.
    • Sequence
      • Added containsDuplicates() to check whether a sequence contains duplicates. #496 by MaxHaertwig.
      • Added single(where:) to get the only element of a sequence that matches a given condition. #483 by andlang.
    • UIStackView:
      • Added addArrangedSubviews(_ views: ) to add an array of views to the end of the arrangedSubviews array. #501 by omaralbeik.
      • Added removeArrangedSubviews to remove all views in stack’s array of arranged subviews. #501 by omaralbeik.
    • UIEdgeInsets
      • Added horizontal and vertical properties. Also init(inset:) and init(horizontal: vertical:) initializers for convenience. #500 by LucianoPAlmeida.

    πŸ”„ Changed

    • UITableView:
      • dequeueReusableCell(withClass:for), dequeueReusableCell(withClass) now return UITableViewCell object, fatalError(...) if not found. #439 by jdisho
      • dequeueReusableHeaderFooterView(withClass)now returns UITableViewHeaderFooterView object, fatalError(...) if not found. #439 by jdisho
    • UICollectionView:
      • dequeueReusableCell(withClass:for) now returns UICollectionViewCell object, fatalError(...) if not found. #439 by jdisho
      • dequeueReusableSupplementaryView(ofKind:withClass:for)now returns UICollectionReusableView object, fatalError(...) if not found. #439 by jdisho
    • UIView:
      • Breaking Change firstResponder UIView extension is now a function and supports recursive find in the view hierarchy. #447 by LucianoPAlmeida.
    • UIImage:
      • scaled(toWidth:, opaque:, with orientation:) and scaled(toHeight:, opaque:, with orientation:) now have an optional parameter for opaqueness. #446 by MaxHaertwig.
    • Array/Collection/Sequence
      • The conformance of sum(), last(where:), reject(where:), count(where:), forEachReversed(), forEach(where:, body:), accumulate(initial:, next:), filtered(_:, map:) and contains(_:) has been changed from Array to Sequence #470 by MaxHaertwig.
      • The conformance of average(), firstIndex(where:), lastIndex(where:), indices(where:), forEach(slice:, body:), group(by:), firstIndex(of:) and lastIndex(of:) has been changed from Array to Collection #470 by MaxHaertwig.
    • Dictionary
      • The removeAll(keys:) changed its paramenter keys to a generic Sequence instead of an Array. #482 by LucianoPAlmeida.

    πŸ—„ Deprecated

    🚚 >### Removed

    πŸ›  Fixed

    • UIImage:
      • scaled(toWidth:, with orientation:) and scaled(toHeight:, with orientation:) were ignoring an image's scale. #446 by MaxHaertwig.
      • init(color:size:) fixed to ensure that UIGraphicsEndImageContext is always called after UIGraphicsBeginImageContextWithOptions(_:_:_) #507 by guykogus