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
994062aa
Unverified
Commit
994062aa
authored
Dec 27, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Plain Diff
development: merge after fixing issue-640
parents
11d7c7c4
5c1dac60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
19 deletions
+9
-19
Sources/iOS/TextField.swift
+9
-19
No files found.
Sources/iOS/TextField.swift
View file @
994062aa
...
...
@@ -58,11 +58,6 @@ public protocol TextFieldDelegate: UITextFieldDelegate {
}
open
class
TextField
:
UITextField
{
/// Will layout the view.
open
var
willLayout
:
Bool
{
return
0
<
width
&&
0
<
height
&&
nil
!=
superview
}
/// Default size when using AutoLayout.
open
override
var
intrinsicContentSize
:
CGSize
{
return
CGSize
(
width
:
width
,
height
:
32
)
...
...
@@ -77,7 +72,7 @@ open class TextField: UITextField {
/// A boolean indicating whether the text is empty.
open
var
isEmpty
:
Bool
{
return
true
==
text
?
.
isEmpty
return
0
==
text
?
.
utf16
.
count
}
open
override
var
leftView
:
UIView
?
{
...
...
@@ -345,11 +340,6 @@ open class TextField: UITextField {
}
}
open
override
func
becomeFirstResponder
()
->
Bool
{
layoutSubviews
()
return
super
.
becomeFirstResponder
()
}
/**
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
...
...
@@ -377,7 +367,7 @@ open class TextField: UITextField {
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
guard
willLayout
&&
!
isAnimating
else
{
guard
!
isAnimating
else
{
return
}
...
...
@@ -385,7 +375,10 @@ open class TextField: UITextField {
reload
()
}
open
override
func
becomeFirstResponder
()
->
Bool
{
layoutSubviews
()
return
super
.
becomeFirstResponder
()
}
/**
Prepares the view instance when intialized. When subclassing,
...
...
@@ -482,12 +475,13 @@ extension TextField {
let
w
=
leftViewWidth
let
h
=
0
==
height
?
intrinsicContentSize
.
height
:
height
placeholderLabel
.
transform
=
CGAffineTransform
.
identity
guard
isEditing
||
!
isEmpty
||
!
isPlaceholderAnimated
else
{
placeholderLabel
.
frame
=
CGRect
(
x
:
w
,
y
:
0
,
width
:
width
-
w
,
height
:
h
)
return
}
placeholderLabel
.
transform
=
CGAffineTransform
.
identity
placeholderLabel
.
frame
=
CGRect
(
x
:
w
,
y
:
0
,
width
:
width
-
w
,
height
:
h
)
placeholderLabel
.
transform
=
CGAffineTransform
(
scaleX
:
0.75
,
y
:
0.75
)
...
...
@@ -505,7 +499,7 @@ extension TextField {
/// Layout the detailLabel.
fileprivate
func
layoutDetailLabel
()
{
let
c
=
dividerContentEdgeInsets
detailLabel
.
sizeToFit
()
detailLabel
.
height
=
detailLabel
.
sizeThatFits
(
CGSize
(
width
:
width
,
height
:
CGFloat
.
greatestFiniteMagnitude
))
.
height
detailLabel
.
x
=
c
.
left
detailLabel
.
y
=
height
+
detailVerticalOffset
detailLabel
.
width
=
width
-
c
.
left
-
c
.
right
...
...
@@ -513,10 +507,6 @@ extension TextField {
/// Layout the a button.
fileprivate
func
layoutButton
(
button
:
UIButton
?)
{
guard
0
<
width
&&
0
<
height
else
{
return
}
button
?
.
frame
=
CGRect
(
x
:
width
-
height
,
y
:
0
,
width
:
height
,
height
:
height
)
}
...
...
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