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
7407d97f
Commit
7407d97f
authored
Jul 14, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Swift 2.3 progression commit
parent
f778d3dc
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
82 additions
and
78 deletions
+82
-78
Sources/iOS/Button.swift
+2
-2
Sources/iOS/Material+UIImage+FilterBlur.swift
+1
-1
Sources/iOS/MaterialBasicAnimation.swift
+6
-7
Sources/iOS/MaterialCollectionReusableView.swift
+25
-25
Sources/iOS/MaterialCollectionViewCell.swift
+6
-6
Sources/iOS/MaterialTableViewCell.swift
+27
-22
Sources/iOS/MaterialTextLayer.swift
+1
-1
Sources/iOS/NavigationBar.swift
+3
-3
Sources/iOS/PulseView.swift
+2
-2
Sources/iOS/TextField.swift
+5
-5
Sources/iOS/TextView.swift
+4
-4
No files found.
Sources/iOS/Button.swift
View file @
7407d97f
...
@@ -56,9 +56,9 @@ public class Button: UIButton {
...
@@ -56,9 +56,9 @@ public class Button: UIButton {
@IBInspectable
public
var
pulseColor
:
UIColor
=
Color
.
grey
.
base
@IBInspectable
public
var
pulseColor
:
UIColor
=
Color
.
grey
.
base
/// The type of PulseAnimation.
/// The type of PulseAnimation.
public
var
pulseAnimation
:
PulseAnimation
=
.
AtP
ointWithBacking
{
public
var
pulseAnimation
:
PulseAnimation
=
.
p
ointWithBacking
{
didSet
{
didSet
{
visualLayer
.
masksToBounds
=
.
C
enterRadialBeyondBounds
!=
pulseAnimation
visualLayer
.
masksToBounds
=
.
c
enterRadialBeyondBounds
!=
pulseAnimation
}
}
}
}
...
...
Sources/iOS/Material+UIImage+FilterBlur.swift
View file @
7407d97f
...
@@ -141,7 +141,7 @@ public extension UIImage {
...
@@ -141,7 +141,7 @@ public extension UIImage {
// Add in color tint.
// Add in color tint.
if
let
v
:
UIColor
=
tintColor
{
if
let
v
:
UIColor
=
tintColor
{
CGContextSaveGState
(
outputContext
)
CGContextSaveGState
(
outputContext
)
CGContextSetFillColorWithColor
(
outputContext
,
v
.
CG
Color
)
CGContextSetFillColorWithColor
(
outputContext
,
v
.
cg
Color
)
CGContextFillRect
(
outputContext
,
imageRect
)
CGContextFillRect
(
outputContext
,
imageRect
)
CGContextRestoreGState
(
outputContext
)
CGContextRestoreGState
(
outputContext
)
}
}
...
...
Sources/iOS/MaterialBasicAnimation.swift
View file @
7407d97f
...
@@ -36,9 +36,9 @@ public extension MaterialAnimation {
...
@@ -36,9 +36,9 @@ public extension MaterialAnimation {
*/
*/
public
static
func
backgroundColor
(
color
:
UIColor
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
public
static
func
backgroundColor
(
color
:
UIColor
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
let
animation
:
CABasicAnimation
=
CABasicAnimation
(
keyPath
:
"backgroundColor"
)
let
animation
:
CABasicAnimation
=
CABasicAnimation
(
keyPath
:
"backgroundColor"
)
animation
.
toValue
=
color
.
CG
Color
animation
.
toValue
=
color
.
cg
Color
animation
.
fillMode
=
MaterialAnimationFillModeToValue
(
.
Forwards
)
animation
.
fillMode
=
MaterialAnimationFillModeToValue
(
mode
:
.
Forwards
)
animation
.
r
emovedOnCompletion
=
false
animation
.
isR
emovedOnCompletion
=
false
animation
.
timingFunction
=
CAMediaTimingFunction
(
name
:
kCAMediaTimingFunctionEaseInEaseOut
)
animation
.
timingFunction
=
CAMediaTimingFunction
(
name
:
kCAMediaTimingFunctionEaseInEaseOut
)
if
let
v
:
CFTimeInterval
=
duration
{
if
let
v
:
CFTimeInterval
=
duration
{
animation
.
duration
=
v
animation
.
duration
=
v
...
@@ -53,7 +53,7 @@ public extension MaterialAnimation {
...
@@ -53,7 +53,7 @@ public extension MaterialAnimation {
let
animation
:
CABasicAnimation
=
CABasicAnimation
(
keyPath
:
"cornerRadius"
)
let
animation
:
CABasicAnimation
=
CABasicAnimation
(
keyPath
:
"cornerRadius"
)
animation
.
toValue
=
radius
animation
.
toValue
=
radius
animation
.
fillMode
=
MaterialAnimationFillModeToValue
(
.
Forwards
)
animation
.
fillMode
=
MaterialAnimationFillModeToValue
(
.
Forwards
)
animation
.
r
emovedOnCompletion
=
false
animation
.
isR
emovedOnCompletion
=
false
animation
.
timingFunction
=
CAMediaTimingFunction
(
name
:
kCAMediaTimingFunctionEaseInEaseOut
)
animation
.
timingFunction
=
CAMediaTimingFunction
(
name
:
kCAMediaTimingFunctionEaseInEaseOut
)
if
let
v
:
CFTimeInterval
=
duration
{
if
let
v
:
CFTimeInterval
=
duration
{
animation
.
duration
=
v
animation
.
duration
=
v
...
@@ -68,7 +68,7 @@ public extension MaterialAnimation {
...
@@ -68,7 +68,7 @@ public extension MaterialAnimation {
let
animation
:
CABasicAnimation
=
CABasicAnimation
(
keyPath
:
"transform"
)
let
animation
:
CABasicAnimation
=
CABasicAnimation
(
keyPath
:
"transform"
)
animation
.
toValue
=
NSValue
(
CATransform3D
:
transform
)
animation
.
toValue
=
NSValue
(
CATransform3D
:
transform
)
animation
.
fillMode
=
MaterialAnimationFillModeToValue
(
.
Forwards
)
animation
.
fillMode
=
MaterialAnimationFillModeToValue
(
.
Forwards
)
animation
.
r
emovedOnCompletion
=
false
animation
.
isR
emovedOnCompletion
=
false
animation
.
timingFunction
=
CAMediaTimingFunction
(
name
:
kCAMediaTimingFunctionEaseInEaseOut
)
animation
.
timingFunction
=
CAMediaTimingFunction
(
name
:
kCAMediaTimingFunctionEaseInEaseOut
)
if
let
v
:
CFTimeInterval
=
duration
{
if
let
v
:
CFTimeInterval
=
duration
{
animation
.
duration
=
v
animation
.
duration
=
v
...
@@ -298,4 +298,4 @@ public extension MaterialAnimation {
...
@@ -298,4 +298,4 @@ public extension MaterialAnimation {
}
}
return
animation
return
animation
}
}
}
}
\ No newline at end of file
Sources/iOS/MaterialCollectionReusableView.swift
View file @
7407d97f
...
@@ -56,9 +56,9 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
...
@@ -56,9 +56,9 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
@IBInspectable
public
var
pulseColor
:
UIColor
=
Color
.
grey
.
base
@IBInspectable
public
var
pulseColor
:
UIColor
=
Color
.
grey
.
base
/// The type of PulseAnimation.
/// The type of PulseAnimation.
public
var
pulseAnimation
:
PulseAnimation
=
.
AtP
ointWithBacking
{
public
var
pulseAnimation
:
PulseAnimation
=
.
p
ointWithBacking
{
didSet
{
didSet
{
visualLayer
.
masksToBounds
=
.
C
enterRadialBeyondBounds
!=
pulseAnimation
visualLayer
.
masksToBounds
=
.
c
enterRadialBeyondBounds
!=
pulseAnimation
}
}
}
}
...
@@ -187,7 +187,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
...
@@ -187,7 +187,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
/// A property that accesses the backing layer's backgroundColor.
/// A property that accesses the backing layer's backgroundColor.
@IBInspectable
public
override
var
backgroundColor
:
UIColor
?
{
@IBInspectable
public
override
var
backgroundColor
:
UIColor
?
{
didSet
{
didSet
{
layer
.
backgroundColor
=
backgroundColor
?
.
CG
Color
layer
.
backgroundColor
=
backgroundColor
?
.
cg
Color
}
}
}
}
...
@@ -250,7 +250,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
...
@@ -250,7 +250,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
/// A property that accesses the backing layer's shadowColor.
/// A property that accesses the backing layer's shadowColor.
@IBInspectable
public
var
shadowColor
:
UIColor
?
{
@IBInspectable
public
var
shadowColor
:
UIColor
?
{
didSet
{
didSet
{
layer
.
shadowColor
=
shadowColor
?
.
CG
Color
layer
.
shadowColor
=
shadowColor
?
.
cg
Color
}
}
}
}
...
@@ -366,7 +366,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
...
@@ -366,7 +366,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
/// A preset property to set the borderWidth.
/// A preset property to set the borderWidth.
public
var
borderWidthPreset
:
MaterialBorder
=
.
None
{
public
var
borderWidthPreset
:
MaterialBorder
=
.
None
{
didSet
{
didSet
{
borderWidth
=
MaterialBorderToValue
(
borderWidthPreset
)
borderWidth
=
MaterialBorderToValue
(
border
:
border
WidthPreset
)
}
}
}
}
...
@@ -383,10 +383,10 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
...
@@ -383,10 +383,10 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
/// A property that accesses the layer.borderColor property.
/// A property that accesses the layer.borderColor property.
@IBInspectable
public
var
borderColor
:
UIColor
?
{
@IBInspectable
public
var
borderColor
:
UIColor
?
{
get
{
get
{
return
nil
==
layer
.
borderColor
?
nil
:
UIColor
(
CG
Color
:
layer
.
borderColor
!
)
return
nil
==
layer
.
borderColor
?
nil
:
UIColor
(
cg
Color
:
layer
.
borderColor
!
)
}
}
set
(
value
)
{
set
(
value
)
{
layer
.
borderColor
=
value
?
.
CG
Color
layer
.
borderColor
=
value
?
.
cg
Color
}
}
}
}
...
@@ -415,7 +415,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
...
@@ -415,7 +415,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
- Parameter aDecoder: A NSCoder instance.
- Parameter aDecoder: A NSCoder instance.
*/
*/
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
depth
=
.
N
one
depth
Preset
=
.
n
one
cornerRadiusPreset
=
.
None
cornerRadiusPreset
=
.
None
shape
=
.
None
shape
=
.
None
contentsGravityPreset
=
.
ResizeAspectFill
contentsGravityPreset
=
.
ResizeAspectFill
...
@@ -430,7 +430,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
...
@@ -430,7 +430,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
- Parameter frame: A CGRect instance.
- Parameter frame: A CGRect instance.
*/
*/
public
override
init
(
frame
:
CGRect
)
{
public
override
init
(
frame
:
CGRect
)
{
depth
=
.
N
one
depth
Preset
=
.
n
one
cornerRadiusPreset
=
.
None
cornerRadiusPreset
=
.
None
shape
=
.
None
shape
=
.
None
contentsGravityPreset
=
.
ResizeAspectFill
contentsGravityPreset
=
.
ResizeAspectFill
...
@@ -443,8 +443,8 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
...
@@ -443,8 +443,8 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
self
.
init
(
frame
:
CGRect
.
zero
)
self
.
init
(
frame
:
CGRect
.
zero
)
}
}
public
override
func
layoutSublayers
OfLayer
(
layer
:
CALayer
)
{
public
override
func
layoutSublayers
(
of
layer
:
CALayer
)
{
super
.
layoutSublayers
OfLayer
(
layer
)
super
.
layoutSublayers
(
of
:
layer
)
if
self
.
layer
==
layer
{
if
self
.
layer
==
layer
{
layoutShape
()
layoutShape
()
layoutVisualLayer
()
layoutVisualLayer
()
...
@@ -498,7 +498,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
...
@@ -498,7 +498,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
if
let
v
:
AnyObject
=
b
.
toValue
{
if
let
v
:
AnyObject
=
b
.
toValue
{
if
let
k
:
String
=
b
.
keyPath
{
if
let
k
:
String
=
b
.
keyPath
{
layer
.
setValue
(
v
,
forKeyPath
:
k
)
layer
.
setValue
(
v
,
forKeyPath
:
k
)
layer
.
removeAnimation
ForKey
(
k
)
layer
.
removeAnimation
(
forKey
:
k
)
}
}
}
}
}
}
...
@@ -531,9 +531,9 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
...
@@ -531,9 +531,9 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
- Parameter touches: A set of UITouch objects.
- Parameter touches: A set of UITouch objects.
- Parameter event: A UIEvent object.
- Parameter event: A UIEvent object.
*/
*/
public
override
func
touchesBegan
(
touches
:
Set
<
UITouch
>
,
with
Event
event
:
UIEvent
?)
{
public
override
func
touchesBegan
(
touches
:
Set
<
UITouch
>
,
with
event
:
UIEvent
?)
{
super
.
touchesBegan
(
touches
,
with
Event
:
event
)
super
.
touchesBegan
(
touches
,
with
:
event
)
MaterialAnimation
.
pulseExpandAnimation
(
layer
,
visualLayer
:
visualLayer
,
pulseColor
:
pulseColor
,
pulseOpacity
:
pulseOpacity
,
point
:
layer
.
convertPoint
(
touches
.
first
!.
locationInView
(
self
),
fromLayer
:
layer
),
width
:
width
,
height
:
height
,
pulseLayers
:
&
pulseLayers
,
pulseAnimation
:
pulseAnimation
)
MaterialAnimation
.
pulseExpandAnimation
(
layer
:
layer
,
visualLayer
:
visualLayer
,
pulseColor
:
pulseColor
,
pulseOpacity
:
pulseOpacity
,
point
:
layer
.
convert
(
touches
.
first
!.
location
(
in
:
self
),
from
:
layer
),
width
:
width
,
height
:
height
,
pulseLayers
:
&
pulseLayers
,
pulseAnimation
:
pulseAnimation
)
}
}
/**
/**
...
@@ -542,9 +542,9 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
...
@@ -542,9 +542,9 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
- Parameter touches: A set of UITouch objects.
- Parameter touches: A set of UITouch objects.
- Parameter event: A UIEvent object.
- Parameter event: A UIEvent object.
*/
*/
public
override
func
touchesEnded
(
touches
:
Set
<
UITouch
>
,
with
Event
event
:
UIEvent
?)
{
public
override
func
touchesEnded
(
touches
:
Set
<
UITouch
>
,
with
event
:
UIEvent
?)
{
super
.
touchesEnded
(
touches
,
with
Event
:
event
)
super
.
touchesEnded
(
touches
,
with
:
event
)
MaterialAnimation
.
pulseContractAnimation
(
layer
,
visualLayer
:
visualLayer
,
pulseColor
:
pulseColor
,
pulseLayers
:
&
pulseLayers
,
pulseAnimation
:
pulseAnimation
)
MaterialAnimation
.
pulseContractAnimation
(
layer
:
layer
,
visualLayer
:
visualLayer
,
pulseColor
:
pulseColor
,
pulseLayers
:
&
pulseLayers
,
pulseAnimation
:
pulseAnimation
)
}
}
/**
/**
...
@@ -553,9 +553,9 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
...
@@ -553,9 +553,9 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
- Parameter touches: A set of UITouch objects.
- Parameter touches: A set of UITouch objects.
- Parameter event: A UIEvent object.
- Parameter event: A UIEvent object.
*/
*/
public
override
func
touchesCancelled
(
touches
:
Set
<
UITouch
>
?,
withEvent
event
:
UIEvent
?)
{
public
override
func
touchesCancelled
(
touches
:
Set
<
UITouch
>
,
with
event
:
UIEvent
?)
{
super
.
touchesCancelled
(
touches
,
with
Event
:
event
)
super
.
touchesCancelled
(
touches
,
with
:
event
)
MaterialAnimation
.
pulseContractAnimation
(
layer
,
visualLayer
:
visualLayer
,
pulseColor
:
pulseColor
,
pulseLayers
:
&
pulseLayers
,
pulseAnimation
:
pulseAnimation
)
MaterialAnimation
.
pulseContractAnimation
(
layer
:
layer
,
visualLayer
:
visualLayer
,
pulseColor
:
pulseColor
,
pulseLayers
:
&
pulseLayers
,
pulseAnimation
:
pulseAnimation
)
}
}
/**
/**
...
@@ -567,7 +567,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
...
@@ -567,7 +567,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
*/
*/
public
func
prepareView
()
{
public
func
prepareView
()
{
contentScaleFactor
=
Device
.
scale
contentScaleFactor
=
Device
.
scale
pulseAnimation
=
.
N
one
pulseAnimation
=
.
n
one
prepareVisualLayer
()
prepareVisualLayer
()
}
}
...
@@ -597,12 +597,12 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
...
@@ -597,12 +597,12 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
/// Sets the shadow path.
/// Sets the shadow path.
internal
func
layoutShadowPath
()
{
internal
func
layoutShadowPath
()
{
if
shadowPathAutoSizeEnabled
{
if
shadowPathAutoSizeEnabled
{
if
.
None
==
depth
{
if
.
none
==
depthPreset
{
shadowPath
=
nil
shadowPath
=
nil
}
else
if
nil
==
shadowPath
{
}
else
if
nil
==
shadowPath
{
shadowPath
=
UIBezierPath
(
roundedRect
:
bounds
,
cornerRadius
:
cornerRadius
)
.
CG
Path
shadowPath
=
UIBezierPath
(
roundedRect
:
bounds
,
cornerRadius
:
cornerRadius
)
.
cg
Path
}
else
{
}
else
{
animate
(
MaterialAnimation
.
shadowPath
(
UIBezierPath
(
roundedRect
:
bounds
,
cornerRadius
:
cornerRadius
)
.
CG
Path
,
duration
:
0
))
animate
(
animation
:
MaterialAnimation
.
shadowPath
(
path
:
UIBezierPath
(
roundedRect
:
bounds
,
cornerRadius
:
cornerRadius
)
.
cg
Path
,
duration
:
0
))
}
}
}
}
}
}
...
...
Sources/iOS/MaterialCollectionViewCell.swift
View file @
7407d97f
...
@@ -56,9 +56,9 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
...
@@ -56,9 +56,9 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
@IBInspectable
public
var
pulseColor
:
UIColor
=
Color
.
grey
.
base
@IBInspectable
public
var
pulseColor
:
UIColor
=
Color
.
grey
.
base
/// The type of PulseAnimation.
/// The type of PulseAnimation.
public
var
pulseAnimation
:
PulseAnimation
=
.
AtP
ointWithBacking
{
public
var
pulseAnimation
:
PulseAnimation
=
.
p
ointWithBacking
{
didSet
{
didSet
{
visualLayer
.
masksToBounds
=
.
C
enterRadialBeyondBounds
!=
pulseAnimation
visualLayer
.
masksToBounds
=
.
c
enterRadialBeyondBounds
!=
pulseAnimation
}
}
}
}
...
@@ -187,7 +187,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
...
@@ -187,7 +187,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
/// A property that accesses the backing layer's backgroundColor.
/// A property that accesses the backing layer's backgroundColor.
@IBInspectable
public
override
var
backgroundColor
:
UIColor
?
{
@IBInspectable
public
override
var
backgroundColor
:
UIColor
?
{
didSet
{
didSet
{
layer
.
backgroundColor
=
backgroundColor
?
.
CG
Color
layer
.
backgroundColor
=
backgroundColor
?
.
cg
Color
}
}
}
}
...
@@ -250,7 +250,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
...
@@ -250,7 +250,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
/// A property that accesses the backing layer's shadowColor.
/// A property that accesses the backing layer's shadowColor.
@IBInspectable
public
var
shadowColor
:
UIColor
?
{
@IBInspectable
public
var
shadowColor
:
UIColor
?
{
didSet
{
didSet
{
layer
.
shadowColor
=
shadowColor
?
.
CG
Color
layer
.
shadowColor
=
shadowColor
?
.
cg
Color
}
}
}
}
...
@@ -383,10 +383,10 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
...
@@ -383,10 +383,10 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
/// A property that accesses the layer.borderColor property.
/// A property that accesses the layer.borderColor property.
@IBInspectable
public
var
borderColor
:
UIColor
?
{
@IBInspectable
public
var
borderColor
:
UIColor
?
{
get
{
get
{
return
nil
==
layer
.
borderColor
?
nil
:
UIColor
(
CG
Color
:
layer
.
borderColor
!
)
return
nil
==
layer
.
borderColor
?
nil
:
UIColor
(
cg
Color
:
layer
.
borderColor
!
)
}
}
set
(
value
)
{
set
(
value
)
{
layer
.
borderColor
=
value
?
.
CG
Color
layer
.
borderColor
=
value
?
.
cg
Color
}
}
}
}
...
...
Sources/iOS/MaterialTableViewCell.swift
View file @
7407d97f
...
@@ -55,9 +55,9 @@ public class MaterialTableViewCell : UITableViewCell {
...
@@ -55,9 +55,9 @@ public class MaterialTableViewCell : UITableViewCell {
@IBInspectable
public
var
pulseColor
:
UIColor
=
Color
.
grey
.
base
@IBInspectable
public
var
pulseColor
:
UIColor
=
Color
.
grey
.
base
/// The type of PulseAnimation.
/// The type of PulseAnimation.
public
var
pulseAnimation
:
PulseAnimation
=
.
AtP
ointWithBacking
{
public
var
pulseAnimation
:
PulseAnimation
=
.
p
ointWithBacking
{
didSet
{
didSet
{
visualLayer
.
masksToBounds
=
.
C
enterRadialBeyondBounds
!=
pulseAnimation
visualLayer
.
masksToBounds
=
.
c
enterRadialBeyondBounds
!=
pulseAnimation
}
}
}
}
...
@@ -79,7 +79,7 @@ public class MaterialTableViewCell : UITableViewCell {
...
@@ -79,7 +79,7 @@ public class MaterialTableViewCell : UITableViewCell {
/// A property that accesses the backing layer's backgroundColor.
/// A property that accesses the backing layer's backgroundColor.
@IBInspectable
public
override
var
backgroundColor
:
UIColor
?
{
@IBInspectable
public
override
var
backgroundColor
:
UIColor
?
{
didSet
{
didSet
{
layer
.
backgroundColor
=
backgroundColor
?
.
CG
Color
layer
.
backgroundColor
=
backgroundColor
?
.
cg
Color
}
}
}
}
...
@@ -136,7 +136,7 @@ public class MaterialTableViewCell : UITableViewCell {
...
@@ -136,7 +136,7 @@ public class MaterialTableViewCell : UITableViewCell {
/// A property that accesses the backing layer's shadowColor.
/// A property that accesses the backing layer's shadowColor.
@IBInspectable
public
var
shadowColor
:
UIColor
?
{
@IBInspectable
public
var
shadowColor
:
UIColor
?
{
didSet
{
didSet
{
layer
.
shadowColor
=
shadowColor
?
.
CG
Color
layer
.
shadowColor
=
shadowColor
?
.
cg
Color
}
}
}
}
...
@@ -189,20 +189,25 @@ public class MaterialTableViewCell : UITableViewCell {
...
@@ -189,20 +189,25 @@ public class MaterialTableViewCell : UITableViewCell {
}
}
}
}
/**
/// A preset value for Depth.
A property that sets the shadowOffset, shadowOpacity, and shadowRadius
public
var
depthPreset
:
DepthPreset
=
.
none
{
for the backing layer. This is the preferred method of setting depth
didSet
{
in order to maintain consitency across UI objects.
depth
=
DepthPresetToValue
(
preset
:
depthPreset
)
*/
}
public
var
depthPreset
=
.
none
{
}
didSet
{
let
value
:
Depth
=
DepthPresetToValue
(
preset
)
/**
shadowOffset
=
value
.
offset
A property that sets the shadowOffset, shadowOpacity, and shadowRadius
shadowOpacity
=
value
.
opacity
for the backing layer.
shadowRadius
=
value
.
radius
*/
layoutShadowPath
()
public
var
depth
=
Depth
.
zero
{
}
didSet
{
}
shadowOffset
=
depth
.
offset
.
asSize
shadowOpacity
=
depth
.
opacity
shadowRadius
=
depth
.
radius
layoutShadowPath
()
}
}
/**
/**
A property that sets the cornerRadius of the backing layer. If the shape
A property that sets the cornerRadius of the backing layer. If the shape
...
@@ -212,7 +217,7 @@ public class MaterialTableViewCell : UITableViewCell {
...
@@ -212,7 +217,7 @@ public class MaterialTableViewCell : UITableViewCell {
public
var
cornerRadiusPreset
:
MaterialRadius
=
.
None
{
public
var
cornerRadiusPreset
:
MaterialRadius
=
.
None
{
didSet
{
didSet
{
if
let
v
:
MaterialRadius
=
cornerRadiusPreset
{
if
let
v
:
MaterialRadius
=
cornerRadiusPreset
{
cornerRadius
=
MaterialRadiusToValue
(
v
)
cornerRadius
=
MaterialRadiusToValue
(
radius
:
v
)
}
}
}
}
}
}
...
@@ -231,7 +236,7 @@ public class MaterialTableViewCell : UITableViewCell {
...
@@ -231,7 +236,7 @@ public class MaterialTableViewCell : UITableViewCell {
/// A preset property to set the borderWidth.
/// A preset property to set the borderWidth.
public
var
borderWidthPreset
:
MaterialBorder
=
.
None
{
public
var
borderWidthPreset
:
MaterialBorder
=
.
None
{
didSet
{
didSet
{
borderWidth
=
MaterialBorderToValue
(
borderWidthPreset
)
borderWidth
=
MaterialBorderToValue
(
border
:
border
WidthPreset
)
}
}
}
}
...
@@ -248,10 +253,10 @@ public class MaterialTableViewCell : UITableViewCell {
...
@@ -248,10 +253,10 @@ public class MaterialTableViewCell : UITableViewCell {
/// A property that accesses the layer.borderColor property.
/// A property that accesses the layer.borderColor property.
@IBInspectable
public
var
borderColor
:
UIColor
?
{
@IBInspectable
public
var
borderColor
:
UIColor
?
{
get
{
get
{
return
nil
==
layer
.
borderColor
?
nil
:
UIColor
(
CG
Color
:
layer
.
borderColor
!
)
return
nil
==
layer
.
borderColor
?
nil
:
UIColor
(
cg
Color
:
layer
.
borderColor
!
)
}
}
set
(
value
)
{
set
(
value
)
{
layer
.
borderColor
=
value
?
.
CG
Color
layer
.
borderColor
=
value
?
.
cg
Color
}
}
}
}
...
...
Sources/iOS/MaterialTextLayer.swift
View file @
7407d97f
...
@@ -66,7 +66,7 @@ public class MaterialTextLayer : CATextLayer {
...
@@ -66,7 +66,7 @@ public class MaterialTextLayer : CATextLayer {
*/
*/
@IBInspectable
public
var
textColor
:
UIColor
?
{
@IBInspectable
public
var
textColor
:
UIColor
?
{
didSet
{
didSet
{
foregroundColor
=
textColor
?
.
CG
Color
foregroundColor
=
textColor
?
.
cg
Color
}
}
}
}
...
...
Sources/iOS/NavigationBar.swift
View file @
7407d97f
...
@@ -187,7 +187,7 @@ public class NavigationBar : UINavigationBar {
...
@@ -187,7 +187,7 @@ public class NavigationBar : UINavigationBar {
/// A property that accesses the backing layer's shadowColor.
/// A property that accesses the backing layer's shadowColor.
@IBInspectable
public
var
shadowColor
:
UIColor
?
{
@IBInspectable
public
var
shadowColor
:
UIColor
?
{
didSet
{
didSet
{
layer
.
shadowColor
=
shadowColor
?
.
CG
Color
layer
.
shadowColor
=
shadowColor
?
.
cg
Color
}
}
}
}
...
@@ -255,10 +255,10 @@ public class NavigationBar : UINavigationBar {
...
@@ -255,10 +255,10 @@ public class NavigationBar : UINavigationBar {
/// A property that accesses the layer.borderColor property.
/// A property that accesses the layer.borderColor property.
@IBInspectable
public
var
borderColor
:
UIColor
?
{
@IBInspectable
public
var
borderColor
:
UIColor
?
{
get
{
get
{
return
nil
==
layer
.
borderColor
?
nil
:
UIColor
(
CG
Color
:
layer
.
borderColor
!
)
return
nil
==
layer
.
borderColor
?
nil
:
UIColor
(
cg
Color
:
layer
.
borderColor
!
)
}
}
set
(
value
)
{
set
(
value
)
{
layer
.
borderColor
=
value
?
.
CG
Color
layer
.
borderColor
=
value
?
.
cg
Color
}
}
}
}
...
...
Sources/iOS/PulseView.swift
View file @
7407d97f
...
@@ -41,9 +41,9 @@ public class PulseView: View {
...
@@ -41,9 +41,9 @@ public class PulseView: View {
@IBInspectable
public
var
pulseColor
:
UIColor
=
Color
.
grey
.
base
@IBInspectable
public
var
pulseColor
:
UIColor
=
Color
.
grey
.
base
/// The type of PulseAnimation.
/// The type of PulseAnimation.
public
var
pulseAnimation
:
PulseAnimation
=
.
AtP
ointWithBacking
{
public
var
pulseAnimation
:
PulseAnimation
=
.
p
ointWithBacking
{
didSet
{
didSet
{
visualLayer
.
masksToBounds
=
.
C
enterRadialBeyondBounds
!=
pulseAnimation
visualLayer
.
masksToBounds
=
.
c
enterRadialBeyondBounds
!=
pulseAnimation
}
}
}
}
...
...
Sources/iOS/TextField.swift
View file @
7407d97f
...
@@ -53,7 +53,7 @@ public class TextField : UITextField {
...
@@ -53,7 +53,7 @@ public class TextField : UITextField {
/// A property that accesses the backing layer's backgroundColor.
/// A property that accesses the backing layer's backgroundColor.
@IBInspectable
public
override
var
backgroundColor
:
UIColor
?
{
@IBInspectable
public
override
var
backgroundColor
:
UIColor
?
{
didSet
{
didSet
{
layer
.
backgroundColor
=
backgroundColor
?
.
CG
Color
layer
.
backgroundColor
=
backgroundColor
?
.
cg
Color
}
}
}
}
...
@@ -130,7 +130,7 @@ public class TextField : UITextField {
...
@@ -130,7 +130,7 @@ public class TextField : UITextField {
@IBInspectable
public
var
dividerColor
:
UIColor
=
Color
.
darkText
.
dividers
{
@IBInspectable
public
var
dividerColor
:
UIColor
=
Color
.
darkText
.
dividers
{
didSet
{
didSet
{
if
!
editing
{
if
!
editing
{
divider
.
backgroundColor
=
dividerColor
.
CG
Color
divider
.
backgroundColor
=
dividerColor
.
cg
Color
}
}
}
}
}
}
...
@@ -140,7 +140,7 @@ public class TextField : UITextField {
...
@@ -140,7 +140,7 @@ public class TextField : UITextField {
didSet
{
didSet
{
if
let
v
:
UIColor
=
dividerActiveColor
{
if
let
v
:
UIColor
=
dividerActiveColor
{
if
editing
{
if
editing
{
divider
.
backgroundColor
=
v
.
CG
Color
divider
.
backgroundColor
=
v
.
cg
Color
}
}
}
}
}
}
...
@@ -552,13 +552,13 @@ public class TextField : UITextField {
...
@@ -552,13 +552,13 @@ public class TextField : UITextField {
/// The animation for the divider when editing begins.
/// The animation for the divider when editing begins.
public
func
dividerEditingDidBeginAnimation
()
{
public
func
dividerEditingDidBeginAnimation
()
{
divider
.
frame
.
size
.
height
=
dividerActiveHeight
divider
.
frame
.
size
.
height
=
dividerActiveHeight
divider
.
backgroundColor
=
nil
==
dividerActiveColor
?
placeholderActiveColor
.
CGColor
:
dividerActiveColor
!.
CG
Color
divider
.
backgroundColor
=
nil
==
dividerActiveColor
?
placeholderActiveColor
.
cgColor
:
dividerActiveColor
!.
cg
Color
}
}
/// The animation for the divider when editing ends.
/// The animation for the divider when editing ends.
public
func
dividerEditingDidEndAnimation
()
{
public
func
dividerEditingDidEndAnimation
()
{
divider
.
frame
.
size
.
height
=
dividerHeight
divider
.
frame
.
size
.
height
=
dividerHeight
divider
.
backgroundColor
=
dividerColor
.
CG
Color
divider
.
backgroundColor
=
dividerColor
.
cg
Color
}
}
/// The animation for the placeholder when editing begins.
/// The animation for the placeholder when editing begins.
...
...
Sources/iOS/TextView.swift
View file @
7407d97f
...
@@ -52,7 +52,7 @@ public class TextView: UITextView {
...
@@ -52,7 +52,7 @@ public class TextView: UITextView {
/// A property that accesses the backing layer's backgroundColor.
/// A property that accesses the backing layer's backgroundColor.
@IBInspectable
public
override
var
backgroundColor
:
UIColor
?
{
@IBInspectable
public
override
var
backgroundColor
:
UIColor
?
{
didSet
{
didSet
{
layer
.
backgroundColor
=
backgroundColor
?
.
CG
Color
layer
.
backgroundColor
=
backgroundColor
?
.
cg
Color
}
}
}
}
...
@@ -99,7 +99,7 @@ public class TextView: UITextView {
...
@@ -99,7 +99,7 @@ public class TextView: UITextView {
/// A property that accesses the backing layer's shadowColor.
/// A property that accesses the backing layer's shadowColor.
@IBInspectable
public
var
shadowColor
:
UIColor
?
{
@IBInspectable
public
var
shadowColor
:
UIColor
?
{
didSet
{
didSet
{
layer
.
shadowColor
=
shadowColor
?
.
CG
Color
layer
.
shadowColor
=
shadowColor
?
.
cg
Color
}
}
}
}
...
@@ -207,10 +207,10 @@ public class TextView: UITextView {
...
@@ -207,10 +207,10 @@ public class TextView: UITextView {
/// A property that accesses the layer.borderColor property.
/// A property that accesses the layer.borderColor property.
@IBInspectable
public
var
borderColor
:
UIColor
?
{
@IBInspectable
public
var
borderColor
:
UIColor
?
{
get
{
get
{
return
nil
==
layer
.
borderColor
?
nil
:
UIColor
(
CG
Color
:
layer
.
borderColor
!
)
return
nil
==
layer
.
borderColor
?
nil
:
UIColor
(
cg
Color
:
layer
.
borderColor
!
)
}
}
set
(
value
)
{
set
(
value
)
{
layer
.
borderColor
=
value
?
.
CG
Color
layer
.
borderColor
=
value
?
.
cg
Color
}
}
}
}
...
...
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