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
a0a9c77a
Commit
a0a9c77a
authored
Mar 03, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issue-194 where animation was not updating the value path correctly
parent
e097bb28
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
87 additions
and
11 deletions
+87
-11
Examples/Programmatic/CardView/CardView.xcodeproj/project.pbxproj
+6
-0
Examples/Programmatic/CardView/CardView/ViewController.swift
+40
-0
Examples/Programmatic/NavigationBarView/NavigationBarView.xcodeproj/project.pbxproj
+6
-0
Sources/MaterialButton.swift
+5
-1
Sources/MaterialCollectionViewCell.swift
+5
-1
Sources/MaterialLayer.swift
+5
-1
Sources/MaterialTableViewCell.swift
+5
-1
Sources/MaterialView.swift
+5
-3
Sources/TextField.swift
+5
-3
Sources/TextView.swift
+5
-1
No files found.
Examples/Programmatic/CardView/CardView.xcodeproj/project.pbxproj
View file @
a0a9c77a
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
objects
=
{
objects
=
{
/* Begin PBXBuildFile section */
/* Begin PBXBuildFile section */
965626701C88B7F4004ADEF7
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9656266F1C88B7F4004ADEF7
/* Material.framework */
;
};
965626711C88B7F4004ADEF7
/* Material.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9656266F1C88B7F4004ADEF7
/* Material.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
967513CA1C136BB7009F455A
/* AppDelegate.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
967513C91C136BB7009F455A
/* AppDelegate.swift */
;
};
967513CA1C136BB7009F455A
/* AppDelegate.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
967513C91C136BB7009F455A
/* AppDelegate.swift */
;
};
967513CC1C136BB7009F455A
/* ViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
967513CB1C136BB7009F455A
/* ViewController.swift */
;
};
967513CC1C136BB7009F455A
/* ViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
967513CB1C136BB7009F455A
/* ViewController.swift */
;
};
967513D11C136BB7009F455A
/* Assets.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
967513D01C136BB7009F455A
/* Assets.xcassets */
;
};
967513D11C136BB7009F455A
/* Assets.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
967513D01C136BB7009F455A
/* Assets.xcassets */
;
};
...
@@ -20,6 +22,7 @@
...
@@ -20,6 +22,7 @@
dstPath
=
""
;
dstPath
=
""
;
dstSubfolderSpec
=
10
;
dstSubfolderSpec
=
10
;
files
=
(
files
=
(
965626711C88B7F4004ADEF7
/* Material.framework in Embed Frameworks */
,
);
);
name
=
"Embed Frameworks"
;
name
=
"Embed Frameworks"
;
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
...
@@ -27,6 +30,7 @@
...
@@ -27,6 +30,7 @@
/* End PBXCopyFilesBuildPhase section */
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
/* Begin PBXFileReference section */
9656266F1C88B7F4004ADEF7
/* Material.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
name
=
Material.framework
;
path
=
"/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphoneos/Material.framework"
;
sourceTree
=
"<absolute>"
;
};
967513C61C136BB7009F455A
/* CardView.app */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.application
;
includeInIndex
=
0
;
path
=
CardView.app
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
967513C61C136BB7009F455A
/* CardView.app */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.application
;
includeInIndex
=
0
;
path
=
CardView.app
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
967513C91C136BB7009F455A
/* AppDelegate.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AppDelegate.swift
;
sourceTree
=
"<group>"
;
};
967513C91C136BB7009F455A
/* AppDelegate.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AppDelegate.swift
;
sourceTree
=
"<group>"
;
};
967513CB1C136BB7009F455A
/* ViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ViewController.swift
;
sourceTree
=
"<group>"
;
};
967513CB1C136BB7009F455A
/* ViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ViewController.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -40,6 +44,7 @@
...
@@ -40,6 +44,7 @@
isa
=
PBXFrameworksBuildPhase
;
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
buildActionMask
=
2147483647
;
files
=
(
files
=
(
965626701C88B7F4004ADEF7
/* Material.framework in Frameworks */
,
);
);
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
};
};
...
@@ -49,6 +54,7 @@
...
@@ -49,6 +54,7 @@
967513BD1C136BB7009F455A
=
{
967513BD1C136BB7009F455A
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
9656266F1C88B7F4004ADEF7
/* Material.framework */
,
967513C81C136BB7009F455A
/* CardView */
,
967513C81C136BB7009F455A
/* CardView */
,
967513C71C136BB7009F455A
/* Products */
,
967513C71C136BB7009F455A
/* Products */
,
);
);
...
...
Examples/Programmatic/CardView/CardView/ViewController.swift
View file @
a0a9c77a
...
@@ -58,6 +58,45 @@ class ViewController: UIViewController {
...
@@ -58,6 +58,45 @@ class ViewController: UIViewController {
:description: General usage example.
:description: General usage example.
*/
*/
private
func
prepareGeneralCardViewExample
()
{
private
func
prepareGeneralCardViewExample
()
{
// let cardView: CardView = CardView()
//
// // Title label.
// let titleLabel: UILabel = UILabel()
// titleLabel.text = "Welcome Back!"
// titleLabel.textColor = MaterialColor.blue.darken1
// titleLabel.font = RobotoFont.mediumWithSize(20)
// cardView.titleLabel = titleLabel
//
// // Detail label.
// let detailLabel: UILabel = UILabel()
// detailLabel.text = "It’s been a while, have you read any new books lately?"
// detailLabel.numberOfLines = 0
// cardView.detailView = detailLabel
//
// // Yes button.
// let btn1: FlatButton = FlatButton()
// btn1.pulseColor = MaterialColor.blue.lighten1
// btn1.pulseScale = false
// btn1.setTitle("YES", forState: .Normal)
// btn1.setTitleColor(MaterialColor.blue.darken1, forState: .Normal)
//
// // No button.
// let btn2: FlatButton = FlatButton()
// btn2.pulseColor = MaterialColor.blue.lighten1
// btn2.pulseScale = false
// btn2.setTitle("NO", forState: .Normal)
// btn2.setTitleColor(MaterialColor.blue.darken1, forState: .Normal)
//
// // Add buttons to left side.
// cardView.leftButtons = [btn1, btn2]
//
// // To support orientation changes, use MaterialLayout.
// view.addSubview(cardView)
// cardView.translatesAutoresizingMaskIntoConstraints = false
// MaterialLayout.alignFromTop(view, child: cardView, top: 100)
// MaterialLayout.alignToParentHorizontally(view, child: cardView, left: 20, right: 20)
let
cardView
:
CardView
=
CardView
()
let
cardView
:
CardView
=
CardView
()
// Title label.
// Title label.
...
@@ -96,6 +135,7 @@ class ViewController: UIViewController {
...
@@ -96,6 +135,7 @@ class ViewController: UIViewController {
MaterialLayout
.
alignFromTop
(
view
,
child
:
cardView
,
top
:
100
)
MaterialLayout
.
alignFromTop
(
view
,
child
:
cardView
,
top
:
100
)
MaterialLayout
.
alignToParentHorizontally
(
view
,
child
:
cardView
,
left
:
20
,
right
:
20
)
MaterialLayout
.
alignToParentHorizontally
(
view
,
child
:
cardView
,
left
:
20
,
right
:
20
)
cardView
.
animate
(
MaterialAnimation
.
translateY
(
200
))
}
}
/**
/**
...
...
Examples/Programmatic/NavigationBarView/NavigationBarView.xcodeproj/project.pbxproj
View file @
a0a9c77a
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
objects
=
{
objects
=
{
/* Begin PBXBuildFile section */
/* Begin PBXBuildFile section */
9656266A1C88242F004ADEF7
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
965626691C88242F004ADEF7
/* Material.framework */
;
};
9656266B1C88242F004ADEF7
/* Material.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
965626691C88242F004ADEF7
/* Material.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
96D88C831C132C1800B91418
/* AppDelegate.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96D88C821C132C1800B91418
/* AppDelegate.swift */
;
};
96D88C831C132C1800B91418
/* AppDelegate.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96D88C821C132C1800B91418
/* AppDelegate.swift */
;
};
96D88C851C132C1800B91418
/* ViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96D88C841C132C1800B91418
/* ViewController.swift */
;
};
96D88C851C132C1800B91418
/* ViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96D88C841C132C1800B91418
/* ViewController.swift */
;
};
96D88C8A1C132C1800B91418
/* Assets.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96D88C891C132C1800B91418
/* Assets.xcassets */
;
};
96D88C8A1C132C1800B91418
/* Assets.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96D88C891C132C1800B91418
/* Assets.xcassets */
;
};
...
@@ -20,6 +22,7 @@
...
@@ -20,6 +22,7 @@
dstPath
=
""
;
dstPath
=
""
;
dstSubfolderSpec
=
10
;
dstSubfolderSpec
=
10
;
files
=
(
files
=
(
9656266B1C88242F004ADEF7
/* Material.framework in Embed Frameworks */
,
);
);
name
=
"Embed Frameworks"
;
name
=
"Embed Frameworks"
;
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
...
@@ -27,6 +30,7 @@
...
@@ -27,6 +30,7 @@
/* End PBXCopyFilesBuildPhase section */
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
/* Begin PBXFileReference section */
965626691C88242F004ADEF7
/* Material.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
name
=
Material.framework
;
path
=
"/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphoneos/Material.framework"
;
sourceTree
=
"<absolute>"
;
};
96D88C7F1C132C1800B91418
/* NavigationBarView.app */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.application
;
includeInIndex
=
0
;
path
=
NavigationBarView.app
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
96D88C7F1C132C1800B91418
/* NavigationBarView.app */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.application
;
includeInIndex
=
0
;
path
=
NavigationBarView.app
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
96D88C821C132C1800B91418
/* AppDelegate.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AppDelegate.swift
;
sourceTree
=
"<group>"
;
};
96D88C821C132C1800B91418
/* AppDelegate.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AppDelegate.swift
;
sourceTree
=
"<group>"
;
};
96D88C841C132C1800B91418
/* ViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ViewController.swift
;
sourceTree
=
"<group>"
;
};
96D88C841C132C1800B91418
/* ViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ViewController.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -40,6 +44,7 @@
...
@@ -40,6 +44,7 @@
isa
=
PBXFrameworksBuildPhase
;
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
buildActionMask
=
2147483647
;
files
=
(
files
=
(
9656266A1C88242F004ADEF7
/* Material.framework in Frameworks */
,
);
);
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
};
};
...
@@ -49,6 +54,7 @@
...
@@ -49,6 +54,7 @@
96D88C761C132C1800B91418
=
{
96D88C761C132C1800B91418
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
965626691C88242F004ADEF7
/* Material.framework */
,
96D88C811C132C1800B91418
/* NavigationBarView */
,
96D88C811C132C1800B91418
/* NavigationBarView */
,
96D88C801C132C1800B91418
/* Products */
,
96D88C801C132C1800B91418
/* Products */
,
);
);
...
...
Sources/MaterialButton.swift
View file @
a0a9c77a
...
@@ -379,7 +379,11 @@ public class MaterialButton : UIButton {
...
@@ -379,7 +379,11 @@ public class MaterialButton : UIButton {
if interrupted.
if interrupted.
*/
*/
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
anim
is
CAPropertyAnimation
{
if
let
a
:
CAPropertyAnimation
=
anim
as?
CAPropertyAnimation
{
if
let
b
:
CABasicAnimation
=
a
as?
CABasicAnimation
{
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKeyPath
:
b
.
keyPath
!
)
}
layer
.
removeAnimationForKey
(
a
.
keyPath
!
)
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
for
x
in
a
.
animations
!
{
for
x
in
a
.
animations
!
{
...
...
Sources/MaterialCollectionViewCell.swift
View file @
a0a9c77a
...
@@ -432,7 +432,11 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
...
@@ -432,7 +432,11 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
if interrupted.
if interrupted.
*/
*/
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
anim
is
CAPropertyAnimation
{
if
let
a
:
CAPropertyAnimation
=
anim
as?
CAPropertyAnimation
{
if
let
b
:
CABasicAnimation
=
a
as?
CABasicAnimation
{
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKeyPath
:
b
.
keyPath
!
)
}
layer
.
removeAnimationForKey
(
a
.
keyPath
!
)
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
for
x
in
a
.
animations
!
{
for
x
in
a
.
animations
!
{
...
...
Sources/MaterialLayer.swift
View file @
a0a9c77a
...
@@ -308,7 +308,11 @@ public class MaterialLayer : CAShapeLayer {
...
@@ -308,7 +308,11 @@ public class MaterialLayer : CAShapeLayer {
if interrupted.
if interrupted.
*/
*/
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
anim
is
CAPropertyAnimation
{
if
let
a
:
CAPropertyAnimation
=
anim
as?
CAPropertyAnimation
{
if
let
b
:
CABasicAnimation
=
a
as?
CABasicAnimation
{
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKeyPath
:
b
.
keyPath
!
)
}
removeAnimationForKey
(
a
.
keyPath
!
)
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
for
x
in
a
.
animations
!
{
for
x
in
a
.
animations
!
{
...
...
Sources/MaterialTableViewCell.swift
View file @
a0a9c77a
...
@@ -334,7 +334,11 @@ public class MaterialTableViewCell: UITableViewCell {
...
@@ -334,7 +334,11 @@ public class MaterialTableViewCell: UITableViewCell {
if interrupted.
if interrupted.
*/
*/
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
anim
is
CAPropertyAnimation
{
if
let
a
:
CAPropertyAnimation
=
anim
as?
CAPropertyAnimation
{
if
let
b
:
CABasicAnimation
=
a
as?
CABasicAnimation
{
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKeyPath
:
b
.
keyPath
!
)
}
layer
.
removeAnimationForKey
(
a
.
keyPath
!
)
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
for
x
in
a
.
animations
!
{
for
x
in
a
.
animations
!
{
...
...
Sources/MaterialView.swift
View file @
a0a9c77a
...
@@ -420,7 +420,11 @@ public class MaterialView : UIView {
...
@@ -420,7 +420,11 @@ public class MaterialView : UIView {
if interrupted.
if interrupted.
*/
*/
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
anim
is
CAPropertyAnimation
{
if
let
a
:
CAPropertyAnimation
=
anim
as?
CAPropertyAnimation
{
if
let
b
:
CABasicAnimation
=
a
as?
CABasicAnimation
{
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKeyPath
:
b
.
keyPath
!
)
}
layer
.
removeAnimationForKey
(
a
.
keyPath
!
)
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
for
x
in
a
.
animations
!
{
for
x
in
a
.
animations
!
{
...
@@ -440,8 +444,6 @@ public class MaterialView : UIView {
...
@@ -440,8 +444,6 @@ public class MaterialView : UIView {
public
func
prepareView
()
{
public
func
prepareView
()
{
prepareVisualLayer
()
prepareVisualLayer
()
backgroundColor
=
MaterialColor
.
white
backgroundColor
=
MaterialColor
.
white
shadowColor
=
MaterialColor
.
black
borderColor
=
MaterialColor
.
black
}
}
/// Prepares the visualLayer property.
/// Prepares the visualLayer property.
...
...
Sources/TextField.swift
View file @
a0a9c77a
...
@@ -487,7 +487,11 @@ public class TextField : UITextField {
...
@@ -487,7 +487,11 @@ public class TextField : UITextField {
if interrupted.
if interrupted.
*/
*/
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
anim
is
CAPropertyAnimation
{
if
let
a
:
CAPropertyAnimation
=
anim
as?
CAPropertyAnimation
{
if
let
b
:
CABasicAnimation
=
a
as?
CABasicAnimation
{
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKeyPath
:
b
.
keyPath
!
)
}
layer
.
removeAnimationForKey
(
a
.
keyPath
!
)
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
for
x
in
a
.
animations
!
{
for
x
in
a
.
animations
!
{
...
@@ -505,8 +509,6 @@ public class TextField : UITextField {
...
@@ -505,8 +509,6 @@ public class TextField : UITextField {
*/
*/
public
func
prepareView
()
{
public
func
prepareView
()
{
backgroundColor
=
MaterialColor
.
white
backgroundColor
=
MaterialColor
.
white
shadowColor
=
MaterialColor
.
black
borderColor
=
MaterialColor
.
black
masksToBounds
=
false
masksToBounds
=
false
clearButtonMode
=
.
WhileEditing
clearButtonMode
=
.
WhileEditing
prepareBottomBorderLayer
()
prepareBottomBorderLayer
()
...
...
Sources/TextView.swift
View file @
a0a9c77a
...
@@ -432,7 +432,11 @@ public class TextView: UITextView {
...
@@ -432,7 +432,11 @@ public class TextView: UITextView {
if interrupted.
if interrupted.
*/
*/
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
anim
is
CAPropertyAnimation
{
if
let
a
:
CAPropertyAnimation
=
anim
as?
CAPropertyAnimation
{
if
let
b
:
CABasicAnimation
=
a
as?
CABasicAnimation
{
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKeyPath
:
b
.
keyPath
!
)
}
layer
.
removeAnimationForKey
(
a
.
keyPath
!
)
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
}
else
if
let
a
:
CAAnimationGroup
=
anim
as?
CAAnimationGroup
{
for
x
in
a
.
animations
!
{
for
x
in
a
.
animations
!
{
...
...
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