Commit e2322500 by Daniel Dahan

updated ControlView to have a default frame of screen width and 44 points height

parent 59fc39a9
...@@ -36,7 +36,7 @@ in text to be detected. ...@@ -36,7 +36,7 @@ in text to be detected.
import UIKit import UIKit
import Material import Material
class ViewController: UIViewController, TextDelegate, TextViewDelegate { class ViewController: UIViewController, TextDelegate {
/// A Text storage object that monitors the changes within the textView. /// A Text storage object that monitors the changes within the textView.
lazy var text: Text = Text() lazy var text: Text = Text()
...@@ -64,7 +64,6 @@ class ViewController: UIViewController, TextDelegate, TextViewDelegate { ...@@ -64,7 +64,6 @@ class ViewController: UIViewController, TextDelegate, TextViewDelegate {
text.textStorage.addLayoutManager(layoutManager) text.textStorage.addLayoutManager(layoutManager)
textView = TextView(textContainer: textContainer) textView = TextView(textContainer: textContainer)
textView.delegate = self
textView.font = RobotoFont.regular textView.font = RobotoFont.regular
textView.placeholderLabel = UILabel() textView.placeholderLabel = UILabel()
......
...@@ -101,7 +101,7 @@ public class ControlView : MaterialView { ...@@ -101,7 +101,7 @@ public class ControlView : MaterialView {
- Parameter rightControls: An Array of UIControls that go on the right side. - Parameter rightControls: An Array of UIControls that go on the right side.
*/ */
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, 44))
prepareProperties(leftControls, rightControls: rightControls) prepareProperties(leftControls, rightControls: rightControls)
} }
......
...@@ -41,6 +41,16 @@ public class StatusBarView : ControlView { ...@@ -41,6 +41,16 @@ public class StatusBarView : ControlView {
} }
} }
/**
A convenience initializer with parameter settings.
- 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 convenience init?(leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) {
self.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, 64))
prepareProperties(leftControls, rightControls: rightControls)
}
/// A convenience initializer. /// A convenience initializer.
public convenience init() { public convenience init() {
self.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, 64)) self.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, 64))
......
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