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
6e3438dc
Commit
6e3438dc
authored
Feb 16, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated TextView to handle lower case characters that extend beyond the frame height
parent
76395176
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
15 deletions
+10
-15
Sources/TextField.swift
+4
-8
Sources/TextView.swift
+6
-7
No files found.
Sources/TextField.swift
View file @
6e3438dc
...
...
@@ -273,7 +273,7 @@ public class TextField : UITextField {
A property that sets the distance between the textField and
titleLabel.
*/
public
var
titleLabelAnimationDistance
:
CGFloat
=
8
public
var
titleLabelAnimationDistance
:
CGFloat
=
4
/// An override to the text property.
public
override
var
text
:
String
?
{
...
...
@@ -311,7 +311,7 @@ public class TextField : UITextField {
A property that sets the distance between the textField and
detailLabel.
*/
public
var
detailLabelAnimationDistance
:
CGFloat
=
8
public
var
detailLabelAnimationDistance
:
CGFloat
=
4
/**
:name: detailLabelHidden
...
...
@@ -335,7 +335,7 @@ public class TextField : UITextField {
}
/// A multiplier for the titleLabel and detailLabel frame height.
public
private(set)
var
scale
:
CGFloat
=
UIScreen
.
mainScreen
()
.
scale
public
private(set)
var
scale
:
CGFloat
=
2
/**
An initializer that initializes the object with a NSCoder object.
...
...
@@ -416,12 +416,8 @@ public class TextField : UITextField {
if interrupted.
*/
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
let
a
:
CAPropertyAnimation
=
anim
as?
CAPropertyAnimation
{
if
let
b
:
CABasicAnimation
=
a
as?
CABasicAnimation
{
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKey
:
b
.
keyPath
!
)
}
if
anim
is
CAPropertyAnimation
{
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
layer
.
removeAnimationForKey
(
a
.
keyPath
!
)
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
for
x
in
a
.
animations
!
{
animationDidStop
(
x
,
finished
:
true
)
...
...
Sources/TextView.swift
View file @
6e3438dc
...
...
@@ -263,7 +263,7 @@ public class TextView: UITextView {
A property that sets the distance between the textView and
titleLabel.
*/
public
var
titleLabelAnimationDistance
:
CGFloat
=
8
public
var
titleLabelAnimationDistance
:
CGFloat
=
4
/// Placeholder UILabel view.
public
var
placeholderLabel
:
UILabel
?
{
...
...
@@ -303,6 +303,9 @@ public class TextView: UITextView {
}
}
/// A multiplier for the titleLabel and detailLabel frame height.
public
private(set)
var
scale
:
CGFloat
=
2
/**
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
...
...
@@ -399,12 +402,8 @@ public class TextView: UITextView {
if interrupted.
*/
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
let
a
:
CAPropertyAnimation
=
anim
as?
CAPropertyAnimation
{
if
let
b
:
CABasicAnimation
=
a
as?
CABasicAnimation
{
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKey
:
b
.
keyPath
!
)
}
if
anim
is
CAPropertyAnimation
{
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
layer
.
removeAnimationForKey
(
a
.
keyPath
!
)
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
for
x
in
a
.
animations
!
{
animationDidStop
(
x
,
finished
:
true
)
...
...
@@ -512,7 +511,7 @@ public class TextView: UITextView {
v
.
text
=
s
}
}
let
h
:
CGFloat
=
v
.
font
.
pointSize
let
h
:
CGFloat
=
v
.
font
.
pointSize
*
scale
v
.
frame
=
CGRectMake
(
0
,
-
h
,
bounds
.
width
,
h
)
v
.
hidden
=
false
UIView
.
animateWithDuration
(
0.25
,
animations
:
{
[
unowned
self
]
in
...
...
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