Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
a1629384
Commit
a1629384
authored
Feb 15, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated NavigationBarView with auto handling for orientation changes
parent
fedaf01a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
160 additions
and
341 deletions
+160
-341
Examples/Programmatic/MaterialSwitch/MaterialSwitch/ViewController.swift
+44
-45
Examples/Programmatic/NavigationBarView/NavigationBarView/ViewController.swift
+18
-210
Examples/Programmatic/SearchBarView/SearchBarView/ViewController.swift
+1
-1
README.md
+1
-3
Sources/MaterialButton.swift
+6
-6
Sources/MaterialPulseView.swift
+5
-5
Sources/MaterialSwitch.swift
+7
-7
Sources/MaterialView.swift
+1
-1
Sources/NavigationBarView.swift
+76
-62
Sources/TextField.swift
+1
-1
No files found.
Examples/Programmatic/MaterialSwitch/MaterialSwitch/ViewController.swift
View file @
a1629384
...
...
@@ -40,7 +40,7 @@ class ViewController: UIViewController, MaterialSwitchDelegate {
super
.
viewDidLoad
()
prepareView
()
prepareSmallMaterialSwitch
()
prepare
Normal
MaterialSwitch
()
prepare
Default
MaterialSwitch
()
prepareLargeMaterialSwitch
()
prepareLightOnDisabledMaterialSwitch
()
prepareLightOffDisabledMaterialSwitch
()
...
...
@@ -55,76 +55,75 @@ class ViewController: UIViewController, MaterialSwitchDelegate {
/// Prepares the Small MaterialSwitch.
private
func
prepareSmallMaterialSwitch
()
{
let
materialSwitch
:
MaterialSwitch
=
MaterialSwitch
(
state
:
.
Off
,
style
:
.
Light
,
size
:
.
Small
)
materialSwitch
.
center
=
view
.
center
materialSwitch
.
y
-=
100
materialSwitch
.
delegate
=
self
view
.
addSubview
(
materialSwitch
)
let
switchControl
:
MaterialSwitch
=
MaterialSwitch
(
state
:
.
Off
,
style
:
.
Light
,
size
:
.
Small
)
switchControl
.
center
=
view
.
center
switchControl
.
y
-=
100
switchControl
.
delegate
=
self
view
.
addSubview
(
switchControl
)
}
/// Prepares the
Normal
MaterialSwitch.
private
func
prepare
Normal
MaterialSwitch
()
{
let
materialSwitch
:
MaterialSwitch
=
MaterialSwitch
(
state
:
.
On
,
style
:
.
Light
,
size
:
.
Normal
)
materialSwitch
.
delegate
=
self
/// Prepares the
Default
MaterialSwitch.
private
func
prepare
Default
MaterialSwitch
()
{
let
switchControl
:
MaterialSwitch
=
MaterialSwitch
(
state
:
.
On
,
style
:
.
Light
)
switchControl
.
delegate
=
self
view
.
addSubview
(
materialSwitch
)
materialSwitch
.
translatesAutoresizingMaskIntoConstraints
=
false
MaterialLayout
.
size
(
view
,
child
:
materialSwitch
,
width
:
materialSwitch
.
width
,
height
:
materialSwitch
.
height
)
MaterialLayout
.
alignFromBottomRight
(
view
,
child
:
materialSwitch
,
bottom
:
16
,
right
:
16
)
view
.
addSubview
(
switchControl
)
switchControl
.
translatesAutoresizingMaskIntoConstraints
=
false
MaterialLayout
.
alignFromBottomRight
(
view
,
child
:
switchControl
,
bottom
:
16
,
right
:
16
)
}
/// Prepares the Large MaterialSwitch.
private
func
prepareLargeMaterialSwitch
()
{
let
image
:
UIImage
?
=
UIImage
(
named
:
"ic_alarm_white_18pt"
)
let
materialSwitch
:
MaterialSwitch
=
MaterialSwitch
(
state
:
.
Off
,
style
:
.
Light
,
size
:
.
Large
)
materialSwitch
.
center
=
view
.
center
materialSwitch
.
y
-=
50
materialSwitch
.
delegate
=
self
materialSwitch
.
button
.
setImage
(
image
,
forState
:
.
Normal
)
materialSwitch
.
button
.
setImage
(
image
,
forState
:
.
Highlighted
)
view
.
addSubview
(
materialSwitch
)
let
switchControl
:
MaterialSwitch
=
MaterialSwitch
(
state
:
.
Off
,
style
:
.
Light
,
size
:
.
Large
)
switchControl
.
center
=
view
.
center
switchControl
.
y
-=
50
switchControl
.
delegate
=
self
switchControl
.
button
.
setImage
(
image
,
forState
:
.
Normal
)
switchControl
.
button
.
setImage
(
image
,
forState
:
.
Highlighted
)
view
.
addSubview
(
switchControl
)
}
/// Prepares the Light On enabled = false MaterialSwitch.
private
func
prepareLightOnDisabledMaterialSwitch
()
{
let
materialSwitch
:
MaterialSwitch
=
MaterialSwitch
(
state
:
.
On
,
style
:
.
Light
,
size
:
.
Normal
)
materialSwitch
.
enabled
=
false
materialSwitch
.
center
=
view
.
center
materialSwitch
.
delegate
=
self
view
.
addSubview
(
materialSwitch
)
let
switchControl
:
MaterialSwitch
=
MaterialSwitch
(
state
:
.
On
,
style
:
.
Light
)
switchControl
.
enabled
=
false
switchControl
.
center
=
view
.
center
switchControl
.
delegate
=
self
view
.
addSubview
(
switchControl
)
}
/// Prepares the Light Off enabled = false MaterialSwitch.
private
func
prepareLightOffDisabledMaterialSwitch
()
{
let
materialSwitch
:
MaterialSwitch
=
MaterialSwitch
(
state
:
.
Off
,
style
:
.
Light
,
size
:
.
Normal
)
materialSwitch
.
enabled
=
false
materialSwitch
.
center
=
view
.
center
materialSwitch
.
y
+=
50
materialSwitch
.
delegate
=
self
view
.
addSubview
(
materialSwitch
)
let
switchControl
:
MaterialSwitch
=
MaterialSwitch
(
state
:
.
Off
,
style
:
.
Light
)
switchControl
.
enabled
=
false
switchControl
.
center
=
view
.
center
switchControl
.
y
+=
50
switchControl
.
delegate
=
self
view
.
addSubview
(
switchControl
)
}
/// Prepares the Dark On enabled = false MaterialSwitch.
private
func
prepareDarkOnDisabledMaterialSwitch
()
{
let
materialSwitch
:
MaterialSwitch
=
MaterialSwitch
(
state
:
.
On
,
style
:
.
Dark
,
size
:
.
Normal
)
materialSwitch
.
enabled
=
false
materialSwitch
.
center
=
view
.
center
materialSwitch
.
y
+=
100
materialSwitch
.
delegate
=
self
view
.
addSubview
(
materialSwitch
)
let
switchControl
:
MaterialSwitch
=
MaterialSwitch
(
state
:
.
On
,
style
:
.
Dark
)
switchControl
.
enabled
=
false
switchControl
.
center
=
view
.
center
switchControl
.
y
+=
100
switchControl
.
delegate
=
self
view
.
addSubview
(
switchControl
)
}
/// Prepares the Dark On enabled = false MaterialSwitch.
private
func
prepareDarkOffDisabledMaterialSwitch
()
{
let
materialSwitch
:
MaterialSwitch
=
MaterialSwitch
(
state
:
.
Off
,
style
:
.
Dark
,
size
:
.
Normal
)
materialSwitch
.
enabled
=
false
materialSwitch
.
center
=
view
.
center
materialSwitch
.
y
+=
150
materialSwitch
.
delegate
=
self
view
.
addSubview
(
materialSwitch
)
let
switchControl
:
MaterialSwitch
=
MaterialSwitch
(
state
:
.
Off
,
style
:
.
Dark
)
switchControl
.
enabled
=
false
switchControl
.
center
=
view
.
center
switchControl
.
y
+=
150
switchControl
.
delegate
=
self
view
.
addSubview
(
switchControl
)
}
internal
func
materialSwitch
StateChanged
(
control
:
MaterialSwitch
,
state
:
MaterialSwitchState
)
{
internal
func
switchControl
StateChanged
(
control
:
MaterialSwitch
,
state
:
MaterialSwitchState
)
{
print
(
"MaterialSwitch - Size:
\(
control
.
switchSize
)
State:
\(
state
)
"
)
}
}
Examples/Programmatic/NavigationBarView/NavigationBarView/ViewController.swift
View file @
a1629384
This diff is collapsed.
Click to expand it.
Examples/Programmatic/SearchBarView/SearchBarView/ViewController.swift
View file @
a1629384
...
...
@@ -81,7 +81,7 @@ class ViewController: UIViewController {
searchBarView
.
textField
.
font
=
RobotoFont
.
regularWithSize
(
22
)
searchBarView
.
leftControls
=
[
menuButton
]
searchBarView
.
rightControls
=
[
searchButton
]
//
searchBarView.rightControls = [searchButton]
view
.
addSubview
(
searchBarView
)
searchBarView
.
translatesAutoresizingMaskIntoConstraints
=
false
...
...
README.md
View file @
a1629384
...
...
@@ -69,17 +69,15 @@ Material is a growing project and will encounter changes throughout its developm
## Upcoming
*
SearchBarView
*
MenuViewController
*
SearchBarViewController
*
TabView
*
TabViewController
*
Scrolling Techniques
*
Dialogs
*
Snackbar
*
ProgressBar (circular and horizontal)
*
DatePicker
*
TimePicker
*
Switch Control
*
More Examples
<a
name=
"materialcolor"
></a>
...
...
Sources/MaterialButton.swift
View file @
a1629384
...
...
@@ -297,7 +297,7 @@ public class MaterialButton : UIButton {
prepareView
()
}
/// A convenience initializer
that is mostly used with AutoLayout
.
/// A convenience initializer.
public
convenience
init
()
{
self
.
init
(
frame
:
CGRectNull
)
}
...
...
@@ -406,8 +406,8 @@ public class MaterialButton : UIButton {
}
if
let
v
:
CFTimeInterval
=
pulseAnimation
(
point
!
)
{
MaterialAnimation
.
delay
(
v
)
{
[
unowned
self
]
in
self
.
shrinkAnimation
()
MaterialAnimation
.
delay
(
v
)
{
[
weak
self
]
in
self
?
.
shrinkAnimation
()
}
}
}
...
...
@@ -483,12 +483,12 @@ public class MaterialButton : UIButton {
pulseLayer
.
hidden
=
false
}
pulseLayer
.
addAnimation
(
MaterialAnimation
.
scale
(
3
*
d
,
duration
:
t
),
forKey
:
nil
)
MaterialAnimation
.
delay
(
t
)
{
[
unowned
self
]
in
if
nil
!=
self
.
pulseColor
&&
0
<
self
.
pulseColorOpacity
{
MaterialAnimation
.
delay
(
t
)
{
[
weak
self
]
in
if
nil
!=
self
&&
nil
!=
self
!.
pulseColor
&&
0
<
self
!
.
pulseColorOpacity
{
MaterialAnimation
.
animateWithDuration
(
t
,
animations
:
{
pulseLayer
.
hidden
=
true
})
{
pulseLayer
.
removeFromSuperlayer
()
pulseLayer
.
removeFromSuperlayer
()
}
}
}
...
...
Sources/MaterialPulseView.swift
View file @
a1629384
...
...
@@ -84,8 +84,8 @@ public class MaterialPulseView : MaterialView {
}
if
let
v
:
CFTimeInterval
=
pulseAnimation
(
point
!
)
{
MaterialAnimation
.
delay
(
v
)
{
[
unowned
self
]
in
self
.
shrinkAnimation
()
MaterialAnimation
.
delay
(
v
)
{
[
weak
self
]
in
self
?
.
shrinkAnimation
()
}
}
}
...
...
@@ -137,12 +137,12 @@ public class MaterialPulseView : MaterialView {
pulseLayer
.
hidden
=
false
}
pulseLayer
.
addAnimation
(
MaterialAnimation
.
scale
(
3
*
d
,
duration
:
t
),
forKey
:
nil
)
MaterialAnimation
.
delay
(
t
)
{
[
unowned
self
]
in
if
nil
!=
self
.
pulseColor
&&
0
<
self
.
pulseColorOpacity
{
MaterialAnimation
.
delay
(
t
)
{
[
weak
self
]
in
if
nil
!=
self
&&
nil
!=
self
!.
pulseColor
&&
0
<
self
!
.
pulseColorOpacity
{
MaterialAnimation
.
animateWithDuration
(
t
,
animations
:
{
pulseLayer
.
hidden
=
true
})
{
pulseLayer
.
removeFromSuperlayer
()
pulseLayer
.
removeFromSuperlayer
()
}
}
}
...
...
Sources/MaterialSwitch.swift
View file @
a1629384
...
...
@@ -42,7 +42,7 @@ public enum MaterialSwitchState {
public
enum
MaterialSwitchSize
{
case
Small
case
Normal
case
Default
case
Large
}
...
...
@@ -195,14 +195,14 @@ public class MaterialSwitch: UIControl {
}
/// MaterialSwitch size.
public
var
switchSize
:
MaterialSwitchSize
=
.
Normal
{
public
var
switchSize
:
MaterialSwitchSize
=
.
Default
{
didSet
{
switch
switchSize
{
case
.
Small
:
trackThickness
=
13
buttonDiameter
=
18
frame
=
CGRectMake
(
0
,
0
,
30
,
25
)
case
.
Normal
:
case
.
Default
:
trackThickness
=
17
buttonDiameter
=
24
frame
=
CGRectMake
(
0
,
0
,
40
,
30
)
...
...
@@ -236,7 +236,7 @@ public class MaterialSwitch: UIControl {
super
.
init
(
coder
:
aDecoder
)
prepareTrack
()
prepareButton
()
prepareSwitchSize
(
.
Normal
)
prepareSwitchSize
(
.
Default
)
prepareSwitchStyle
(
.
Light
)
prepareSwitchState
(
.
Off
)
}
...
...
@@ -247,7 +247,7 @@ public class MaterialSwitch: UIControl {
- Parameter style: A MaterialSwitchStyle value.
- Parameter size: A MaterialSwitchSize value.
*/
public
init
(
state
:
MaterialSwitchState
=
.
On
,
style
:
MaterialSwitchStyle
=
.
Light
,
size
:
MaterialSwitchSize
=
.
Normal
)
{
public
init
(
state
:
MaterialSwitchState
=
.
On
,
style
:
MaterialSwitchStyle
=
.
Light
,
size
:
MaterialSwitchSize
=
.
Default
)
{
track
=
MaterialView
(
frame
:
CGRectZero
)
button
=
FabButton
(
frame
:
CGRectZero
)
super
.
init
(
frame
:
CGRectZero
)
...
...
@@ -267,7 +267,7 @@ public class MaterialSwitch: UIControl {
switch
switchSize
{
case
.
Small
:
return
CGSizeMake
(
30
,
25
)
case
.
Normal
:
case
.
Default
:
return
CGSizeMake
(
40
,
30
)
case
.
Large
:
return
CGSizeMake
(
50
,
40
)
...
...
@@ -456,7 +456,7 @@ public class MaterialSwitch: UIControl {
switch
switchSize
{
case
.
Small
:
w
=
30
case
.
Normal
:
case
.
Default
:
w
=
40
case
.
Large
:
w
=
50
...
...
Sources/MaterialView.swift
View file @
a1629384
...
...
@@ -336,7 +336,7 @@ public class MaterialView : UIView {
prepareView
()
}
/// A convenience initializer
that is mostly used with AutoLayout
.
/// A convenience initializer.
public
convenience
init
()
{
self
.
init
(
frame
:
CGRectNull
)
}
...
...
Sources/NavigationBarView.swift
View file @
a1629384
...
...
@@ -34,74 +34,41 @@ public class NavigationBarView : MaterialView {
/// TitleView that holds the titleLabel and detailLabel.
public
private(set)
lazy
var
titleView
:
MaterialView
=
MaterialView
()
/**
:name: statusBarStyle
*/
/// Device status bar style.
public
var
statusBarStyle
:
UIStatusBarStyle
=
UIApplication
.
sharedApplication
()
.
statusBarStyle
{
didSet
{
UIApplication
.
sharedApplication
()
.
statusBarStyle
=
statusBarStyle
}
}
/**
:name: contentInsets
*/
public
var
contentInsetPreset
:
MaterialEdgeInset
=
.
None
{
didSet
{
contentInset
=
MaterialEdgeInsetToValue
(
contentInsetPreset
)
}
}
/**
:name: contentInset
*/
public
var
contentInset
:
UIEdgeInsets
=
MaterialEdgeInsetToValue
(
.
Square2
)
{
didSet
{
reloadView
()
}
}
/**
:name: titleLabel
*/
/// Title label.
public
var
titleLabel
:
UILabel
?
{
didSet
{
if
let
v
:
UILabel
=
titleLabel
{
v
.
grid
.
rows
=
nil
==
detailLabel
?
3
:
2
titleView
.
addSubview
(
v
)
}
reloadView
()
}
}
/**
:name: detailLabel
*/
/// Detail label.
public
var
detailLabel
:
UILabel
?
{
didSet
{
if
let
v
:
UILabel
=
detailLabel
{
v
.
grid
.
rows
=
1
titleView
.
addSubview
(
v
)
titleLabel
?
.
grid
.
rows
=
2
}
else
{
titleLabel
?
.
grid
.
rows
=
3
}
reloadView
()
}
}
/**
:name: leftControls
*/
/// Left side UIControls.
public
var
leftControls
:
Array
<
UIControl
>
?
{
didSet
{
reloadView
()
}
}
/**
:name: rightControls
*/
/// Right side UIControls.
public
var
rightControls
:
Array
<
UIControl
>
?
{
didSet
{
reloadView
()
...
...
@@ -109,36 +76,74 @@ public class NavigationBarView : MaterialView {
}
/**
:name: init
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
*/
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
super
.
init
(
coder
:
aDecoder
)
}
/**
:name: init
An initializer that initializes the object with a CGRect object.
If AutoLayout is used, it is better to initilize the instance
using the init() initializer.
- Parameter frame: A CGRect instance.
*/
public
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
}
/**
:name: init
*/
/// A convenience initializer.
public
convenience
init
()
{
self
.
init
(
frame
:
CGRectMake
(
0
,
0
,
UIScreen
.
mainScreen
()
.
bounds
.
width
,
70
))
self
.
init
(
frame
:
CGRectMake
(
0
,
0
,
UIScreen
.
mainScreen
()
.
bounds
.
width
,
64
))
}
/**
:name: init
A convenience initializer with parameter settings.
- Parameter titleLabel: UILabel for the title.
- Parameter detailLabel: UILabel for the details.
- 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
?(
titleLabel
:
UILabel
?
=
nil
,
detailLabel
:
UILabel
?
=
nil
,
leftControls
:
Array
<
UIControl
>
?
=
nil
,
rightControls
:
Array
<
UIControl
>
?
=
nil
)
{
self
.
init
(
frame
:
CGRectMake
(
0
,
0
,
UIScreen
.
mainScreen
()
.
bounds
.
width
,
70
))
self
.
init
(
frame
:
CGRectMake
(
0
,
0
,
UIScreen
.
mainScreen
()
.
bounds
.
width
,
64
))
prepareProperties
(
titleLabel
,
detailLabel
:
detailLabel
,
leftControls
:
leftControls
,
rightControls
:
rightControls
)
}
public
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
// General alignment.
switch
UIDevice
.
currentDevice
()
.
orientation
{
case
.
LandscapeLeft
,
.
LandscapeRight
:
grid
.
contentInset
.
top
=
0
grid
.
contentInset
.
bottom
=
0
titleView
.
grid
.
spacing
=
2
titleView
.
grid
.
contentInset
.
top
=
4
titleView
.
grid
.
contentInset
.
bottom
=
8
height
=
44
default
:
grid
.
contentInset
.
top
=
20
grid
.
contentInset
.
bottom
=
8
titleView
.
grid
.
spacing
=
0
titleView
.
grid
.
contentInset
.
top
=
0
titleView
.
grid
.
contentInset
.
bottom
=
0
height
=
64
}
// TitleView alignment.
titleView
.
grid
.
axis
.
rows
=
6
if
let
v
:
UILabel
=
titleLabel
{
titleView
.
grid
.
views
?
.
append
(
v
)
v
.
grid
.
rows
=
nil
==
detailLabel
?
6
:
4
}
if
let
v
:
UILabel
=
detailLabel
{
titleView
.
grid
.
views
?
.
append
(
v
)
v
.
grid
.
rows
=
2
}
width
=
UIScreen
.
mainScreen
()
.
bounds
.
width
grid
.
axis
.
columns
=
Int
(
width
/
48
)
reloadView
()
}
...
...
@@ -147,9 +152,11 @@ public class NavigationBarView : MaterialView {
reloadView
()
}
/**
:name: reloadView
*/
public
override
func
intrinsicContentSize
()
->
CGSize
{
return
CGSizeMake
(
UIScreen
.
mainScreen
()
.
bounds
.
width
,
64
)
}
/// Reloads the view.
public
func
reloadView
()
{
layoutIfNeeded
()
...
...
@@ -162,7 +169,7 @@ public class NavigationBarView : MaterialView {
}
// Size of single grid column.
let
g
:
CGFloat
=
width
/
CGFloat
(
0
<
grid
.
columns
?
grid
.
columns
:
1
)
let
g
:
CGFloat
=
width
/
CGFloat
(
0
<
grid
.
axis
.
columns
?
grid
.
axis
.
columns
:
1
)
grid
.
views
=
[]
titleView
.
grid
.
columns
=
grid
.
axis
.
columns
...
...
@@ -206,6 +213,7 @@ public class NavigationBarView : MaterialView {
grid
.
reloadLayout
()
titleView
.
grid
.
views
=
[]
titleView
.
grid
.
axis
.
rows
=
6
if
let
v
:
UILabel
=
titleLabel
{
titleView
.
grid
.
views
?
.
append
(
v
)
}
...
...
@@ -216,32 +224,38 @@ public class NavigationBarView : MaterialView {
}
/**
:name: prepareView
Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method
to initialize property values and other setup operations.
The super.prepareView method should always be called immediately
when subclassing.
*/
public
override
func
prepareView
()
{
super
.
prepareView
()
grid
.
spacing
=
10
grid
.
axis
.
columns
=
8
grid
.
spacing
=
8
grid
.
axis
.
inherited
=
false
grid
.
contentInset
.
top
=
2
5
grid
.
contentInset
.
left
=
10
grid
.
contentInset
.
bottom
=
10
grid
.
contentInset
.
right
=
10
grid
.
contentInset
.
top
=
2
0
grid
.
contentInset
.
left
=
8
grid
.
contentInset
.
bottom
=
8
grid
.
contentInset
.
right
=
8
depth
=
.
Depth1
prepareT
ext
View
()
prepareT
itle
View
()
}
public
func
prepareTextView
()
{
/// Prepares the titleView.
public
func
prepareTitleView
()
{
titleView
.
backgroundColor
=
nil
titleView
.
grid
.
spacing
=
4
titleView
.
grid
.
axis
.
rows
=
3
titleView
.
grid
.
axis
.
inherited
=
false
titleView
.
grid
.
axis
.
direction
=
.
Vertical
addSubview
(
titleView
)
}
/**
:name: prepareProperties
Used to trigger property changes that initializers avoid.
- Parameter titleLabel: UILabel for the title.
- Parameter detailLabel: UILabel for the details.
- 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
(
titleLabel
:
UILabel
?,
detailLabel
:
UILabel
?,
leftControls
:
Array
<
UIControl
>
?,
rightControls
:
Array
<
UIControl
>
?)
{
self
.
titleLabel
=
titleLabel
...
...
Sources/TextField.swift
View file @
a1629384
...
...
@@ -362,7 +362,7 @@ public class TextField : UITextField {
prepareView
()
}
/// A convenience initializer
that is mostly used with AutoLayout
.
/// A convenience initializer.
public
convenience
init
()
{
self
.
init
(
frame
:
CGRectNull
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment