Skip to content

Commit 5f7b7b5

Browse files
Make View, Shape and Polygon open
1 parent 4008595 commit 5f7b7b5

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

Diff for: C4/UI/Polygon.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Foundation
2121
import CoreGraphics
2222

2323
/// Polygon is a concrete subclass of Shape that has a special initialzer that creates a non-uniform shape made up of 3 or more points.
24-
public class Polygon: Shape {
24+
open class Polygon: Shape {
2525

2626
/// Returns the array of points that make up the polygon.
2727
///

Diff for: C4/UI/Shape.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import QuartzCore
2121
import UIKit
2222

2323
/// Shape is a concrete subclass of View that draws a bezier path in its coordinate space.
24-
public class Shape: View {
24+
open class Shape: View {
2525
internal class ShapeView: UIView {
2626
var shapeLayer: ShapeLayer {
2727
return self.layer as! ShapeLayer // swiftlint:disable:this force_cast
@@ -46,7 +46,7 @@ public class Shape: View {
4646
}
4747

4848
/// Shape's contents are drawn on a ShapeLayer.
49-
public var shapeLayer: ShapeLayer {
49+
open var shapeLayer: ShapeLayer {
5050
return self.shapeView.shapeLayer
5151
}
5252

@@ -230,7 +230,7 @@ public class Shape: View {
230230

231231
/// The current rotation value of the view. Animatable.
232232
/// - returns: A Double value representing the cumulative rotation of the view, measured in Radians.
233-
public override var rotation: Double {
233+
open override var rotation: Double {
234234
get {
235235
if let number = shapeLayer.value(forKeyPath: Layer.rotationKey) as? NSNumber {
236236
return number.doubleValue

Diff for: C4/UI/View+KeyValues.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ extension View {
2424
///
2525
/// - parameter value: The value for the key identified by _key_.
2626
/// - parameter key: The name of one of the receiver's properties.
27-
public override func setValue(_ value: Any?, forKey key: String) {
27+
open override func setValue(_ value: Any?, forKey key: String) {
2828
switch (key, value) {
2929
case ("frame", let nsvalue as NSValue):
3030
frame = Rect(nsvalue.cgRectValue)
@@ -54,7 +54,7 @@ extension View {
5454
/// - parameter key: The name of one of the receiver's properties.
5555
///
5656
/// - returns: The value for the data specified by the key.
57-
public override func value(forKey key: String) -> Any? {
57+
open override func value(forKey key: String) -> Any? {
5858
switch key {
5959
case "frame":
6060
return NSValue(cgRect: CGRect(frame))

Diff for: C4/UI/View.swift

+8-8
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ extension NSValue {
2828
}
2929

3030
/// The View class defines a rectangular area on the screen and the interfaces for managing visual content in that area. The View class itself provides basic behavior for filling its rectangular area with a background color. More sophisticated content can be presented by subclassing UIView and implementing the necessary drawing and event-handling code yourself. The C4 framework also includes a set of standard subclasses that range from simple shapes to movies and images that can be used as-is.
31-
public class View: NSObject {
31+
open class View: NSObject {
3232
/// A UIView. Internally, View wraps and provides access to an internal UIView.
33-
public var view: UIView = LayerView()
33+
open var view: UIView = LayerView()
3434

3535
/// The current rotation value of the view. Animatable.
3636
/// - returns: A Double value representing the cumulative rotation of the view, measured in Radians.
37-
public var rotation: Double {
37+
open var rotation: Double {
3838
get {
3939
if let number = animatableLayer.value(forKeyPath: Layer.rotationKey) as? NSNumber {
4040
return number.doubleValue
@@ -47,23 +47,23 @@ public class View: NSObject {
4747
}
4848

4949
/// The view that contains the receiver's animatable layer.
50-
internal var layerView: LayerView {
50+
open var layerView: LayerView {
5151
return self.view as! LayerView // swiftlint:disable:this force_cast
5252
}
5353

54-
internal class LayerView: UIView {
55-
var animatableLayer: Layer {
54+
open class LayerView: UIView {
55+
open var animatableLayer: Layer {
5656
return self.layer as! Layer // swiftlint:disable:this force_cast
5757
}
5858

59-
override class var layerClass: AnyClass {
59+
override open class var layerClass: AnyClass {
6060
return Layer.self
6161
}
6262
}
6363

6464
/// The view's primary layer.
6565
/// - returns: A Layer, whose properties are animatable (e.g. rotation)
66-
public var animatableLayer: Layer {
66+
open var animatableLayer: Layer {
6767
return self.layerView.animatableLayer
6868
}
6969

0 commit comments

Comments
 (0)