Commit 3e1dc4a4 by Daniel Dahan

updated switchState setter to use property rather than setSwitchState

parent 91cebc7a
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
96A71ED71C6FFF7300C0C4AE /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71ED61C6FFF7300C0C4AE /* ViewController.swift */; }; 96A71ED71C6FFF7300C0C4AE /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71ED61C6FFF7300C0C4AE /* ViewController.swift */; };
96A71EDC1C6FFF7300C0C4AE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96A71EDB1C6FFF7300C0C4AE /* Assets.xcassets */; }; 96A71EDC1C6FFF7300C0C4AE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96A71EDB1C6FFF7300C0C4AE /* Assets.xcassets */; };
96A71EDF1C6FFF7300C0C4AE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96A71EDD1C6FFF7300C0C4AE /* LaunchScreen.storyboard */; }; 96A71EDF1C6FFF7300C0C4AE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96A71EDD1C6FFF7300C0C4AE /* LaunchScreen.storyboard */; };
96A720071C76D75100C0C4AE /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96A720061C76D75100C0C4AE /* Material.framework */; };
96A720081C76D75100C0C4AE /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 96A720061C76D75100C0C4AE /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
...@@ -20,6 +22,7 @@ ...@@ -20,6 +22,7 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
96A720081C76D75100C0C4AE /* Material.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -33,6 +36,7 @@ ...@@ -33,6 +36,7 @@
96A71EDB1C6FFF7300C0C4AE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 96A71EDB1C6FFF7300C0C4AE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96A71EDE1C6FFF7300C0C4AE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 96A71EDE1C6FFF7300C0C4AE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96A71EE01C6FFF7300C0C4AE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 96A71EE01C6FFF7300C0C4AE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96A720061C76D75100C0C4AE /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphoneos/Material.framework"; sourceTree = "<absolute>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -40,6 +44,7 @@ ...@@ -40,6 +44,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
96A720071C76D75100C0C4AE /* Material.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -49,6 +54,7 @@ ...@@ -49,6 +54,7 @@
96A71EC81C6FFF7300C0C4AE = { 96A71EC81C6FFF7300C0C4AE = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96A720061C76D75100C0C4AE /* Material.framework */,
96A71ED31C6FFF7300C0C4AE /* MaterialSwitch */, 96A71ED31C6FFF7300C0C4AE /* MaterialSwitch */,
96A71ED21C6FFF7300C0C4AE /* Products */, 96A71ED21C6FFF7300C0C4AE /* Products */,
); );
......
...@@ -38,6 +38,7 @@ import Material ...@@ -38,6 +38,7 @@ import Material
class ViewController: UIViewController, MaterialSwitchDelegate { class ViewController: UIViewController, MaterialSwitchDelegate {
private var topView: MaterialView = MaterialView() private var topView: MaterialView = MaterialView()
private var bottomView: MaterialView = MaterialView() private var bottomView: MaterialView = MaterialView()
var c2: MaterialSwitch!
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -69,9 +70,10 @@ class ViewController: UIViewController, MaterialSwitchDelegate { ...@@ -69,9 +70,10 @@ class ViewController: UIViewController, MaterialSwitchDelegate {
c1.translatesAutoresizingMaskIntoConstraints = false c1.translatesAutoresizingMaskIntoConstraints = false
topView.addSubview(c1) topView.addSubview(c1)
let c2: MaterialSwitch = MaterialSwitch(state: .On, style: .LightContent) c2 = MaterialSwitch(state: .Off, style: .LightContent)
c2.delegate = self c2.delegate = self
c2.translatesAutoresizingMaskIntoConstraints = false c2.translatesAutoresizingMaskIntoConstraints = false
c2.switchState = .On
topView.addSubview(c2) topView.addSubview(c2)
let c3: MaterialSwitch = MaterialSwitch(state: .Off, style: .LightContent, size: .Large) let c3: MaterialSwitch = MaterialSwitch(state: .Off, style: .LightContent, size: .Large)
...@@ -112,5 +114,7 @@ class ViewController: UIViewController, MaterialSwitchDelegate { ...@@ -112,5 +114,7 @@ class ViewController: UIViewController, MaterialSwitchDelegate {
internal func materialSwitchStateChanged(control: MaterialSwitch, state: MaterialSwitchState) { internal func materialSwitchStateChanged(control: MaterialSwitch, state: MaterialSwitchState) {
print("MaterialSwitch - Size: \(control.switchSize) State: \(state)") print("MaterialSwitch - Size: \(control.switchSize) State: \(state)")
c2.switchState = state
} }
} }
...@@ -125,7 +125,7 @@ class AppNavigationBarViewController: NavigationBarViewController { ...@@ -125,7 +125,7 @@ class AppNavigationBarViewController: NavigationBarViewController {
// Menu button. // Menu button.
let menuButton: FlatButton = FlatButton() let menuButton: FlatButton = FlatButton()
menuButton.pulseColor = nil menuButton.pulseColor = MaterialColor.white
menuButton.pulseScale = false menuButton.pulseScale = false
menuButton.setImage(image, forState: .Normal) menuButton.setImage(image, forState: .Normal)
menuButton.setImage(image, forState: .Highlighted) menuButton.setImage(image, forState: .Highlighted)
...@@ -137,7 +137,7 @@ class AppNavigationBarViewController: NavigationBarViewController { ...@@ -137,7 +137,7 @@ class AppNavigationBarViewController: NavigationBarViewController {
// Search button. // Search button.
image = UIImage(named: "ic_more_horiz_white") image = UIImage(named: "ic_more_horiz_white")
let moreButton: FlatButton = FlatButton() let moreButton: FlatButton = FlatButton()
moreButton.pulseColor = nil moreButton.pulseColor = MaterialColor.white
moreButton.pulseScale = false moreButton.pulseScale = false
moreButton.setImage(image, forState: .Normal) moreButton.setImage(image, forState: .Normal)
moreButton.setImage(image, forState: .Highlighted) moreButton.setImage(image, forState: .Highlighted)
......
...@@ -140,7 +140,7 @@ class AppNavigationBarViewController: NavigationBarViewController { ...@@ -140,7 +140,7 @@ class AppNavigationBarViewController: NavigationBarViewController {
// Menu button. // Menu button.
let menuButton: FlatButton = FlatButton() let menuButton: FlatButton = FlatButton()
menuButton.pulseColor = nil menuButton.pulseColor = MaterialColor.white
menuButton.pulseScale = false menuButton.pulseScale = false
menuButton.setImage(image, forState: .Normal) menuButton.setImage(image, forState: .Normal)
menuButton.setImage(image, forState: .Highlighted) menuButton.setImage(image, forState: .Highlighted)
...@@ -152,7 +152,7 @@ class AppNavigationBarViewController: NavigationBarViewController { ...@@ -152,7 +152,7 @@ class AppNavigationBarViewController: NavigationBarViewController {
// Search button. // Search button.
image = UIImage(named: "ic_more_horiz_white") image = UIImage(named: "ic_more_horiz_white")
let moreButton: FlatButton = FlatButton() let moreButton: FlatButton = FlatButton()
moreButton.pulseColor = nil moreButton.pulseColor = MaterialColor.white
moreButton.pulseScale = false moreButton.pulseScale = false
moreButton.setImage(image, forState: .Normal) moreButton.setImage(image, forState: .Normal)
moreButton.setImage(image, forState: .Highlighted) moreButton.setImage(image, forState: .Highlighted)
......
...@@ -279,22 +279,6 @@ ...@@ -279,22 +279,6 @@
name = Switch; name = Switch;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
96A71EF71C71134200C0C4AE /* Search */ = {
isa = PBXGroup;
children = (
96A71EF51C71127100C0C4AE /* SearchBarView.swift */,
);
name = Search;
sourceTree = "<group>";
};
96A71FB41C764EDB00C0C4AE /* StatusBar */ = {
isa = PBXGroup;
children = (
96A71FB21C764E3200C0C4AE /* StatusBarView.swift */,
);
name = StatusBar;
sourceTree = "<group>";
};
96A71FB51C764F3D00C0C4AE /* Control */ = { 96A71FB51C764F3D00C0C4AE /* Control */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -310,10 +294,6 @@ ...@@ -310,10 +294,6 @@
96D88BFC1C1328D800B91418 /* Info.plist */, 96D88BFC1C1328D800B91418 /* Info.plist */,
96D88C091C1328D800B91418 /* Material.h */, 96D88C091C1328D800B91418 /* Material.h */,
96D88C501C132A2C00B91418 /* Extensions */, 96D88C501C132A2C00B91418 /* Extensions */,
96D88C541C132A7700B91418 /* Navigation */,
96A71FB51C764F3D00C0C4AE /* Control */,
96A71FB41C764EDB00C0C4AE /* StatusBar */,
96A71EF71C71134200C0C4AE /* Search */,
96D88C531C132A6900B91418 /* View */, 96D88C531C132A6900B91418 /* View */,
96D88C521C132A5700B91418 /* Layout */, 96D88C521C132A5700B91418 /* Layout */,
96D88C511C132A4200B91418 /* Label */, 96D88C511C132A4200B91418 /* Label */,
...@@ -330,6 +310,8 @@ ...@@ -330,6 +310,8 @@
965C58BD1C6B8D3300CFB4E1 /* Grid */, 965C58BD1C6B8D3300CFB4E1 /* Grid */,
96A71E921C6FBC2900C0C4AE /* Menu */, 96A71E921C6FBC2900C0C4AE /* Menu */,
96A71EC51C6FFEF300C0C4AE /* Switch */, 96A71EC51C6FFEF300C0C4AE /* Switch */,
96A71FB51C764F3D00C0C4AE /* Control */,
96D88C541C132A7700B91418 /* Navigation */,
); );
path = Sources; path = Sources;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -463,6 +445,8 @@ ...@@ -463,6 +445,8 @@
96D88C541C132A7700B91418 /* Navigation */ = { 96D88C541C132A7700B91418 /* Navigation */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96A71FB21C764E3200C0C4AE /* StatusBarView.swift */,
96A71EF51C71127100C0C4AE /* SearchBarView.swift */,
96D88C151C1328D800B91418 /* NavigationBarView.swift */, 96D88C151C1328D800B91418 /* NavigationBarView.swift */,
96A71F2F1C72E41100C0C4AE /* NavigationBarViewController.swift */, 96A71F2F1C72E41100C0C4AE /* NavigationBarViewController.swift */,
96D88C1D1C1328D800B91418 /* SideNavigationViewController.swift */, 96D88C1D1C1328D800B91418 /* SideNavigationViewController.swift */,
......
...@@ -102,7 +102,7 @@ public class ControlView : MaterialView { ...@@ -102,7 +102,7 @@ public class ControlView : MaterialView {
*/ */
public convenience init?(leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) { public convenience init?(leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) {
self.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, 64)) self.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, 64))
prepareProperties(leftControls: leftControls, rightControls: rightControls) prepareProperties(leftControls, rightControls: rightControls)
} }
public override func layoutSubviews() { public override func layoutSubviews() {
...@@ -195,7 +195,7 @@ public class ControlView : MaterialView { ...@@ -195,7 +195,7 @@ public class ControlView : MaterialView {
- Parameter leftControls: An Array of UIControls that go on the left side. - Parameter leftControls: An Array of UIControls that go on the left side.
- Parameter rightControls: An Array of UIControls that go on the right side. - Parameter rightControls: An Array of UIControls that go on the right side.
*/ */
internal func prepareProperties(leftControls leftControls: Array<UIControl>?, rightControls: Array<UIControl>?) { internal func prepareProperties(leftControls: Array<UIControl>?, rightControls: Array<UIControl>?) {
self.leftControls = leftControls self.leftControls = leftControls
self.rightControls = rightControls self.rightControls = rightControls
} }
......
...@@ -166,7 +166,30 @@ public class MaterialSwitch: UIControl { ...@@ -166,7 +166,30 @@ public class MaterialSwitch: UIControl {
} }
/// MaterialSwitch state. /// MaterialSwitch state.
public private(set) var switchState: MaterialSwitchState = .Off public var switchState: MaterialSwitchState = .Off {
didSet {
if oldValue != switchState {
userInteractionEnabled = false
UIView.animateWithDuration(0.15,
delay: 0.05,
options: .CurveEaseInOut,
animations: { [unowned self] in
self.button.x = .On == self.switchState ? self.onPosition + self.bounceOffset : self.offPosition - self.bounceOffset
self.styleForState(self.switchState)
}) { [unowned self] _ in
self.styleForState(self.switchState)
self.sendActionsForControlEvents(.ValueChanged)
self.delegate?.materialSwitchStateChanged(self, state: self.switchState)
UIView.animateWithDuration(0.15,
animations: { [unowned self] in
self.button.x = .On == self.switchState ? self.onPosition : self.offPosition
}) { [unowned self] _ in
self.userInteractionEnabled = true
}
}
}
}
}
/// MaterialSwitch style. /// MaterialSwitch style.
public var switchStyle: MaterialSwitchStyle = .LightContent { public var switchStyle: MaterialSwitchStyle = .LightContent {
...@@ -290,47 +313,7 @@ public class MaterialSwitch: UIControl { ...@@ -290,47 +313,7 @@ public class MaterialSwitch: UIControl {
- Parameter completion: An Optional completion block. - Parameter completion: An Optional completion block.
*/ */
public func toggle(completion: ((control: MaterialSwitch) -> Void)? = nil) { public func toggle(completion: ((control: MaterialSwitch) -> Void)? = nil) {
setSwitchState(.On == switchState ? .Off : .On, animated: true, completion: completion) switchState = .On == switchState ? .Off : .On
}
/**
Set the switchState property with an option to animate.
- Parameter state: The MaterialSwitchState to set.
- Parameter animated: A Boolean indicating to set the animation or not.
- Parameter completion: An Optional completion block.
*/
public func setSwitchState(state: MaterialSwitchState, animated: Bool = true, completion: ((control: MaterialSwitch) -> Void)? = nil) {
if switchState != state {
if animated {
userInteractionEnabled = false
UIView.animateWithDuration(0.15,
delay: 0.05,
options: .CurveEaseInOut,
animations: { [unowned self] in
self.button.x = .On == state ? self.onPosition + self.bounceOffset : self.offPosition - self.bounceOffset
self.styleForState(state)
}) { [unowned self] _ in
self.styleForState(state)
self.sendActionsForControlEvents(.ValueChanged)
self.switchState = state
self.delegate?.materialSwitchStateChanged(self, state: state)
UIView.animateWithDuration(0.15,
animations: { [unowned self] in
self.button.x = .On == state ? self.onPosition : self.offPosition
}) { [unowned self] _ in
self.userInteractionEnabled = true
completion?(control: self)
}
}
} else {
button.x = .On == state ? self.onPosition : self.offPosition
styleForState(state)
sendActionsForControlEvents(.ValueChanged)
switchState = state
delegate?.materialSwitchStateChanged(self, state: state)
completion?(control: self)
}
}
} }
/// Handles the TouchUpInside event. /// Handles the TouchUpInside event.
...@@ -348,7 +331,7 @@ public class MaterialSwitch: UIControl { ...@@ -348,7 +331,7 @@ public class MaterialSwitch: UIControl {
let t: CGPoint = v.previousLocationInView(sender) let t: CGPoint = v.previousLocationInView(sender)
let p: CGPoint = v.locationInView(sender) let p: CGPoint = v.locationInView(sender)
let q: CGFloat = sender.x + p.x - t.x let q: CGFloat = sender.x + p.x - t.x
setSwitchState(q > (width - button.width) / 2 ? .On : .Off, animated: true) switchState = q > (width - button.width) / 2 ? .On : .Off
} }
} }
...@@ -371,7 +354,7 @@ public class MaterialSwitch: UIControl { ...@@ -371,7 +354,7 @@ public class MaterialSwitch: UIControl {
public override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) { public override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {
super.touchesEnded(touches, withEvent: event) super.touchesEnded(touches, withEvent: event)
if true == CGRectContainsPoint(trackLayer.frame, layer.convertPoint(touches.first!.locationInView(self), fromLayer: layer)) { if true == CGRectContainsPoint(trackLayer.frame, layer.convertPoint(touches.first!.locationInView(self), fromLayer: layer)) {
setSwitchState(.On == switchState ? .Off : .On) switchState = .On == switchState ? .Off : .On
} }
} }
...@@ -396,7 +379,7 @@ public class MaterialSwitch: UIControl { ...@@ -396,7 +379,7 @@ public class MaterialSwitch: UIControl {
- Parameter state: The MaterialSwitchState to set. - Parameter state: The MaterialSwitchState to set.
*/ */
private func prepareSwitchState(state: MaterialSwitchState) { private func prepareSwitchState(state: MaterialSwitchState) {
setSwitchState(state, animated: false) switchState = state
} }
/** /**
......
...@@ -30,10 +30,6 @@ ...@@ -30,10 +30,6 @@
import UIKit import UIKit
@objc(NavigationBarViewDelegate)
public protocol NavigationBarViewDelegate : StatusBarViewDelegate {}
public class NavigationBarView : StatusBarView { public class NavigationBarView : StatusBarView {
/// Title label. /// Title label.
public var titleLabel: UILabel? { public var titleLabel: UILabel? {
...@@ -64,12 +60,14 @@ public class NavigationBarView : StatusBarView { ...@@ -64,12 +60,14 @@ public class NavigationBarView : StatusBarView {
*/ */
public convenience init?(titleLabel: UILabel? = nil, detailLabel: UILabel? = nil, leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) { public convenience init?(titleLabel: UILabel? = nil, detailLabel: UILabel? = nil, leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) {
self.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, 64)) self.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, 64))
prepareProperties(titleLabel: titleLabel, detailLabel: detailLabel, leftControls: leftControls, rightControls: rightControls) prepareProperties(titleLabel, detailLabel: detailLabel, leftControls: leftControls, rightControls: rightControls)
} }
public override func layoutSubviews() { public override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()
grid.axis.columns = Int(width / 48)
// General alignment. // General alignment.
if UIApplication.sharedApplication().statusBarOrientation.isLandscape { if UIApplication.sharedApplication().statusBarOrientation.isLandscape {
// TitleView alignment. // TitleView alignment.
...@@ -107,7 +105,6 @@ public class NavigationBarView : StatusBarView { ...@@ -107,7 +105,6 @@ public class NavigationBarView : StatusBarView {
/// Reloads the view. /// Reloads the view.
public override func reloadView() { public override func reloadView() {
super.reloadView() super.reloadView()
contentView.grid.views = [] contentView.grid.views = []
contentView.grid.axis.rows = 6 contentView.grid.axis.rows = 6
if let v: UILabel = titleLabel { if let v: UILabel = titleLabel {
...@@ -138,10 +135,9 @@ public class NavigationBarView : StatusBarView { ...@@ -138,10 +135,9 @@ public class NavigationBarView : StatusBarView {
- Parameter leftControls: An Array of UIControls that go on the left side. - Parameter leftControls: An Array of UIControls that go on the left side.
- Parameter rightControls: An Array of UIControls that go on the right side. - Parameter rightControls: An Array of UIControls that go on the right side.
*/ */
internal func prepareProperties(titleLabel titleLabel: UILabel?, detailLabel: UILabel?, leftControls: Array<UIControl>?, rightControls: Array<UIControl>?) { internal func prepareProperties(titleLabel: UILabel?, detailLabel: UILabel?, leftControls: Array<UIControl>?, rightControls: Array<UIControl>?) {
prepareProperties(leftControls: leftControls, rightControls: rightControls) prepareProperties(leftControls, rightControls: rightControls)
self.titleLabel = titleLabel self.titleLabel = titleLabel
self.detailLabel = detailLabel self.detailLabel = detailLabel
} }
} }
...@@ -161,7 +161,7 @@ public class NavigationBarViewController: UIViewController { ...@@ -161,7 +161,7 @@ public class NavigationBarViewController: UIViewController {
} }
} }
extension NavigationBarViewController : NavigationBarViewDelegate { extension NavigationBarViewController : StatusBarViewDelegate {
/// Monitor layout changes. /// Monitor layout changes.
public func statusBarViewDidChangeLayout(statusBarView: StatusBarView) { public func statusBarViewDidChangeLayout(statusBarView: StatusBarView) {
layoutSubviews() layoutSubviews()
......
...@@ -72,11 +72,6 @@ public class StatusBarView : ControlView { ...@@ -72,11 +72,6 @@ public class StatusBarView : ControlView {
reloadView() reloadView()
} }
public override func didMoveToSuperview() {
super.didMoveToSuperview()
reloadView()
}
public override func intrinsicContentSize() -> CGSize { public override func intrinsicContentSize() -> CGSize {
if UIApplication.sharedApplication().statusBarOrientation.isLandscape { if UIApplication.sharedApplication().statusBarOrientation.isLandscape {
return CGSizeMake(UIScreen.mainScreen().bounds.width, 44) return CGSizeMake(UIScreen.mainScreen().bounds.width, 44)
......
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