Commit a3146a47 by Daniel Dahan

updated left and right controls to UIViews

parent 71bdc3ea
......@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSApplicationCategoryType</key>
<string></string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
......
......@@ -54,7 +54,7 @@ public class BarView : ControlView {
- Parameter leftControls: An Array of UIControls that go on the left side.
- Parameter rightControls: An Array of UIControls that go on the right side.
*/
public override init(leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) {
public override init(leftControls: [UIView]? = nil, rightControls: [UIView]? = nil) {
super.init(leftControls: leftControls, rightControls: rightControls)
}
......
......@@ -85,15 +85,15 @@ public class ControlView : View {
public private(set) var contentView: View!
/// Left side UIControls.
public var leftControls: Array<UIControl>? {
public var leftControls: [UIView]? {
didSet {
if let v: Array<UIControl> = oldValue {
if let v = oldValue {
for b in v {
b.removeFromSuperview()
}
}
if let v: Array<UIControl> = leftControls {
if let v = leftControls {
for b in v {
addSubview(b)
}
......@@ -103,15 +103,15 @@ public class ControlView : View {
}
/// Right side UIControls.
public var rightControls: Array<UIControl>? {
public var rightControls: [UIView]? {
didSet {
if let v: Array<UIControl> = oldValue {
if let v = oldValue {
for b in v {
b.removeFromSuperview()
}
}
if let v: Array<UIControl> = rightControls {
if let v = rightControls {
for b in v {
addSubview(b)
}
......@@ -149,7 +149,7 @@ public class ControlView : View {
- Parameter leftControls: An Array of UIControls that go on the left side.
- Parameter rightControls: An Array of UIControls that go on the right side.
*/
public init(leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) {
public init(leftControls: [UIView]? = nil, rightControls: [UIView]? = nil) {
super.init(frame: CGRect.zero)
frame.size = intrinsicContentSize()
prepareProperties(leftControls: leftControls, rightControls: rightControls)
......@@ -169,7 +169,7 @@ public class ControlView : View {
contentView.grid.columns = columns
// leftControls
if let v: Array<UIControl> = leftControls {
if let v = leftControls {
for c in v {
let w: CGFloat = c.intrinsicContentSize().width
(c as? UIButton)?.contentEdgeInsets = UIEdgeInsets.zero
......@@ -189,7 +189,7 @@ public class ControlView : View {
grid.views?.append(contentView)
// rightControls
if let v: Array<UIControl> = rightControls {
if let v = rightControls {
for c in v {
let w: CGFloat = c.intrinsicContentSize().width
(c as? UIButton)?.contentEdgeInsets = UIEdgeInsets.zero
......@@ -238,7 +238,7 @@ public class ControlView : View {
- Parameter leftControls: An Array of UIControls that go on the left side.
- Parameter rightControls: An Array of UIControls that go on the right side.
*/
internal func prepareProperties(leftControls: Array<UIControl>?, rightControls: Array<UIControl>?) {
internal func prepareProperties(leftControls: [UIView]?, rightControls: [UIView]?) {
self.leftControls = leftControls
self.rightControls = rightControls
}
......
......@@ -116,7 +116,7 @@ public class SearchBar : BarView {
- Parameter leftControls: An Array of UIControls that go on the left side.
- Parameter rightControls: An Array of UIControls that go on the right side.
*/
public override init(leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) {
public override init(leftControls: [UIView]? = nil, rightControls: [UIView]? = nil) {
super.init(leftControls: leftControls, rightControls: rightControls)
}
......
......@@ -123,7 +123,7 @@ public class Toolbar : BarView {
- Parameter leftControls: An Array of UIControls that go on the left side.
- Parameter rightControls: An Array of UIControls that go on the right side.
*/
public override init(leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) {
public override init(leftControls: [UIView]? = nil, rightControls: [UIView]? = nil) {
super.init(leftControls: leftControls, rightControls: rightControls)
}
......
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