Commit 78163a30 by Daniel Dahan

development: preparation for Material 2.3.12 release

parent 9ad1b5cc
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '2.3.11' s.version = '2.3.12'
s.license = 'BSD-3-Clause' s.license = 'BSD-3-Clause'
s.summary = 'Material is an animation and graphics framework that is used to create beautiful applications.' s.summary = 'Material is an animation and graphics framework that is used to create beautiful applications.'
s.homepage = 'http://materialswift.com' s.homepage = 'http://materialswift.com'
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.3.11</string> <string>2.3.12</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -52,7 +52,7 @@ extension UIViewController { ...@@ -52,7 +52,7 @@ extension UIViewController {
open class CaptureController: ToolbarController { open class CaptureController: ToolbarController {
/// A reference to the Capture instance. /// A reference to the Capture instance.
@IBInspectable @IBInspectable
open private(set) var capture = Capture() open fileprivate(set) var capture = Capture()
open override var supportedInterfaceOrientations: UIInterfaceOrientationMask { open override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.portrait return UIInterfaceOrientationMask.portrait
......
...@@ -37,7 +37,7 @@ open class Card: PulseView { ...@@ -37,7 +37,7 @@ open class Card: PulseView {
} }
/// A container view for subviews. /// A container view for subviews.
open private(set) var container = UIView() open fileprivate(set) var container = UIView()
@IBInspectable @IBInspectable
open override var cornerRadiusPreset: CornerRadiusPreset { open override var cornerRadiusPreset: CornerRadiusPreset {
......
...@@ -52,7 +52,7 @@ extension UIViewController { ...@@ -52,7 +52,7 @@ extension UIViewController {
open class EditorController: ToolbarController { open class EditorController: ToolbarController {
/// A reference to the Editor instance. /// A reference to the Editor instance.
@IBInspectable @IBInspectable
open private(set) var editor = Editor() open fileprivate(set) var editor = Editor()
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
......
...@@ -268,6 +268,12 @@ extension CALayer { ...@@ -268,6 +268,12 @@ extension CALayer {
} else if let a = animation as? CATransition { } else if let a = animation as? CATransition {
add(a, forKey: kCATransition) add(a, forKey: kCATransition)
} }
if #available(iOS 10, *) {
Motion.delay(time: animation.duration) { [weak self, animation = animation] in
self?.animationDidStop(animation, finished: true)
}
}
} }
/** /**
...@@ -279,20 +285,29 @@ extension CALayer { ...@@ -279,20 +285,29 @@ extension CALayer {
if interrupted. if interrupted.
*/ */
open func animationDidStop(_ animation: CAAnimation, finished flag: Bool) { open func animationDidStop(_ animation: CAAnimation, finished flag: Bool) {
if let a = animation as? CAPropertyAnimation { guard let a = animation as? CAPropertyAnimation else {
if let b = a as? CABasicAnimation { if let a = (animation as? CAAnimationGroup)?.animations {
if let v = b.toValue { for x in a {
if let k = b.keyPath { animationDidStop(x, finished: true)
setValue(v, forKeyPath: k)
removeAnimation(forKey: k)
}
} }
} }
} else if let a = animation as? CAAnimationGroup { return
for x in a.animations! {
animationDidStop(x, finished: true)
}
} }
guard let b = a as? CABasicAnimation else {
return
}
guard let v = b.toValue else {
return
}
guard let k = b.keyPath else {
return
}
setValue(v, forKeyPath: k)
removeAnimation(forKey: k)
} }
/// Manages the layout for the shape of the view instance. /// Manages the layout for the shape of the view instance.
......
...@@ -50,7 +50,7 @@ extension UIViewController { ...@@ -50,7 +50,7 @@ extension UIViewController {
open class MenuController: RootController { open class MenuController: RootController {
/// Reference to the MenuView. /// Reference to the MenuView.
open private(set) var menu = Menu() open fileprivate(set) var menu = Menu()
/** /**
Opens the menu with a callback. Opens the menu with a callback.
......
...@@ -32,10 +32,10 @@ import UIKit ...@@ -32,10 +32,10 @@ import UIKit
open class MenuItem: View { open class MenuItem: View {
/// A reference to the titleLabel. /// A reference to the titleLabel.
open private(set) var titleLabel = UILabel() open fileprivate(set) var titleLabel = UILabel()
/// A reference to the button. /// A reference to the button.
open private(set) var button = FabButton() open fileprivate(set) var button = FabButton()
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
......
...@@ -71,6 +71,8 @@ public enum AnimationTimingFunction: Int { ...@@ -71,6 +71,8 @@ public enum AnimationTimingFunction: Int {
*/ */
public func AnimationTimingFunctionToValue(function: AnimationTimingFunction) -> CAMediaTimingFunction { public func AnimationTimingFunctionToValue(function: AnimationTimingFunction) -> CAMediaTimingFunction {
switch function { switch function {
case .default:
return CAMediaTimingFunction(name: kCAMediaTimingFunctionDefault)
case .linear: case .linear:
return CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear) return CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
case .easeIn: case .easeIn:
...@@ -79,8 +81,6 @@ public func AnimationTimingFunctionToValue(function: AnimationTimingFunction) -> ...@@ -79,8 +81,6 @@ public func AnimationTimingFunctionToValue(function: AnimationTimingFunction) ->
return CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut) return CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut)
case .easeInEaseOut: case .easeInEaseOut:
return CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) return CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
case .default:
return CAMediaTimingFunction(name: kCAMediaTimingFunctionDefault)
} }
} }
......
...@@ -307,7 +307,7 @@ extension Motion { ...@@ -307,7 +307,7 @@ extension Motion {
- Parameter duration: An animation time duration. - Parameter duration: An animation time duration.
- Returns: A CABasicAnimation. - Returns: A CABasicAnimation.
*/ */
public static func translation(size: CGSize, duration: CFTimeInterval? = nil) -> CABasicAnimation { public static func translate(size: CGSize, duration: CFTimeInterval? = nil) -> CABasicAnimation {
let animation = CABasicAnimation(keyPath: .translation) let animation = CABasicAnimation(keyPath: .translation)
animation.toValue = NSValue(cgSize: size) animation.toValue = NSValue(cgSize: size)
animation.fillMode = AnimationFillModeToValue(mode: .forwards) animation.fillMode = AnimationFillModeToValue(mode: .forwards)
...@@ -327,7 +327,7 @@ extension Motion { ...@@ -327,7 +327,7 @@ extension Motion {
- Parameter duration: An animation time duration. - Parameter duration: An animation time duration.
- Returns: A CABasicAnimation. - Returns: A CABasicAnimation.
*/ */
public static func translationX(by translation: CGFloat, duration: CFTimeInterval? = nil) -> CABasicAnimation { public static func translateX(by translation: CGFloat, duration: CFTimeInterval? = nil) -> CABasicAnimation {
let animation = CABasicAnimation(keyPath: .translationX) let animation = CABasicAnimation(keyPath: .translationX)
animation.toValue = translation as NSNumber animation.toValue = translation as NSNumber
animation.fillMode = AnimationFillModeToValue(mode: .forwards) animation.fillMode = AnimationFillModeToValue(mode: .forwards)
...@@ -347,7 +347,7 @@ extension Motion { ...@@ -347,7 +347,7 @@ extension Motion {
- Parameter duration: An animation time duration. - Parameter duration: An animation time duration.
- Returns: A CABasicAnimation. - Returns: A CABasicAnimation.
*/ */
public static func translationY(by translation: CGFloat, duration: CFTimeInterval? = nil) -> CABasicAnimation { public static func translateY(by translation: CGFloat, duration: CFTimeInterval? = nil) -> CABasicAnimation {
let animation = CABasicAnimation(keyPath: .translationY) let animation = CABasicAnimation(keyPath: .translationY)
animation.toValue = translation as NSNumber animation.toValue = translation as NSNumber
animation.fillMode = AnimationFillModeToValue(mode: .forwards) animation.fillMode = AnimationFillModeToValue(mode: .forwards)
...@@ -367,7 +367,7 @@ extension Motion { ...@@ -367,7 +367,7 @@ extension Motion {
- Parameter duration: An animation time duration. - Parameter duration: An animation time duration.
- Returns: A CABasicAnimation. - Returns: A CABasicAnimation.
*/ */
public static func translationZ(by translation: CGFloat, duration: CFTimeInterval? = nil) -> CABasicAnimation { public static func translateZ(by translation: CGFloat, duration: CFTimeInterval? = nil) -> CABasicAnimation {
let animation = CABasicAnimation(keyPath: .translationZ) let animation = CABasicAnimation(keyPath: .translationZ)
animation.toValue = translation as NSNumber animation.toValue = translation as NSNumber
animation.fillMode = AnimationFillModeToValue(mode: .forwards) animation.fillMode = AnimationFillModeToValue(mode: .forwards)
......
...@@ -143,7 +143,7 @@ public protocol NavigationDrawerControllerDelegate { ...@@ -143,7 +143,7 @@ public protocol NavigationDrawerControllerDelegate {
} }
@objc(NavigationDrawerController) @objc(NavigationDrawerController)
open class NavigationDrawerController: RootController, UIGestureRecognizerDelegate { open class NavigationDrawerController: RootController {
/** /**
A CGFloat property that is used internally to track A CGFloat property that is used internally to track
the original (x) position of the container view when panning. the original (x) position of the container view when panning.
...@@ -1075,7 +1075,7 @@ extension NavigationDrawerController { ...@@ -1075,7 +1075,7 @@ extension NavigationDrawerController {
} }
} }
extension NavigationDrawerController { extension NavigationDrawerController: UIGestureRecognizerDelegate {
/** /**
Detects the gesture recognizer being used. Detects the gesture recognizer being used.
- Parameter gestureRecognizer: A UIGestureRecognizer to detect. - Parameter gestureRecognizer: A UIGestureRecognizer to detect.
......
...@@ -101,7 +101,7 @@ public protocol PageTabBarControllerDelegate { ...@@ -101,7 +101,7 @@ public protocol PageTabBarControllerDelegate {
@objc(PageTabBarController) @objc(PageTabBarController)
open class PageTabBarController: RootController { open class PageTabBarController: RootController {
/// Reference to the PageTabBar. /// Reference to the PageTabBar.
open private(set) var pageTabBar = PageTabBar() open fileprivate(set) var pageTabBar = PageTabBar()
/// A boolean that indicates whether bounce is enabled. /// A boolean that indicates whether bounce is enabled.
open var isBounceEnabled: Bool { open var isBounceEnabled: Bool {
......
...@@ -50,7 +50,7 @@ extension UIViewController { ...@@ -50,7 +50,7 @@ extension UIViewController {
open class PhotoLibraryController: UIViewController { open class PhotoLibraryController: UIViewController {
/// A reference to a PhotoLibrary. /// A reference to a PhotoLibrary.
open private(set) var photoLibrary = PhotoLibrary() open fileprivate(set) var photoLibrary = PhotoLibrary()
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
......
...@@ -62,10 +62,10 @@ public protocol SearchBarDelegate { ...@@ -62,10 +62,10 @@ public protocol SearchBarDelegate {
open class SearchBar: Bar { open class SearchBar: Bar {
/// The UITextField for the searchBar. /// The UITextField for the searchBar.
open private(set) var textField = UITextField() open fileprivate(set) var textField = UITextField()
/// Reference to the clearButton. /// Reference to the clearButton.
open private(set) var clearButton: IconButton! open fileprivate(set) var clearButton: IconButton!
/// A reference to the delegate. /// A reference to the delegate.
open weak var delegate: SearchBarDelegate? open weak var delegate: SearchBarDelegate?
......
...@@ -61,7 +61,7 @@ open class SearchBarController: StatusBarController { ...@@ -61,7 +61,7 @@ open class SearchBarController: StatusBarController {
} }
/// Reference to the SearchBar. /// Reference to the SearchBar.
open private(set) var searchBar = SearchBar() open fileprivate(set) var searchBar = SearchBar()
open override func layoutSubviews() { open override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()
......
...@@ -91,7 +91,7 @@ extension UIViewController { ...@@ -91,7 +91,7 @@ extension UIViewController {
open class SnackbarController: RootController { open class SnackbarController: RootController {
/// Reference to the Snackbar. /// Reference to the Snackbar.
open private(set) var snackbar = Snackbar() open fileprivate(set) var snackbar = Snackbar()
/// A boolean indicating if the Snacbar is animating. /// A boolean indicating if the Snacbar is animating.
open internal(set) var isAnimating = false open internal(set) var isAnimating = false
......
...@@ -50,7 +50,7 @@ extension UIViewController { ...@@ -50,7 +50,7 @@ extension UIViewController {
open class StatusBarController: RootController { open class StatusBarController: RootController {
/// A reference to the statusBar. /// A reference to the statusBar.
open private(set) var statusBar = UIView() open fileprivate(set) var statusBar = UIView()
/// A boolean that indicates to hide the statusBar on rotation. /// A boolean that indicates to hide the statusBar on rotation.
open var shouldHideStatusBarOnRotation = true open var shouldHideStatusBarOnRotation = true
......
...@@ -159,14 +159,14 @@ open class Switch: UIControl { ...@@ -159,14 +159,14 @@ open class Switch: UIControl {
} }
/// Track view reference. /// Track view reference.
open private(set) var track: UIView { open fileprivate(set) var track: UIView {
didSet { didSet {
prepareTrack() prepareTrack()
} }
} }
/// Button view reference. /// Button view reference.
open private(set) var button: FabButton { open fileprivate(set) var button: FabButton {
didSet { didSet {
prepareButton() prepareButton()
} }
......
...@@ -186,7 +186,7 @@ open class TextField: UITextField { ...@@ -186,7 +186,7 @@ open class TextField: UITextField {
/// The placeholder UILabel. /// The placeholder UILabel.
@IBInspectable @IBInspectable
open private(set) var placeholderLabel = UILabel() open fileprivate(set) var placeholderLabel = UILabel()
/// Placeholder normal text /// Placeholder normal text
@IBInspectable @IBInspectable
...@@ -210,7 +210,7 @@ open class TextField: UITextField { ...@@ -210,7 +210,7 @@ open class TextField: UITextField {
/// The detailLabel UILabel that is displayed. /// The detailLabel UILabel that is displayed.
@IBInspectable @IBInspectable
open private(set) var detailLabel = UILabel() open fileprivate(set) var detailLabel = UILabel()
/// The detailLabel text value. /// The detailLabel text value.
@IBInspectable @IBInspectable
...@@ -253,7 +253,7 @@ open class TextField: UITextField { ...@@ -253,7 +253,7 @@ open class TextField: UITextField {
} }
/// A reference to the clearIconButton. /// A reference to the clearIconButton.
open private(set) var clearIconButton: IconButton? open fileprivate(set) var clearIconButton: IconButton?
/// Enables the clearIconButton. /// Enables the clearIconButton.
@IBInspectable @IBInspectable
...@@ -299,7 +299,7 @@ open class TextField: UITextField { ...@@ -299,7 +299,7 @@ open class TextField: UITextField {
} }
/// A reference to the visibilityIconButton. /// A reference to the visibilityIconButton.
open private(set) var visibilityIconButton: IconButton? open fileprivate(set) var visibilityIconButton: IconButton?
/// Enables the visibilityIconButton. /// Enables the visibilityIconButton.
@IBInspectable @IBInspectable
......
...@@ -81,7 +81,7 @@ open class ToolbarController: StatusBarController { ...@@ -81,7 +81,7 @@ open class ToolbarController: StatusBarController {
} }
/// Reference to the Toolbar. /// Reference to the Toolbar.
open private(set) var toolbar = Toolbar() open fileprivate(set) var toolbar = Toolbar()
/// Internal reference to the floatingViewController. /// Internal reference to the floatingViewController.
private var internalFloatingViewController: UIViewController? private var internalFloatingViewController: UIViewController?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment