Commit 584e8fda by Daniel Dahan

development: updated TextField rules for Swift 3

parent 55ab6425
......@@ -38,12 +38,13 @@ extension UITabBarItem {
}
@IBDesignable
public class BottomTabBar: UITabBar {
open class BottomTabBar: UITabBar {
/// Automatically aligns the BottomNavigationBar to the superview.
public var autoLayoutToSuperview: Bool = true
open var isAlignedToParentAutomatically = true
/// A property that accesses the backing layer's backgroundColor.
@IBInspectable public override var backgroundColor: UIColor? {
@IBInspectable
open override var backgroundColor: UIColor? {
didSet {
barTintColor = backgroundColor
}
......@@ -70,17 +71,17 @@ public class BottomTabBar: UITabBar {
prepareView()
}
public override func layoutSublayers(of layer: CALayer) {
open override func layoutSublayers(of layer: CALayer) {
super.layoutSublayers(of: layer)
if self.layer == layer {
layoutShape()
}
}
public override func layoutSubviews() {
open override func layoutSubviews() {
super.layoutSubviews()
layoutShadowPath()
if let v: Array<UITabBarItem> = items {
if let v = items {
for item in v {
if .phone == Device.userInterfaceIdiom {
if nil == item.title {
......@@ -90,8 +91,7 @@ public class BottomTabBar: UITabBar {
let inset: CGFloat = 6
item.titlePositionAdjustment.vertical = -inset
}
} else {
if nil == item.title {
} else if nil == item.title {
let inset: CGFloat = 9
item.imageInsets = UIEdgeInsetsMake(inset, 0, -inset, 0)
} else {
......@@ -102,12 +102,11 @@ public class BottomTabBar: UITabBar {
}
}
}
}
public override func didMoveToSuperview() {
open override func didMoveToSuperview() {
super.didMoveToSuperview()
if autoLayoutToSuperview {
if let v: UIView = superview {
if isAlignedToParentAutomatically {
if let v = superview {
_ = v.layout(self).bottom().horizontally()
}
}
......@@ -124,7 +123,7 @@ public class BottomTabBar: UITabBar {
depthPreset = .depth1
contentScaleFactor = Device.scale
backgroundColor = Color.white
let image: UIImage? = UIImage.imageWithColor(color: Color.clear, size: CGSize(width: 1, height: 1))
let image = UIImage.imageWithColor(color: Color.clear, size: CGSize(width: 1, height: 1))
shadowImage = image
backgroundImage = image
}
......
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