Skip to content

Commit d27e288

Browse files
committed
Updates Image to be Open
1 parent b1decb7 commit d27e288

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Diff for: C4/UI/Image.swift

+13-13
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
import UIKit
2121

2222
/// A Image provides a view-based container for displaying a single image. You can create images from files, from other image objects, or from raw image data you receive.
23-
public class Image: View, NSCopying {
24-
internal class ImageView: UIImageView {
23+
open class Image: View, NSCopying {
24+
open class ImageView: UIImageView {
2525
var imageLayer: ImageLayer {
2626
return self.layer as! ImageLayer // swiftlint:disable:this force_cast
2727
}
2828

29-
override class var layerClass: AnyClass {
29+
override open class var layerClass: AnyClass {
3030
return ImageLayer.self
3131
}
3232
}
3333

3434
/// Shape's contents are drawn on a ShapeLayer.
35-
public var imageLayer: ImageLayer {
35+
open var imageLayer: ImageLayer {
3636
return self.imageView.imageLayer
3737
}
3838

@@ -290,27 +290,27 @@ public class Image: View, NSCopying {
290290

291291
/// Returns the UIImageView of the object.
292292
/// - returns: A UIImageView object.
293-
internal var imageView: ImageView {
293+
open var imageView: ImageView {
294294
return self.view as! ImageView // swiftlint:disable:this force_cast
295295
}
296296

297297
/// Returns a UIImage representation of the receiver.
298298
/// - returns: A UIImage object.
299-
public var uiimage: UIImage {
299+
open var uiimage: UIImage {
300300
let layer = imageView.layer as CALayer
301301
let contents = layer.contents as! CGImage // swiftlint:disable:this force_cast
302302
return UIImage(cgImage: contents, scale: CGFloat(scale), orientation: imageView.image!.imageOrientation)
303303
}
304304

305305
/// Returns a CGImageRef representation of the receiver.
306306
/// - returns: A CGImageRef object.
307-
public var cgImage: CGImage {
307+
open var cgImage: CGImage {
308308
return uiimage.cgImage!
309309
}
310310

311311
/// Returns a CIImage representation of the receiver. Generally, this would be used to work with filters.
312312
/// - returns: A CIImage object.
313-
public var ciImage: CIImage {
313+
open var ciImage: CIImage {
314314
return CIImage(cgImage: cgImage)
315315
}
316316

@@ -319,7 +319,7 @@ public class Image: View, NSCopying {
319319
/// If you are using the layer to display a static image, you can set this property to the CGImageRef containing the image
320320
/// you want to display. Assigning a value to this property causes the layer to use your image rather than create a
321321
/// separate backing store.
322-
public var contents: CGImage {
322+
open var contents: CGImage {
323323
get {
324324
let layer = imageView.layer as CALayer
325325
return layer.contents as! CGImage // swiftlint:disable:this force_cast
@@ -330,7 +330,7 @@ public class Image: View, NSCopying {
330330

331331
/// The current rotation value of the view. Animatable.
332332
/// - returns: A Double value representing the cumulative rotation of the view, measured in Radians.
333-
public override var rotation: Double {
333+
open override var rotation: Double {
334334
get {
335335
if let number = imageLayer.value(forKeyPath: Layer.rotationKey) as? NSNumber {
336336
return number.doubleValue
@@ -351,7 +351,7 @@ public class Image: View, NSCopying {
351351
/// The default value of this property is defined by the image being created.
352352
/// Assigning a value to this property causes the receiver to change the width of its frame. If the receiver's
353353
/// `contrainsProportions` variable is set to `true` the receiver's height will change to match the new width.
354-
public override var width: Double {
354+
open override var width: Double {
355355
get {
356356
return Double(view.frame.size.width)
357357
} set(val) {
@@ -370,7 +370,7 @@ public class Image: View, NSCopying {
370370
/// The default value of this property is defined by the image being created.
371371
/// Assigning a value to this property causes the receiver to change the height of its frame. If the receiver's
372372
/// `contrainsProportions` variable is set to `true` the receiver's width will change to match the new width.
373-
public override var height: Double {
373+
open override var height: Double {
374374
get {
375375
return Double(view.frame.size.height)
376376
} set(val) {
@@ -388,7 +388,7 @@ public class Image: View, NSCopying {
388388
/// Assigning a value of true to this property will cause the receiver to scale its entire frame whenever its `width` or
389389
/// `height` variables are set.
390390
/// The default value of this property is `false`.
391-
public var constrainsProportions: Bool = false
391+
open var constrainsProportions: Bool = false
392392

393393
internal var _originalSize: Size = Size()
394394
/// The original size of the receiver when it was initialized.

0 commit comments

Comments
 (0)