Commit 414b7820 by Daniel Dahan

issue-450: Fixed issue where initializers were missing the prepareView call

parent aa98b4dc
...@@ -116,8 +116,9 @@ extension AppLeftViewController: UITableViewDelegate { ...@@ -116,8 +116,9 @@ extension AppLeftViewController: UITableViewDelegate {
if let v: NavigationController = navigationDrawerController?.rootViewController as? NavigationController { if let v: NavigationController = navigationDrawerController?.rootViewController as? NavigationController {
switch item.text { switch item.text {
case "Orange": case "Orange":
navigationDrawerController?.transitionFromRootViewController(OrangeViewController()) // navigationDrawerController?.transitionFromRootViewController(OrangeViewController())
// v.pushViewController(OrangeViewController(), animated: true) // v.pushViewController(OrangeViewController(), animated: true)
navigationDrawerController?.transitionFromRootViewController(NavigationController(rootViewController: OrangeViewController()))
case "Purple": case "Purple":
v.pushViewController(PurpleViewController(), animated: true) v.pushViewController(PurpleViewController(), animated: true)
case "Green": case "Green":
......
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '1.42.2' s.version = '1.42.3'
s.license = 'BSD-3-Clause' s.license = 'BSD-3-Clause'
s.summary = 'An animation and graphics framework for Material Design in Swift.' s.summary = 'An animation and graphics framework for Material Design in Swift.'
s.homepage = 'http://cosmicmind.io' s.homepage = 'http://cosmicmind.io'
......
...@@ -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>1.42.2</string> <string>1.42.3</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -69,6 +69,7 @@ public class BottomNavigationController : UITabBarController, UITabBarController ...@@ -69,6 +69,7 @@ public class BottomNavigationController : UITabBarController, UITabBarController
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView()
} }
/** /**
...@@ -78,6 +79,7 @@ public class BottomNavigationController : UITabBarController, UITabBarController ...@@ -78,6 +79,7 @@ public class BottomNavigationController : UITabBarController, UITabBarController
*/ */
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
prepareView()
} }
public init() { public init() {
......
...@@ -184,6 +184,7 @@ public class BottomTabBar : UITabBar { ...@@ -184,6 +184,7 @@ public class BottomTabBar : UITabBar {
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView()
} }
/** /**
......
...@@ -318,6 +318,7 @@ public class MaterialButton : UIButton { ...@@ -318,6 +318,7 @@ public class MaterialButton : UIButton {
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
contentEdgeInsetsPreset = .None contentEdgeInsetsPreset = .None
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView()
} }
/** /**
......
...@@ -420,6 +420,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView { ...@@ -420,6 +420,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
shape = .None shape = .None
contentsGravityPreset = .ResizeAspectFill contentsGravityPreset = .ResizeAspectFill
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView()
} }
/** /**
......
...@@ -124,6 +124,7 @@ public class MaterialCollectionView : UICollectionView { ...@@ -124,6 +124,7 @@ public class MaterialCollectionView : UICollectionView {
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView()
} }
/** /**
......
...@@ -420,6 +420,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell { ...@@ -420,6 +420,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
shape = .None shape = .None
contentsGravityPreset = .ResizeAspectFill contentsGravityPreset = .ResizeAspectFill
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView()
} }
/** /**
......
...@@ -116,6 +116,7 @@ public class MaterialLabel : UILabel { ...@@ -116,6 +116,7 @@ public class MaterialLabel : UILabel {
wrapped = true wrapped = true
contentsScale = MaterialDevice.scale contentsScale = MaterialDevice.scale
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView()
} }
/** /**
......
...@@ -254,6 +254,7 @@ public class MaterialLayer : CAShapeLayer { ...@@ -254,6 +254,7 @@ public class MaterialLayer : CAShapeLayer {
public override init(layer: AnyObject) { public override init(layer: AnyObject) {
contentsGravityPreset = .ResizeAspectFill contentsGravityPreset = .ResizeAspectFill
super.init() super.init()
prepareVisualLayer()
} }
/// A convenience initializer. /// A convenience initializer.
......
...@@ -46,6 +46,7 @@ public enum MaterialSwitchSize { ...@@ -46,6 +46,7 @@ public enum MaterialSwitchSize {
case Large case Large
} }
@objc(MaterialSwitchDelegate)
public protocol MaterialSwitchDelegate { public protocol MaterialSwitchDelegate {
/** /**
A MaterialSwitch delegate method for state changes. A MaterialSwitch delegate method for state changes.
...@@ -54,6 +55,7 @@ public protocol MaterialSwitchDelegate { ...@@ -54,6 +55,7 @@ public protocol MaterialSwitchDelegate {
func materialSwitchStateChanged(control: MaterialSwitch) func materialSwitchStateChanged(control: MaterialSwitch)
} }
@objc(MaterialSwitch)
@IBDesignable @IBDesignable
public class MaterialSwitch : UIControl { public class MaterialSwitch : UIControl {
/// An internal reference to the switchState public property. /// An internal reference to the switchState public property.
...@@ -115,7 +117,7 @@ public class MaterialSwitch : UIControl { ...@@ -115,7 +117,7 @@ public class MaterialSwitch : UIControl {
} }
/// An Optional delegation method. /// An Optional delegation method.
public var delegate: MaterialSwitchDelegate? public weak var delegate: MaterialSwitchDelegate?
/// Indicates if the animation should bounce. /// Indicates if the animation should bounce.
@IBInspectable public var bounceable: Bool = true { @IBInspectable public var bounceable: Bool = true {
......
...@@ -281,6 +281,7 @@ public class MaterialTableViewCell : UITableViewCell { ...@@ -281,6 +281,7 @@ public class MaterialTableViewCell : UITableViewCell {
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView()
} }
/** /**
......
...@@ -364,6 +364,7 @@ public class MaterialView : UIView { ...@@ -364,6 +364,7 @@ public class MaterialView : UIView {
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
contentsGravityPreset = .ResizeAspectFill contentsGravityPreset = .ResizeAspectFill
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView()
} }
/** /**
......
...@@ -268,6 +268,7 @@ public class NavigationBar : UINavigationBar { ...@@ -268,6 +268,7 @@ public class NavigationBar : UINavigationBar {
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView()
} }
/** /**
......
...@@ -272,7 +272,7 @@ public class NavigationDrawerController : RootController, UIGestureRecognizerDel ...@@ -272,7 +272,7 @@ public class NavigationDrawerController : RootController, UIGestureRecognizerDel
A Boolean property that triggers the status bar to be hidden A Boolean property that triggers the status bar to be hidden
when the leftView is opened. Defaults to true. when the leftView is opened. Defaults to true.
*/ */
@IBInspectable public var enableHideStatusbar: Bool = true @IBInspectable public var enableHideStatusBar: Bool = true
/// Sets the statusBar to hidden or not. /// Sets the statusBar to hidden or not.
public private(set) var statusBarHidden: Bool = false public private(set) var statusBarHidden: Bool = false
...@@ -1042,7 +1042,7 @@ public class NavigationDrawerController : RootController, UIGestureRecognizerDel ...@@ -1042,7 +1042,7 @@ public class NavigationDrawerController : RootController, UIGestureRecognizerDel
/// Hides the statusBar. /// Hides the statusBar.
private func hideStatusBar() { private func hideStatusBar() {
if enableHideStatusbar { if enableHideStatusBar {
if !statusBarHidden { if !statusBarHidden {
statusBarHidden = true statusBarHidden = true
dispatch_async(dispatch_get_main_queue(), { [weak self] in dispatch_async(dispatch_get_main_queue(), { [weak self] in
......
...@@ -69,6 +69,7 @@ public class RootController : UIViewController { ...@@ -69,6 +69,7 @@ public class RootController : UIViewController {
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView()
} }
/** /**
...@@ -78,6 +79,7 @@ public class RootController : UIViewController { ...@@ -78,6 +79,7 @@ public class RootController : UIViewController {
*/ */
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
prepareView()
} }
/** /**
......
...@@ -338,6 +338,7 @@ public class TextField : UITextField { ...@@ -338,6 +338,7 @@ public class TextField : UITextField {
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView()
} }
/** /**
......
...@@ -305,6 +305,7 @@ public class TextView: UITextView { ...@@ -305,6 +305,7 @@ public class TextView: UITextView {
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView()
} }
/** /**
......
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