Commit a969227d by Daniel Dahan

development: renamed prepareView to prepare

parent ae1deec3
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
96264BE71D833D2800576F37 /* Reminders.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96264BE61D833D2800576F37 /* Reminders.swift */; }; 96264BE71D833D2800576F37 /* Reminders.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96264BE61D833D2800576F37 /* Reminders.swift */; };
96264BE91D833D3400576F37 /* RemindersController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96264BE81D833D3400576F37 /* RemindersController.swift */; }; 96264BE91D833D3400576F37 /* RemindersController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96264BE81D833D3400576F37 /* RemindersController.swift */; };
96264C0E1D84051900576F37 /* Checkbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96264C0D1D84051900576F37 /* Checkbox.swift */; }; 96264C0E1D84051900576F37 /* Checkbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96264C0D1D84051900576F37 /* Checkbox.swift */; };
96264C121D840B5F00576F37 /* TitleCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96264C111D840B5F00576F37 /* TitleCard.swift */; }; 96264C121D840B5F00576F37 /* ContentCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96264C111D840B5F00576F37 /* ContentCard.swift */; };
9628645A1D53FE3E00690B69 /* Material+UIWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 962864591D53FE3E00690B69 /* Material+UIWindow.swift */; }; 9628645A1D53FE3E00690B69 /* Material+UIWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 962864591D53FE3E00690B69 /* Material+UIWindow.swift */; };
9628645F1D540AF300690B69 /* DynamicFontType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9628645E1D540AF300690B69 /* DynamicFontType.swift */; }; 9628645F1D540AF300690B69 /* DynamicFontType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9628645E1D540AF300690B69 /* DynamicFontType.swift */; };
962864621D54111D00690B69 /* JSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = 962864611D54111D00690B69 /* JSON.swift */; }; 962864621D54111D00690B69 /* JSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = 962864611D54111D00690B69 /* JSON.swift */; };
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
96264BE61D833D2800576F37 /* Reminders.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Reminders.swift; sourceTree = "<group>"; }; 96264BE61D833D2800576F37 /* Reminders.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Reminders.swift; sourceTree = "<group>"; };
96264BE81D833D3400576F37 /* RemindersController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemindersController.swift; sourceTree = "<group>"; }; 96264BE81D833D3400576F37 /* RemindersController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemindersController.swift; sourceTree = "<group>"; };
96264C0D1D84051900576F37 /* Checkbox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Checkbox.swift; sourceTree = "<group>"; }; 96264C0D1D84051900576F37 /* Checkbox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Checkbox.swift; sourceTree = "<group>"; };
96264C111D840B5F00576F37 /* TitleCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TitleCard.swift; sourceTree = "<group>"; }; 96264C111D840B5F00576F37 /* ContentCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentCard.swift; sourceTree = "<group>"; };
962864591D53FE3E00690B69 /* Material+UIWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Material+UIWindow.swift"; sourceTree = "<group>"; }; 962864591D53FE3E00690B69 /* Material+UIWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Material+UIWindow.swift"; sourceTree = "<group>"; };
9628645E1D540AF300690B69 /* DynamicFontType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DynamicFontType.swift; sourceTree = "<group>"; }; 9628645E1D540AF300690B69 /* DynamicFontType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DynamicFontType.swift; sourceTree = "<group>"; };
962864611D54111D00690B69 /* JSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSON.swift; sourceTree = "<group>"; }; 962864611D54111D00690B69 /* JSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSON.swift; sourceTree = "<group>"; };
...@@ -630,7 +630,7 @@ ...@@ -630,7 +630,7 @@
96BCB8021CB40F3B00C806FE /* Card */ = { 96BCB8021CB40F3B00C806FE /* Card */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96264C111D840B5F00576F37 /* TitleCard.swift */, 96264C111D840B5F00576F37 /* ContentCard.swift */,
96BCB75D1CB40DC500C806FE /* Card.swift */, 96BCB75D1CB40DC500C806FE /* Card.swift */,
96BCB7621CB40DC500C806FE /* ImageCard.swift */, 96BCB7621CB40DC500C806FE /* ImageCard.swift */,
); );
...@@ -1141,7 +1141,7 @@ ...@@ -1141,7 +1141,7 @@
96BCB7CD1CB40DC500C806FE /* PulseView.swift in Sources */, 96BCB7CD1CB40DC500C806FE /* PulseView.swift in Sources */,
96BCB7DA1CB40DC500C806FE /* NavigationController.swift in Sources */, 96BCB7DA1CB40DC500C806FE /* NavigationController.swift in Sources */,
96BCB7A81CB40DC500C806FE /* FabButton.swift in Sources */, 96BCB7A81CB40DC500C806FE /* FabButton.swift in Sources */,
96264C121D840B5F00576F37 /* TitleCard.swift in Sources */, 96264C121D840B5F00576F37 /* ContentCard.swift in Sources */,
96BCB7E41CB40DC500C806FE /* Text.swift in Sources */, 96BCB7E41CB40DC500C806FE /* Text.swift in Sources */,
96BCB7AB1CB40DC500C806FE /* ImageCard.swift in Sources */, 96BCB7AB1CB40DC500C806FE /* ImageCard.swift in Sources */,
96BCB7CB1CB40DC500C806FE /* PulseAnimation.swift in Sources */, 96BCB7CB1CB40DC500C806FE /* PulseAnimation.swift in Sources */,
......
...@@ -70,13 +70,13 @@ open class BarView: ContentView { ...@@ -70,13 +70,13 @@ open class BarView: ContentView {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
prepareDivider() prepareDivider()
} }
......
...@@ -87,7 +87,7 @@ open class BottomNavigationController: UITabBarController, UITabBarControllerDel ...@@ -87,7 +87,7 @@ open class BottomNavigationController: UITabBarController, UITabBarControllerDel
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
prepareView() prepare()
} }
open override func viewWillLayoutSubviews() { open override func viewWillLayoutSubviews() {
...@@ -124,12 +124,12 @@ open class BottomNavigationController: UITabBarController, UITabBarControllerDel ...@@ -124,12 +124,12 @@ open class BottomNavigationController: UITabBarController, UITabBarControllerDel
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepare() {
view.clipsToBounds = true view.clipsToBounds = true
view.contentScaleFactor = Device.scale view.contentScaleFactor = Device.scale
delegate = self delegate = self
......
...@@ -58,7 +58,7 @@ open class BottomTabBar: UITabBar { ...@@ -58,7 +58,7 @@ open class BottomTabBar: UITabBar {
*/ */
public override init(frame: CGRect) { public override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
prepareView() prepare()
} }
/// A convenience initializer. /// A convenience initializer.
...@@ -68,7 +68,7 @@ open class BottomTabBar: UITabBar { ...@@ -68,7 +68,7 @@ open class BottomTabBar: UITabBar {
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView() prepare()
} }
open override func layoutSublayers(of layer: CALayer) { open override func layoutSublayers(of layer: CALayer) {
...@@ -117,12 +117,12 @@ open class BottomTabBar: UITabBar { ...@@ -117,12 +117,12 @@ open class BottomTabBar: UITabBar {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
public func prepareView() { public func prepare() {
depthPreset = .depth1 depthPreset = .depth1
divider.alignment = .top divider.alignment = .top
contentScaleFactor = Device.scale contentScaleFactor = Device.scale
......
...@@ -103,7 +103,7 @@ open class Button: UIButton { ...@@ -103,7 +103,7 @@ open class Button: UIButton {
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView() prepare()
} }
/** /**
...@@ -114,7 +114,7 @@ open class Button: UIButton { ...@@ -114,7 +114,7 @@ open class Button: UIButton {
*/ */
public override init(frame: CGRect) { public override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
prepareView() prepare()
} }
/// A convenience initializer. /// A convenience initializer.
...@@ -224,12 +224,12 @@ open class Button: UIButton { ...@@ -224,12 +224,12 @@ open class Button: UIButton {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepare() {
contentScaleFactor = Device.scale contentScaleFactor = Device.scale
contentEdgeInsetsPreset = .none contentEdgeInsetsPreset = .none
prepareVisualLayer() prepareVisualLayer()
......
...@@ -312,13 +312,13 @@ open class Capture: View, UIGestureRecognizerDelegate { ...@@ -312,13 +312,13 @@ open class Capture: View, UIGestureRecognizerDelegate {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
backgroundColor = Color.black backgroundColor = Color.black
prepareCaptureSession() prepareCaptureSession()
preparePreviewView() preparePreviewView()
......
...@@ -58,13 +58,13 @@ open class CapturePreview: View { ...@@ -58,13 +58,13 @@ open class CapturePreview: View {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
preparePreviewLayer() preparePreviewLayer()
} }
......
...@@ -392,10 +392,10 @@ open class Card: PulseView { ...@@ -392,10 +392,10 @@ open class Card: PulseView {
} }
/** /**
:name: prepareView :name: prepare
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
depthPreset = .depth1 depthPreset = .depth1
dividerColor = Color.grey.lighten3 dividerColor = Color.grey.lighten3
cornerRadiusPreset = .cornerRadius1 cornerRadiusPreset = .cornerRadius1
......
...@@ -177,7 +177,7 @@ open class MaterialCollectionReusableView: UICollectionReusableView { ...@@ -177,7 +177,7 @@ open class MaterialCollectionReusableView: UICollectionReusableView {
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() prepare()
} }
/** /**
...@@ -189,7 +189,7 @@ open class MaterialCollectionReusableView: UICollectionReusableView { ...@@ -189,7 +189,7 @@ open class MaterialCollectionReusableView: UICollectionReusableView {
public override init(frame: CGRect) { public override init(frame: CGRect) {
contentsGravityPreset = .ResizeAspectFill contentsGravityPreset = .ResizeAspectFill
super.init(frame: frame) super.init(frame: frame)
prepareView() prepare()
} }
/// A convenience initializer. /// A convenience initializer.
...@@ -261,12 +261,12 @@ open class MaterialCollectionReusableView: UICollectionReusableView { ...@@ -261,12 +261,12 @@ open class MaterialCollectionReusableView: UICollectionReusableView {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepare() {
contentScaleFactor = Device.scale contentScaleFactor = Device.scale
pulseAnimation = .none pulseAnimation = .none
prepareVisualLayer() prepareVisualLayer()
......
...@@ -84,7 +84,7 @@ open class CollectionView: UICollectionView { ...@@ -84,7 +84,7 @@ open class CollectionView: UICollectionView {
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView() prepare()
} }
/** /**
...@@ -94,7 +94,7 @@ open class CollectionView: UICollectionView { ...@@ -94,7 +94,7 @@ open class CollectionView: UICollectionView {
*/ */
public override init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) { public override init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) {
super.init(frame: frame, collectionViewLayout: layout) super.init(frame: frame, collectionViewLayout: layout)
prepareView() prepare()
} }
/** /**
...@@ -103,7 +103,7 @@ open class CollectionView: UICollectionView { ...@@ -103,7 +103,7 @@ open class CollectionView: UICollectionView {
*/ */
public init(frame: CGRect) { public init(frame: CGRect) {
super.init(frame: frame, collectionViewLayout: CollectionViewLayout()) super.init(frame: frame, collectionViewLayout: CollectionViewLayout())
prepareView() prepare()
} }
/// A convenience initializer that initializes the object. /// A convenience initializer that initializes the object.
...@@ -113,12 +113,12 @@ open class CollectionView: UICollectionView { ...@@ -113,12 +113,12 @@ open class CollectionView: UICollectionView {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepare() {
contentScaleFactor = Device.scale contentScaleFactor = Device.scale
backgroundColor = Color.clear backgroundColor = Color.clear
contentInset = .zero contentInset = .zero
......
...@@ -187,7 +187,7 @@ open class CollectionViewCell: UICollectionViewCell { ...@@ -187,7 +187,7 @@ open class CollectionViewCell: UICollectionViewCell {
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() prepare()
} }
/** /**
...@@ -199,7 +199,7 @@ open class CollectionViewCell: UICollectionViewCell { ...@@ -199,7 +199,7 @@ open class CollectionViewCell: UICollectionViewCell {
public override init(frame: CGRect) { public override init(frame: CGRect) {
contentsGravityPreset = .ResizeAspectFill contentsGravityPreset = .ResizeAspectFill
super.init(frame: frame) super.init(frame: frame)
prepareView() prepare()
} }
/// A convenience initializer. /// A convenience initializer.
...@@ -271,12 +271,12 @@ open class CollectionViewCell: UICollectionViewCell { ...@@ -271,12 +271,12 @@ open class CollectionViewCell: UICollectionViewCell {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepare() {
contentScaleFactor = Device.scale contentScaleFactor = Device.scale
prepareVisualLayer() prepareVisualLayer()
prepareDivider() prepareDivider()
......
...@@ -30,14 +30,14 @@ ...@@ -30,14 +30,14 @@
import UIKit import UIKit
open class TitleCard: PulseView { open class ContentCard: PulseView {
/// An internal reference to the titleBar. /// An internal reference to the titleToolbar.
internal var internalTitleBar: Toolbar? internal var internalTitleToolbar: Toolbar?
/// A reference to the titleBar. /// A reference to the titleToolbar.
open var titleBar: Toolbar { open var titleToolbar: Toolbar {
prepareTitleBar() prepareTitleToolbar()
return internalTitleBar! return internalTitleToolbar!
} }
/// An internal reference to the contentView. /// An internal reference to the contentView.
...@@ -49,24 +49,24 @@ open class TitleCard: PulseView { ...@@ -49,24 +49,24 @@ open class TitleCard: PulseView {
return internalContentView! return internalContentView!
} }
/// An internal reference to the detailBar. /// An internal reference to the detailToolbar.
internal var internalDetailBar: Toolbar? internal var internalDetailToolbar: Toolbar?
/// A reference to the detailBar. /// A reference to the detailToolbar.
open var detailBar: Toolbar { open var detailToolbar: Toolbar {
prepareDetailBar() prepareDetailToolbar()
return internalDetailBar! return internalDetailToolbar!
} }
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
pulseAnimation = .none pulseAnimation = .none
} }
...@@ -81,12 +81,12 @@ open class TitleCard: PulseView { ...@@ -81,12 +81,12 @@ open class TitleCard: PulseView {
} }
/// Prepares the titleBar. /// Prepares the titleToolbar.
private func prepareTitleBar() { private func prepareTitleToolbar() {
guard nil == internalTitleBar else { guard nil == internalTitleToolbar else {
return return
} }
internalTitleBar = Toolbar() internalTitleToolbar = Toolbar()
} }
/// Prepares the contentView. /// Prepares the contentView.
...@@ -97,11 +97,11 @@ open class TitleCard: PulseView { ...@@ -97,11 +97,11 @@ open class TitleCard: PulseView {
internalContentView = UIView() internalContentView = UIView()
} }
/// Prepares the detailBar. /// Prepares the detailToolbar.
private func prepareDetailBar() { private func prepareDetailToolbar() {
guard nil == internalDetailBar else { guard nil == internalDetailToolbar else {
return return
} }
internalDetailBar = Toolbar() internalDetailToolbar = Toolbar()
} }
} }
...@@ -217,13 +217,13 @@ open class ContentView: View { ...@@ -217,13 +217,13 @@ open class ContentView: View {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
prepareContentView() prepareContentView()
} }
......
...@@ -40,13 +40,13 @@ public class ErrorTextField: TextField { ...@@ -40,13 +40,13 @@ public class ErrorTextField: TextField {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
override public func prepareView() { override public func prepare() {
super.prepareView() super.prepare()
revealError = false revealError = false
detailColor = Color.red.base detailColor = Color.red.base
} }
......
...@@ -33,13 +33,13 @@ import UIKit ...@@ -33,13 +33,13 @@ import UIKit
open class FabButton: Button { open class FabButton: Button {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
depthPreset = .depth1 depthPreset = .depth1
shapePreset = .circle shapePreset = .circle
pulseAnimation = .centerWithBacking pulseAnimation = .centerWithBacking
......
...@@ -33,13 +33,13 @@ import UIKit ...@@ -33,13 +33,13 @@ import UIKit
open class FlatButton: Button { open class FlatButton: Button {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
cornerRadiusPreset = .cornerRadius1 cornerRadiusPreset = .cornerRadius1
} }
} }
...@@ -33,13 +33,13 @@ import UIKit ...@@ -33,13 +33,13 @@ import UIKit
open class IconButton: Button { open class IconButton: Button {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
pulseAnimation = .center pulseAnimation = .center
} }
} }
...@@ -540,10 +540,10 @@ open class ImageCard: PulseView { ...@@ -540,10 +540,10 @@ open class ImageCard: PulseView {
} }
/** /**
:name: prepareView :name: prepare
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
depthPreset = .depth1 depthPreset = .depth1
dividerColor = Color.grey.lighten3 dividerColor = Color.grey.lighten3
cornerRadiusPreset = .cornerRadius1 cornerRadiusPreset = .cornerRadius1
......
...@@ -120,7 +120,7 @@ open class Label: UILabel { ...@@ -120,7 +120,7 @@ open class Label: UILabel {
wrapped = true wrapped = true
contentsScale = Device.scale contentsScale = Device.scale
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView() prepare()
} }
/** /**
...@@ -130,7 +130,7 @@ open class Label: UILabel { ...@@ -130,7 +130,7 @@ open class Label: UILabel {
wrapped = true wrapped = true
contentsScale = Device.scale contentsScale = Device.scale
super.init(frame: frame) super.init(frame: frame)
prepareView() prepare()
} }
/** /**
...@@ -148,9 +148,9 @@ open class Label: UILabel { ...@@ -148,9 +148,9 @@ open class Label: UILabel {
} }
/** /**
:name: prepareView :name: prepare
*/ */
open func prepareView() { open func prepare() {
contentScaleFactor = Device.scale contentScaleFactor = Device.scale
textAlignment = .left textAlignment = .left
} }
......
...@@ -131,13 +131,13 @@ open class Menu: View { ...@@ -131,13 +131,13 @@ open class Menu: View {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
backgroundColor = nil backgroundColor = nil
interimSpacePreset = .interimSpace6 interimSpacePreset = .interimSpace6
} }
......
...@@ -116,13 +116,13 @@ open class MenuController: RootController { ...@@ -116,13 +116,13 @@ open class MenuController: RootController {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
prepareMenuView() prepareMenuView()
} }
......
...@@ -133,7 +133,7 @@ open class NavigationBar: UINavigationBar { ...@@ -133,7 +133,7 @@ open class NavigationBar: UINavigationBar {
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView() prepare()
} }
/** /**
...@@ -144,7 +144,7 @@ open class NavigationBar: UINavigationBar { ...@@ -144,7 +144,7 @@ open class NavigationBar: UINavigationBar {
*/ */
public override init(frame: CGRect) { public override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
prepareView() prepare()
} }
/// A convenience initializer. /// A convenience initializer.
...@@ -286,12 +286,12 @@ open class NavigationBar: UINavigationBar { ...@@ -286,12 +286,12 @@ open class NavigationBar: UINavigationBar {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
public func prepareView() { public func prepare() {
barStyle = .black barStyle = .black
isTranslucent = false isTranslucent = false
depthPreset = .depth1 depthPreset = .depth1
......
...@@ -91,7 +91,7 @@ open class NavigationController: UINavigationController { ...@@ -91,7 +91,7 @@ open class NavigationController: UINavigationController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
prepareView() prepare()
} }
open override func viewDidAppear(_ animated: Bool) { open override func viewDidAppear(_ animated: Bool) {
...@@ -106,12 +106,12 @@ open class NavigationController: UINavigationController { ...@@ -106,12 +106,12 @@ open class NavigationController: UINavigationController {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepare() {
view.clipsToBounds = true view.clipsToBounds = true
view.backgroundColor = Color.white view.backgroundColor = Color.white
view.contentScaleFactor = Device.scale view.contentScaleFactor = Device.scale
......
...@@ -371,7 +371,7 @@ open class NavigationDrawerController: RootController, UIGestureRecognizerDelega ...@@ -371,7 +371,7 @@ open class NavigationDrawerController: RootController, UIGestureRecognizerDelega
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView() prepare()
} }
/** /**
...@@ -381,7 +381,7 @@ open class NavigationDrawerController: RootController, UIGestureRecognizerDelega ...@@ -381,7 +381,7 @@ open class NavigationDrawerController: RootController, UIGestureRecognizerDelega
*/ */
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
prepareView() prepare()
} }
/** /**
...@@ -394,18 +394,18 @@ open class NavigationDrawerController: RootController, UIGestureRecognizerDelega ...@@ -394,18 +394,18 @@ open class NavigationDrawerController: RootController, UIGestureRecognizerDelega
super.init(rootViewController: rootViewController) super.init(rootViewController: rootViewController)
self.leftViewController = leftViewController self.leftViewController = leftViewController
self.rightViewController = rightViewController self.rightViewController = rightViewController
prepareView() prepare()
} }
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
prepareContentViewController() prepareContentViewController()
prepareLeftView() prepareLeftView()
prepareRightView() prepareRightView()
...@@ -888,21 +888,21 @@ open class NavigationDrawerController: RootController, UIGestureRecognizerDelega ...@@ -888,21 +888,21 @@ open class NavigationDrawerController: RootController, UIGestureRecognizerDelega
/// Prepares the contentViewController. /// Prepares the contentViewController.
private func prepareContentViewController() { private func prepareContentViewController() {
contentViewController.view.backgroundColor = Color.black contentViewController.view.backgroundColor = Color.black
prepareViewControllerWithinContainer(viewController: contentViewController, container: view) prepareControllerWithinContainer(viewController: contentViewController, container: view)
view.sendSubview(toBack: contentViewController.view) view.sendSubview(toBack: contentViewController.view)
} }
/// A method that prepares the leftViewController. /// A method that prepares the leftViewController.
private func prepareLeftViewController() { private func prepareLeftViewController() {
if let v: View = leftView { if let v: View = leftView {
prepareViewControllerWithinContainer(viewController: leftViewController, container: v) prepareControllerWithinContainer(viewController: leftViewController, container: v)
} }
} }
/// A method that prepares the rightViewController. /// A method that prepares the rightViewController.
private func prepareRightViewController() { private func prepareRightViewController() {
if let v: View = rightView { if let v: View = rightView {
prepareViewControllerWithinContainer(viewController: rightViewController, container: v) prepareControllerWithinContainer(viewController: rightViewController, container: v)
} }
} }
......
...@@ -34,15 +34,15 @@ import UIKit ...@@ -34,15 +34,15 @@ import UIKit
private var PageTabBarItemKey: UInt8 = 0 private var PageTabBarItemKey: UInt8 = 0
open class PageTabBarItem: FlatButton { open class PageTabBarItem: FlatButton {
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
pulseAnimation = .none pulseAnimation = .none
} }
} }
open class PageTabBar: TabBar { open class PageTabBar: TabBar {
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
isLineAnimated = false isLineAnimated = false
lineAlignment = .top lineAlignment = .top
} }
...@@ -180,13 +180,13 @@ open class PageTabBarController: RootController { ...@@ -180,13 +180,13 @@ open class PageTabBarController: RootController {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
preparePageTabBar() preparePageTabBar()
} }
......
...@@ -36,17 +36,17 @@ open class PhotoLibraryController: UIViewController { ...@@ -36,17 +36,17 @@ open class PhotoLibraryController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
prepareView() prepare()
} }
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepare() {
view.clipsToBounds = true view.clipsToBounds = true
view.backgroundColor = Color.white view.backgroundColor = Color.white
view.contentScaleFactor = Device.scale view.contentScaleFactor = Device.scale
......
...@@ -33,13 +33,13 @@ import UIKit ...@@ -33,13 +33,13 @@ import UIKit
open class RaisedButton: Button { open class RaisedButton: Button {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
depthPreset = .depth1 depthPreset = .depth1
cornerRadiusPreset = .cornerRadius1 cornerRadiusPreset = .cornerRadius1
backgroundColor = Color.white backgroundColor = Color.white
......
...@@ -36,17 +36,17 @@ open class RemindersController: UIViewController { ...@@ -36,17 +36,17 @@ open class RemindersController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
prepareView() prepare()
} }
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepare() {
view.clipsToBounds = true view.clipsToBounds = true
view.backgroundColor = Color.white view.backgroundColor = Color.white
view.contentScaleFactor = Device.scale view.contentScaleFactor = Device.scale
......
...@@ -70,7 +70,7 @@ open class RootController: UIViewController { ...@@ -70,7 +70,7 @@ open class RootController: UIViewController {
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView() prepare()
} }
/** /**
...@@ -80,7 +80,7 @@ open class RootController: UIViewController { ...@@ -80,7 +80,7 @@ open class RootController: UIViewController {
*/ */
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
prepareView() prepare()
} }
/** /**
...@@ -90,7 +90,7 @@ open class RootController: UIViewController { ...@@ -90,7 +90,7 @@ open class RootController: UIViewController {
public init(rootViewController: UIViewController) { public init(rootViewController: UIViewController) {
super.init(nibName: nil, bundle: nil) super.init(nibName: nil, bundle: nil)
self.rootViewController = rootViewController self.rootViewController = rootViewController
prepareView() prepare()
} }
open override func viewWillLayoutSubviews() { open override func viewWillLayoutSubviews() {
...@@ -145,12 +145,12 @@ open class RootController: UIViewController { ...@@ -145,12 +145,12 @@ open class RootController: UIViewController {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepare() {
view.clipsToBounds = true view.clipsToBounds = true
view.backgroundColor = Color.white view.backgroundColor = Color.white
view.contentScaleFactor = Device.scale view.contentScaleFactor = Device.scale
...@@ -160,7 +160,7 @@ open class RootController: UIViewController { ...@@ -160,7 +160,7 @@ open class RootController: UIViewController {
/// A method that prepares the rootViewController. /// A method that prepares the rootViewController.
internal func prepareRootViewController() { internal func prepareRootViewController() {
prepareViewControllerWithinContainer(viewController: rootViewController, container: view) prepareControllerWithinContainer(viewController: rootViewController, container: view)
} }
/** /**
...@@ -171,7 +171,7 @@ open class RootController: UIViewController { ...@@ -171,7 +171,7 @@ open class RootController: UIViewController {
- Parameter container: A UIView that is the parent of the - Parameter container: A UIView that is the parent of the
passed in controller view within the view hierarchy. passed in controller view within the view hierarchy.
*/ */
internal func prepareViewControllerWithinContainer(viewController: UIViewController?, container: UIView) { internal func prepareControllerWithinContainer(viewController: UIViewController?, container: UIView) {
if let v: UIViewController = viewController { if let v: UIViewController = viewController {
addChildViewController(v) addChildViewController(v)
container.addSubview(v.view) container.addSubview(v.view)
......
...@@ -127,13 +127,13 @@ open class SearchBar: BarView { ...@@ -127,13 +127,13 @@ open class SearchBar: BarView {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
interimSpacePreset = .interimSpace3 interimSpacePreset = .interimSpace3
contentEdgeInsetsPreset = .square1 contentEdgeInsetsPreset = .square1
prepareTextField() prepareTextField()
......
...@@ -73,13 +73,13 @@ open class SearchBarController: RootController { ...@@ -73,13 +73,13 @@ open class SearchBarController: RootController {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
prepareSearchBar() prepareSearchBar()
} }
......
...@@ -86,13 +86,13 @@ open class Snackbar: BarView { ...@@ -86,13 +86,13 @@ open class Snackbar: BarView {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
depthPreset = .none depthPreset = .none
interimSpacePreset = .interimSpace8 interimSpacePreset = .interimSpace8
contentEdgeInsets.left = interimSpace contentEdgeInsets.left = interimSpace
......
...@@ -163,13 +163,13 @@ open class SnackbarController: RootController { ...@@ -163,13 +163,13 @@ open class SnackbarController: RootController {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
prepareSnackbar() prepareSnackbar()
} }
......
...@@ -66,13 +66,13 @@ open class StatusBarController: RootController { ...@@ -66,13 +66,13 @@ open class StatusBarController: RootController {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
prepareStatusBarView() prepareStatusBarView()
} }
......
...@@ -199,13 +199,13 @@ open class TabBar: BarView { ...@@ -199,13 +199,13 @@ open class TabBar: BarView {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
autoresizingMask = .flexibleWidth autoresizingMask = .flexibleWidth
prepareLine() prepareLine()
......
...@@ -68,7 +68,7 @@ open class TableViewCell: UITableViewCell { ...@@ -68,7 +68,7 @@ open class TableViewCell: UITableViewCell {
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView() prepare()
} }
/** /**
...@@ -78,7 +78,7 @@ open class TableViewCell: UITableViewCell { ...@@ -78,7 +78,7 @@ open class TableViewCell: UITableViewCell {
*/ */
public override init(style: UITableViewCellStyle, reuseIdentifier: String!) { public override init(style: UITableViewCellStyle, reuseIdentifier: String!) {
super.init(style: style, reuseIdentifier: reuseIdentifier) super.init(style: style, reuseIdentifier: reuseIdentifier)
prepareView() prepare()
} }
open override func layoutSublayers(of layer: CALayer) { open override func layoutSublayers(of layer: CALayer) {
...@@ -145,12 +145,12 @@ open class TableViewCell: UITableViewCell { ...@@ -145,12 +145,12 @@ open class TableViewCell: UITableViewCell {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepare() {
selectionStyle = .none selectionStyle = .none
separatorInset = .zero separatorInset = .zero
contentScaleFactor = Device.scale contentScaleFactor = Device.scale
......
...@@ -291,7 +291,7 @@ open class TextField: UITextField { ...@@ -291,7 +291,7 @@ open class TextField: UITextField {
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView() prepare()
} }
/** /**
...@@ -302,7 +302,7 @@ open class TextField: UITextField { ...@@ -302,7 +302,7 @@ open class TextField: UITextField {
*/ */
public override init(frame: CGRect) { public override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
prepareView() prepare()
} }
/// A convenience initializer. /// A convenience initializer.
...@@ -359,12 +359,12 @@ open class TextField: UITextField { ...@@ -359,12 +359,12 @@ open class TextField: UITextField {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepare() {
super.placeholder = nil super.placeholder = nil
clipsToBounds = false clipsToBounds = false
borderStyle = .none borderStyle = .none
......
...@@ -114,7 +114,7 @@ public class TextView: UITextView { ...@@ -114,7 +114,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() prepare()
} }
/** /**
...@@ -126,7 +126,7 @@ public class TextView: UITextView { ...@@ -126,7 +126,7 @@ public class TextView: UITextView {
*/ */
public override init(frame: CGRect, textContainer: NSTextContainer?) { public override init(frame: CGRect, textContainer: NSTextContainer?) {
super.init(frame: frame, textContainer: textContainer) super.init(frame: frame, textContainer: textContainer)
prepareView() prepare()
} }
/** /**
...@@ -214,12 +214,12 @@ public class TextView: UITextView { ...@@ -214,12 +214,12 @@ public class TextView: UITextView {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
public func prepareView() { public func prepare() {
contentScaleFactor = Device.scale contentScaleFactor = Device.scale
textContainerInset = .zero textContainerInset = .zero
backgroundColor = Color.white backgroundColor = Color.white
......
...@@ -140,13 +140,13 @@ open class Toolbar: BarView { ...@@ -140,13 +140,13 @@ open class Toolbar: BarView {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
contentViewAlignment = .center contentViewAlignment = .center
interimSpacePreset = .interimSpace3 interimSpacePreset = .interimSpace3
contentEdgeInsetsPreset = .square1 contentEdgeInsetsPreset = .square1
......
...@@ -176,13 +176,13 @@ open class ToolbarController: RootController { ...@@ -176,13 +176,13 @@ open class ToolbarController: RootController {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open override func prepareView() { open override func prepare() {
super.prepareView() super.prepare()
prepareToolbar() prepareToolbar()
} }
......
...@@ -132,7 +132,7 @@ open class View: UIView { ...@@ -132,7 +132,7 @@ open class View: 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() prepare()
} }
/** /**
...@@ -144,7 +144,7 @@ open class View: UIView { ...@@ -144,7 +144,7 @@ open class View: UIView {
public override init(frame: CGRect) { public override init(frame: CGRect) {
contentsGravityPreset = .ResizeAspectFill contentsGravityPreset = .ResizeAspectFill
super.init(frame: frame) super.init(frame: frame)
prepareView() prepare()
} }
/// A convenience initializer. /// A convenience initializer.
...@@ -167,12 +167,12 @@ open class View: UIView { ...@@ -167,12 +167,12 @@ open class View: UIView {
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method it is recommended to override the prepare method
to initialize property values and other setup operations. to initialize property values and other setup operations.
The super.prepareView method should always be called immediately The super.prepare method should always be called immediately
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepare() {
contentScaleFactor = Device.scale contentScaleFactor = Device.scale
backgroundColor = Color.white backgroundColor = Color.white
prepareVisualLayer() prepareVisualLayer()
......
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