Skip to content

Commit f4c4d61

Browse files
author
Baris Sencan
committed
Explicit access control
1 parent 5e0e44c commit f4c4d61

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

ManualLayout/CALayer+FastAccess.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111
public extension CALayer {
1212
private var anchorKey: String { return "ManualLayout_anchor" }
1313

14-
var anchor: CGPoint {
14+
public var anchor: CGPoint {
1515
get {
1616
if let value = objc_getAssociatedObject(self, anchorKey) as? NSValue {
1717
return value.CGPointValue()
@@ -25,7 +25,7 @@ public extension CALayer {
2525

2626
// MARK: - Position
2727

28-
var origin: CGPoint {
28+
public var origin: CGPoint {
2929
get {
3030
return frame.origin
3131
}
@@ -35,7 +35,7 @@ public extension CALayer {
3535
}
3636
}
3737

38-
var x: CGFloat {
38+
public var x: CGFloat {
3939
get {
4040
return frame.origin.x
4141
}
@@ -44,7 +44,7 @@ public extension CALayer {
4444
}
4545
}
4646

47-
var y: CGFloat {
47+
public var y: CGFloat {
4848
get {
4949
return frame.origin.y
5050
}
@@ -53,7 +53,7 @@ public extension CALayer {
5353
}
5454
}
5555

56-
var center: CGPoint {
56+
public var center: CGPoint {
5757
get {
5858
return CGPoint(x: centerX, y: centerY)
5959
}
@@ -63,7 +63,7 @@ public extension CALayer {
6363
}
6464
}
6565

66-
var centerX: CGFloat {
66+
public var centerX: CGFloat {
6767
get {
6868
return frame.origin.x + frame.size.width / 2
6969
}
@@ -72,7 +72,7 @@ public extension CALayer {
7272
}
7373
}
7474

75-
var centerY: CGFloat {
75+
public var centerY: CGFloat {
7676
get {
7777
return frame.origin.y + frame.size.height / 2
7878
}
@@ -83,7 +83,7 @@ public extension CALayer {
8383

8484
// MARK: - Size
8585

86-
var size: CGSize {
86+
public var size: CGSize {
8787
get {
8888
return frame.size
8989
}
@@ -93,7 +93,7 @@ public extension CALayer {
9393
}
9494
}
9595

96-
var width: CGFloat {
96+
public var width: CGFloat {
9797
get {
9898
return frame.size.width
9999
}
@@ -102,7 +102,7 @@ public extension CALayer {
102102
}
103103
}
104104

105-
var height: CGFloat {
105+
public var height: CGFloat {
106106
get {
107107
return frame.size.height
108108
}
@@ -113,7 +113,7 @@ public extension CALayer {
113113

114114
// MARK: - Edges
115115

116-
var top: CGFloat {
116+
public var top: CGFloat {
117117
get {
118118
return frame.origin.y
119119
}
@@ -122,7 +122,7 @@ public extension CALayer {
122122
}
123123
}
124124

125-
var right: CGFloat {
125+
public var right: CGFloat {
126126
get {
127127
return frame.origin.x + frame.size.width
128128
}
@@ -131,7 +131,7 @@ public extension CALayer {
131131
}
132132
}
133133

134-
var bottom: CGFloat {
134+
public var bottom: CGFloat {
135135
get {
136136
return frame.origin.y + frame.size.height
137137
}
@@ -140,7 +140,7 @@ public extension CALayer {
140140
}
141141
}
142142

143-
var left: CGFloat {
143+
public var left: CGFloat {
144144
get {
145145
return frame.origin.x
146146
}

ManualLayout/UIView+FastAccess.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111
// I wish there was an easier way to do this in Swift.
1212
public extension UIView {
1313

14-
var anchor: CGPoint {
14+
public var anchor: CGPoint {
1515
get {
1616
return layer.anchor
1717
}
@@ -20,7 +20,7 @@ public extension UIView {
2020
}
2121
}
2222

23-
var origin: CGPoint {
23+
public var origin: CGPoint {
2424
get {
2525
return layer.origin
2626
}
@@ -29,7 +29,7 @@ public extension UIView {
2929
}
3030
}
3131

32-
var x: CGFloat {
32+
public var x: CGFloat {
3333
get {
3434
return layer.x
3535
}
@@ -38,7 +38,7 @@ public extension UIView {
3838
}
3939
}
4040

41-
var y: CGFloat {
41+
public var y: CGFloat {
4242
get {
4343
return layer.y
4444
}
@@ -47,7 +47,7 @@ public extension UIView {
4747
}
4848
}
4949

50-
var centerX: CGFloat {
50+
public var centerX: CGFloat {
5151
get {
5252
return layer.centerX
5353
}
@@ -56,7 +56,7 @@ public extension UIView {
5656
}
5757
}
5858

59-
var centerY: CGFloat {
59+
public var centerY: CGFloat {
6060
get {
6161
return layer.centerY
6262
}
@@ -65,7 +65,7 @@ public extension UIView {
6565
}
6666
}
6767

68-
var size: CGSize {
68+
public var size: CGSize {
6969
get {
7070
return layer.size
7171
}
@@ -74,7 +74,7 @@ public extension UIView {
7474
}
7575
}
7676

77-
var width: CGFloat {
77+
public var width: CGFloat {
7878
get {
7979
return layer.width
8080
}
@@ -83,7 +83,7 @@ public extension UIView {
8383
}
8484
}
8585

86-
var height: CGFloat {
86+
public var height: CGFloat {
8787
get {
8888
return layer.height
8989
}
@@ -92,7 +92,7 @@ public extension UIView {
9292
}
9393
}
9494

95-
var top: CGFloat {
95+
public var top: CGFloat {
9696
get {
9797
return layer.top
9898
}
@@ -101,7 +101,7 @@ public extension UIView {
101101
}
102102
}
103103

104-
var right: CGFloat {
104+
public var right: CGFloat {
105105
get {
106106
return layer.right
107107
}
@@ -110,7 +110,7 @@ public extension UIView {
110110
}
111111
}
112112

113-
var bottom: CGFloat {
113+
public var bottom: CGFloat {
114114
get {
115115
return layer.bottom
116116
}
@@ -119,7 +119,7 @@ public extension UIView {
119119
}
120120
}
121121

122-
var left: CGFloat {
122+
public var left: CGFloat {
123123
get {
124124
return layer.left
125125
}

0 commit comments

Comments
 (0)