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
c0940d0f
Commit
c0940d0f
authored
Jul 21, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated frame property access
parent
034d693f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
105 additions
and
558 deletions
+105
-558
Material.xcodeproj/project.pbxproj
+0
-0
Sources/iOS/BottomTabBar.swift
+0
-50
Sources/iOS/Button.swift
+5
-41
Sources/iOS/CollectionReusableView.swift
+0
-74
Sources/iOS/CollectionView.swift
+10
-50
Sources/iOS/CollectionViewCell.swift
+2
-58
Sources/iOS/CollectionViewDataSource.swift
+1
-1
Sources/iOS/CollectionViewDelegate.swift
+1
-1
Sources/iOS/CollectionViewLayout.swift
+2
-2
Sources/iOS/Material+UIView.swift
+81
-1
Sources/iOS/MaterialDataSourceItem.swift
+1
-2
Sources/iOS/MaterialTableViewCell.swift
+0
-50
Sources/iOS/NavigationBar.swift
+0
-50
Sources/iOS/Switch.swift
+1
-41
Sources/iOS/TextField.swift
+1
-41
Sources/iOS/TextView.swift
+0
-40
Sources/iOS/View.swift
+0
-56
No files found.
Material.xcodeproj/project.pbxproj
View file @
c0940d0f
This diff is collapsed.
Click to expand it.
Sources/iOS/BottomTabBar.swift
View file @
c0940d0f
...
...
@@ -49,56 +49,6 @@ public class BottomTabBar: UITabBar {
}
}
/// A property that accesses the layer.frame.origin.x property.
@IBInspectable
public
var
x
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
x
}
set
(
value
)
{
layer
.
frame
.
origin
.
x
=
value
}
}
/// A property that accesses the layer.frame.origin.y property.
@IBInspectable
public
var
y
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
y
}
set
(
value
)
{
layer
.
frame
.
origin
.
y
=
value
}
}
/**
A property that accesses the layer.frame.size.width property.
When setting this property in conjunction with the shape property having a
value that is not .none, the height will be adjusted to maintain the correct
shape.
*/
@IBInspectable
public
var
width
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
width
}
set
(
value
)
{
layer
.
frame
.
size
.
width
=
value
}
}
/**
A property that accesses the layer.frame.size.height property.
When setting this property in conjunction with the shape property having a
value that is not .none, the width will be adjusted to maintain the correct
shape.
*/
@IBInspectable
public
var
height
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
height
}
set
(
value
)
{
layer
.
frame
.
size
.
height
=
value
}
}
/**
An initializer that initializes the object with a CGRect object.
If AutoLayout is used, it is better to initilize the instance
...
...
Sources/iOS/Button.swift
View file @
c0940d0f
...
...
@@ -68,34 +68,15 @@ public class Button: UIButton {
layer
.
backgroundColor
=
backgroundColor
?
.
cgColor
}
}
/// A property that accesses the layer.frame.origin.x property.
@IBInspectable
public
var
x
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
x
}
set
(
value
)
{
layer
.
frame
.
origin
.
x
=
value
}
}
/// A property that accesses the layer.frame.origin.y property.
@IBInspectable
public
var
y
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
y
}
set
(
value
)
{
layer
.
frame
.
origin
.
y
=
value
}
}
/**
A property that accesses the layer.frame.size.width property.
When setting this property in conjunction with the shape property having a
value that is not .none, the height will be adjusted to maintain the correct
shape.
*/
@IBInspectable
public
var
width
:
CGFloat
{
@IBInspectable
public
override
var
width
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
width
}
...
...
@@ -113,7 +94,8 @@ public class Button: UIButton {
value that is not .none, the width will be adjusted to maintain the correct
shape.
*/
@IBInspectable
public
var
height
:
CGFloat
{
@IBInspectable
public
override
var
height
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
height
}
...
...
@@ -134,24 +116,6 @@ public class Button: UIButton {
}
}
/**
A property that manages the overall shape for the object. If either the
width or height property is set, the other will be automatically adjusted
to maintain the shape of the object.
*/
public
var
shapePreset
:
ShapePreset
=
.
none
{
didSet
{
if
.
none
!=
shapePreset
{
if
width
<
height
{
frame
.
size
.
width
=
height
}
else
{
frame
.
size
.
height
=
width
}
layoutShadowPath
()
}
}
}
/// A preset property for updated contentEdgeInsets.
public
var
contentEdgeInsetsPreset
:
EdgeInsetsPreset
=
.
none
{
didSet
{
...
...
Sources/iOS/
Material
CollectionReusableView.swift
→
Sources/iOS/CollectionReusableView.swift
View file @
c0940d0f
...
...
@@ -176,62 +176,6 @@ public class MaterialCollectionReusableView: UICollectionReusableView {
}
}
/// A property that accesses the layer.frame.origin.x property.
@IBInspectable
public
var
x
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
x
}
set
(
value
)
{
layer
.
frame
.
origin
.
x
=
value
}
}
/// A property that accesses the layer.frame.origin.y property.
@IBInspectable
public
var
y
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
y
}
set
(
value
)
{
layer
.
frame
.
origin
.
y
=
value
}
}
/**
A property that accesses the layer.frame.size.width property.
When setting this property in conjunction with the shape property having a
value that is not .none, the height will be adjusted to maintain the correct
shape.
*/
@IBInspectable
public
var
width
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
width
}
set
(
value
)
{
layer
.
frame
.
size
.
width
=
value
if
.
none
!=
shapePreset
{
layer
.
frame
.
size
.
height
=
value
}
}
}
/**
A property that accesses the layer.frame.size.height property.
When setting this property in conjunction with the shape property having a
value that is not .none, the width will be adjusted to maintain the correct
shape.
*/
@IBInspectable
public
var
height
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
height
}
set
(
value
)
{
layer
.
frame
.
size
.
height
=
value
if
.
none
!=
shapePreset
{
layer
.
frame
.
size
.
width
=
value
}
}
}
/// Enables automatic shadowPath sizing.
@IBInspectable
public
var
shadowPathAutoSizeEnabled
:
Bool
=
true
{
didSet
{
...
...
@@ -242,24 +186,6 @@ public class MaterialCollectionReusableView: UICollectionReusableView {
}
/**
A property that manages the overall shape for the object. If either the
width or height property is set, the other will be automatically adjusted
to maintain the shape of the object.
*/
public
var
shapePreset
:
ShapePreset
=
.
none
{
didSet
{
if
.
none
!=
shapePreset
{
if
width
<
height
{
frame
.
size
.
width
=
height
}
else
{
frame
.
size
.
height
=
width
}
layoutShadowPath
()
}
}
}
/**
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
*/
...
...
Sources/iOS/
Material
CollectionView.swift
→
Sources/iOS/CollectionView.swift
View file @
c0940d0f
...
...
@@ -31,73 +31,33 @@
import
UIKit
@IBDesignable
public
class
MaterialCollectionView
:
UICollectionView
{
/// A property that accesses the layer.frame.origin.x property.
@IBInspectable
public
var
x
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
x
}
set
(
value
)
{
layer
.
frame
.
origin
.
x
=
value
}
}
/// A property that accesses the layer.frame.origin.y property.
@IBInspectable
public
var
y
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
y
}
set
(
value
)
{
layer
.
frame
.
origin
.
y
=
value
}
}
/// A property that accesses the layer.frame.size.width property.
@IBInspectable
public
var
width
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
width
}
set
(
value
)
{
layer
.
frame
.
size
.
width
=
value
}
}
/// A property that accesses the layer.frame.size.height property.
@IBInspectable
public
var
height
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
height
}
set
(
value
)
{
layer
.
frame
.
size
.
height
=
value
}
}
public
class
CollectionView
:
UICollectionView
{
/// A preset wrapper around contentInset.
public
var
contentEdgeInsetsPreset
:
EdgeInsets
{
get
{
return
(
collectionViewLayout
as?
Material
CollectionViewLayout
)
!.
contentInset
return
(
collectionViewLayout
as?
CollectionViewLayout
)
!.
contentInset
}
set
(
value
)
{
(
collectionViewLayout
as?
Material
CollectionViewLayout
)
!.
contentInset
=
value
(
collectionViewLayout
as?
CollectionViewLayout
)
!.
contentInset
=
value
}
}
public
override
var
contentInset
:
UIEdgeInsets
{
get
{
return
(
collectionViewLayout
as?
Material
CollectionViewLayout
)
!.
contentInset
return
(
collectionViewLayout
as?
CollectionViewLayout
)
!.
contentInset
}
set
(
value
)
{
(
collectionViewLayout
as?
Material
CollectionViewLayout
)
!.
contentInset
=
value
(
collectionViewLayout
as?
CollectionViewLayout
)
!.
contentInset
=
value
}
}
/// Scroll direction.
public
var
scrollDirection
:
UICollectionViewScrollDirection
{
get
{
return
(
collectionViewLayout
as?
Material
CollectionViewLayout
)
!.
scrollDirection
return
(
collectionViewLayout
as?
CollectionViewLayout
)
!.
scrollDirection
}
set
(
value
)
{
(
collectionViewLayout
as?
Material
CollectionViewLayout
)
!.
scrollDirection
=
value
(
collectionViewLayout
as?
CollectionViewLayout
)
!.
scrollDirection
=
value
}
}
...
...
@@ -111,10 +71,10 @@ public class MaterialCollectionView: UICollectionView {
/// Spacing between items.
@IBInspectable
public
var
interimSpace
:
InterimSpace
{
get
{
return
(
collectionViewLayout
as?
Material
CollectionViewLayout
)
!.
interimSpace
return
(
collectionViewLayout
as?
CollectionViewLayout
)
!.
interimSpace
}
set
(
value
)
{
(
collectionViewLayout
as?
Material
CollectionViewLayout
)
!.
interimSpace
=
value
(
collectionViewLayout
as?
CollectionViewLayout
)
!.
interimSpace
=
value
}
}
...
...
@@ -142,7 +102,7 @@ public class MaterialCollectionView: UICollectionView {
- Parameter frame: A CGRect defining the view's frame.
*/
public
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
,
collectionViewLayout
:
Material
CollectionViewLayout
())
super
.
init
(
frame
:
frame
,
collectionViewLayout
:
CollectionViewLayout
())
prepareView
()
}
...
...
Sources/iOS/
Material
CollectionViewCell.swift
→
Sources/iOS/CollectionViewCell.swift
View file @
c0940d0f
...
...
@@ -31,8 +31,8 @@
import
UIKit
@IBDesignable
@objc(
Material
CollectionViewCell)
public
class
Material
CollectionViewCell
:
UICollectionViewCell
{
@objc(CollectionViewCell)
public
class
CollectionViewCell
:
UICollectionViewCell
{
/**
A CAShapeLayer used to manage elements that would be affected by
the clipToBounds property of the backing layer. For example, this
...
...
@@ -176,62 +176,6 @@ public class MaterialCollectionViewCell: UICollectionViewCell {
}
}
/// A property that accesses the layer.frame.origin.x property.
@IBInspectable
public
var
x
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
x
}
set
(
value
)
{
layer
.
frame
.
origin
.
x
=
value
}
}
/// A property that accesses the layer.frame.origin.y property.
@IBInspectable
public
var
y
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
y
}
set
(
value
)
{
layer
.
frame
.
origin
.
y
=
value
}
}
/**
A property that accesses the layer.frame.size.width property.
When setting this property in conjunction with the shape property having a
value that is not .none, the height will be adjusted to maintain the correct
shape.
*/
@IBInspectable
public
var
width
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
width
}
set
(
value
)
{
layer
.
frame
.
size
.
width
=
value
if
.
none
!=
shape
{
layer
.
frame
.
size
.
height
=
value
}
}
}
/**
A property that accesses the layer.frame.size.height property.
When setting this property in conjunction with the shape property having a
value that is not .none, the width will be adjusted to maintain the correct
shape.
*/
@IBInspectable
public
var
height
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
height
}
set
(
value
)
{
layer
.
frame
.
size
.
height
=
value
if
.
none
!=
shape
{
layer
.
frame
.
size
.
width
=
value
}
}
}
/// Enables automatic shadowPath sizing.
@IBInspectable
public
var
shadowPathAutoSizeEnabled
:
Bool
=
true
{
didSet
{
...
...
Sources/iOS/
Material
CollectionViewDataSource.swift
→
Sources/iOS/CollectionViewDataSource.swift
View file @
c0940d0f
...
...
@@ -30,7 +30,7 @@
import
UIKit
public
protocol
Material
CollectionViewDataSource
:
UICollectionViewDataSource
{
public
protocol
CollectionViewDataSource
:
UICollectionViewDataSource
{
/**
Retrieves the items for the collectionView.
- Returns: An Array of Arrays of MaterialDataSourceItem objects.
...
...
Sources/iOS/
Material
CollectionViewDelegate.swift
→
Sources/iOS/CollectionViewDelegate.swift
View file @
c0940d0f
...
...
@@ -30,6 +30,6 @@
import
UIKit
public
protocol
Material
CollectionViewDelegate
:
MaterialDelegate
,
UICollectionViewDelegate
{
public
protocol
CollectionViewDelegate
:
MaterialDelegate
,
UICollectionViewDelegate
{
}
Sources/iOS/
Material
CollectionViewLayout.swift
→
Sources/iOS/CollectionViewLayout.swift
View file @
c0940d0f
...
...
@@ -30,7 +30,7 @@
import
UIKit
public
class
Material
CollectionViewLayout
:
UICollectionViewLayout
{
public
class
CollectionViewLayout
:
UICollectionViewLayout
{
/// Used to calculate the dimensions of the cells.
internal
var
offset
:
CGPoint
=
CGPoint
.
zero
...
...
@@ -118,7 +118,7 @@ public class MaterialCollectionViewLayout: UICollectionViewLayout {
}
public
override
func
prepare
()
{
if
let
dataSource
:
MaterialCollectionViewDataSource
=
collectionView
?
.
dataSource
as?
Material
CollectionViewDataSource
{
if
let
dataSource
:
CollectionViewDataSource
=
collectionView
?
.
dataSource
as?
CollectionViewDataSource
{
prepareLayoutForItems
(
dataSourceItems
:
dataSource
.
items
())
}
}
...
...
Sources/iOS/Material.swift
→
Sources/iOS/Material
+UIView
.swift
View file @
c0940d0f
...
...
@@ -68,6 +68,23 @@ public class Material {
}
}
/// A preset property to set the shape.
public
var
shapePreset
:
ShapePreset
=
.
none
{
didSet
{
guard
let
v
=
view
else
{
return
}
if
.
none
!=
shapePreset
{
if
v
.
width
<
v
.
height
{
v
.
frame
.
size
.
width
=
v
.
height
}
else
{
v
.
frame
.
size
.
height
=
v
.
width
}
}
}
}
/// A preset value for Depth.
public
var
depthPreset
:
DepthPreset
{
get
{
...
...
@@ -109,6 +126,70 @@ public extension UIView {
}
}
/// A property that accesses the layer.frame.origin.x property.
@IBInspectable
public
var
x
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
x
}
set
(
value
)
{
layer
.
frame
.
origin
.
x
=
value
}
}
/// A property that accesses the layer.frame.origin.y property.
@IBInspectable
public
var
y
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
y
}
set
(
value
)
{
layer
.
frame
.
origin
.
y
=
value
}
}
/// A property that accesses the layer.frame.size.width property.
@IBInspectable
public
var
width
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
width
}
set
(
value
)
{
layer
.
frame
.
size
.
width
=
value
if
.
none
!=
shapePreset
{
layer
.
frame
.
size
.
height
=
value
}
}
}
/// A property that accesses the layer.frame.size.height property.
@IBInspectable
public
var
height
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
height
}
set
(
value
)
{
layer
.
frame
.
size
.
height
=
value
if
.
none
!=
shapePreset
{
layer
.
frame
.
size
.
width
=
value
}
}
}
/**
A property that manages the overall shape for the object. If either the
width or height property is set, the other will be automatically adjusted
to maintain the shape of the object.
*/
public
var
shapePreset
:
ShapePreset
{
get
{
return
material
.
shapePreset
}
set
(
value
)
{
material
.
shapePreset
=
value
}
}
/// A property that accesses the backing layer's shadowColor.
@IBInspectable
public
var
shadowColor
:
UIColor
?
{
...
...
@@ -252,7 +333,6 @@ public extension UIView {
- Parameter animation: A CAAnimation instance.
*/
public
func
animate
(
animation
:
CAAnimation
)
{
// animation.delegate = self
if
let
a
=
animation
as?
CABasicAnimation
{
a
.
fromValue
=
(
nil
==
layer
.
presentation
()
?
layer
:
layer
.
presentation
()
!
)
.
value
(
forKeyPath
:
a
.
keyPath
!
)
}
...
...
Sources/iOS/MaterialDataSourceItem.swift
View file @
c0940d0f
...
...
@@ -52,4 +52,4 @@ public struct MaterialDataSourceItem {
self
.
width
=
width
self
.
height
=
height
}
}
\ No newline at end of file
}
Sources/iOS/MaterialTableViewCell.swift
View file @
c0940d0f
...
...
@@ -68,56 +68,6 @@ public class MaterialTableViewCell: UITableViewCell {
}
}
/// A property that accesses the layer.frame.origin.x property.
@IBInspectable
public
var
x
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
x
}
set
(
value
)
{
layer
.
frame
.
origin
.
x
=
value
}
}
/// A property that accesses the layer.frame.origin.y property.
@IBInspectable
public
var
y
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
y
}
set
(
value
)
{
layer
.
frame
.
origin
.
y
=
value
}
}
/**
A property that accesses the layer.frame.size.width property.
When setting this property in conjunction with the shape property having a
value that is not .none, the height will be adjusted to maintain the correct
shape.
*/
@IBInspectable
public
var
width
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
width
}
set
(
value
)
{
layer
.
frame
.
size
.
width
=
value
}
}
/**
A property that accesses the layer.frame.size.height property.
When setting this property in conjunction with the shape property having a
value that is not .none, the width will be adjusted to maintain the correct
shape.
*/
@IBInspectable
public
var
height
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
height
}
set
(
value
)
{
layer
.
frame
.
size
.
height
=
value
}
}
/// Enables automatic shadowPath sizing.
@IBInspectable
public
var
shadowPathAutoSizeEnabled
:
Bool
=
true
{
didSet
{
...
...
Sources/iOS/NavigationBar.swift
View file @
c0940d0f
...
...
@@ -119,56 +119,6 @@ public class NavigationBar : UINavigationBar {
}
}
/// A property that accesses the layer.frame.origin.x property.
@IBInspectable
public
var
x
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
x
}
set
(
value
)
{
layer
.
frame
.
origin
.
x
=
value
}
}
/// A property that accesses the layer.frame.origin.y property.
@IBInspectable
public
var
y
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
y
}
set
(
value
)
{
layer
.
frame
.
origin
.
y
=
value
}
}
/**
A property that accesses the layer.frame.size.width property.
When setting this property in conjunction with the shape property having a
value that is not .none, the height will be adjusted to maintain the correct
shape.
*/
@IBInspectable
public
var
width
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
width
}
set
(
value
)
{
layer
.
frame
.
size
.
width
=
value
}
}
/**
A property that accesses the layer.frame.size.height property.
When setting this property in conjunction with the shape property having a
value that is not .none, the width will be adjusted to maintain the correct
shape.
*/
@IBInspectable
public
var
height
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
height
}
set
(
value
)
{
layer
.
frame
.
size
.
height
=
value
}
}
/**
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
...
...
Sources/iOS/Switch.swift
View file @
c0940d0f
...
...
@@ -75,47 +75,7 @@ public class Switch: UIControl {
/// The bounce offset when animating.
private
var
bounceOffset
:
CGFloat
=
3
/// A property that accesses the layer.frame.origin.x property.
@IBInspectable
public
var
x
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
x
}
set
(
value
)
{
layer
.
frame
.
origin
.
x
=
value
}
}
/// A property that accesses the layer.frame.origin.y property.
@IBInspectable
public
var
y
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
y
}
set
(
value
)
{
layer
.
frame
.
origin
.
y
=
value
}
}
/// A property that accesses the layer.frame.size.width property.
@IBInspectable
public
var
width
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
width
}
set
(
value
)
{
layer
.
frame
.
size
.
width
=
value
}
}
/// A property that accesses the layer.frame.size.height property.
@IBInspectable
public
var
height
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
height
}
set
(
value
)
{
layer
.
frame
.
size
.
height
=
value
}
}
/// An Optional delegation method.
public
weak
var
delegate
:
SwitchDelegate
?
...
...
Sources/iOS/TextField.swift
View file @
c0940d0f
...
...
@@ -44,47 +44,7 @@ public class TextField: UITextField {
}
}
/// A property that accesses the layer.frame.origin.x property.
@IBInspectable
public
var
x
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
x
}
set
(
value
)
{
layer
.
frame
.
origin
.
x
=
value
}
}
/// A property that accesses the layer.frame.origin.y property.
@IBInspectable
public
var
y
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
y
}
set
(
value
)
{
layer
.
frame
.
origin
.
y
=
value
}
}
/// A property that accesses the layer.frame.size.width property.
@IBInspectable
public
var
width
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
width
}
set
(
value
)
{
layer
.
frame
.
size
.
width
=
value
}
}
/// A property that accesses the layer.frame.size.height property.
@IBInspectable
public
var
height
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
height
}
set
(
value
)
{
layer
.
frame
.
size
.
height
=
value
}
}
/// Reference to the divider.
/// Reference to the divider.
public
private(set)
lazy
var
divider
:
CAShapeLayer
=
CAShapeLayer
()
/// Divider height.
...
...
Sources/iOS/TextView.swift
View file @
c0940d0f
...
...
@@ -43,46 +43,6 @@ public class TextView: UITextView {
}
}
/// A property that accesses the layer.frame.origin.x property.
@IBInspectable
public
var
x
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
x
}
set
(
value
)
{
layer
.
frame
.
origin
.
x
=
value
}
}
/// A property that accesses the layer.frame.origin.y property.
@IBInspectable
public
var
y
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
y
}
set
(
value
)
{
layer
.
frame
.
origin
.
y
=
value
}
}
/// A property that accesses the layer.frame.size.width property.
@IBInspectable
public
var
width
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
width
}
set
(
value
)
{
layer
.
frame
.
size
.
width
=
value
}
}
/// A property that accesses the layer.frame.size.height property.
@IBInspectable
public
var
height
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
height
}
set
(
value
)
{
layer
.
frame
.
size
.
height
=
value
}
}
/// Enables automatic shadowPath sizing.
@IBInspectable
public
var
shadowPathAutoSizeEnabled
:
Bool
=
true
{
didSet
{
...
...
Sources/iOS/View.swift
View file @
c0940d0f
...
...
@@ -121,62 +121,6 @@ public class View: UIView {
}
}
/// A property that accesses the layer.frame.origin.x property.
@IBInspectable
public
var
x
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
x
}
set
(
value
)
{
layer
.
frame
.
origin
.
x
=
value
}
}
/// A property that accesses the layer.frame.origin.y property.
@IBInspectable
public
var
y
:
CGFloat
{
get
{
return
layer
.
frame
.
origin
.
y
}
set
(
value
)
{
layer
.
frame
.
origin
.
y
=
value
}
}
/**
A property that accesses the layer.frame.size.width property.
When setting this property in conjunction with the shape property having a
value that is not .none, the height will be adjusted to maintain the correct
shape.
*/
@IBInspectable
public
var
width
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
width
}
set
(
value
)
{
layer
.
frame
.
size
.
width
=
value
if
.
none
!=
shape
{
layer
.
frame
.
size
.
height
=
value
}
}
}
/**
A property that accesses the layer.frame.size.height property.
When setting this property in conjunction with the shape property having a
value that is not .none, the width will be adjusted to maintain the correct
shape.
*/
@IBInspectable
public
var
height
:
CGFloat
{
get
{
return
layer
.
frame
.
size
.
height
}
set
(
value
)
{
layer
.
frame
.
size
.
height
=
value
if
.
none
!=
shape
{
layer
.
frame
.
size
.
width
=
value
}
}
}
/// Enables automatic shadowPath sizing.
@IBInspectable
public
var
shadowPathAutoSizeEnabled
:
Bool
=
true
{
didSet
{
...
...
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