20
20
import UIKit
21
21
22
22
/// 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 {
25
25
var imageLayer : ImageLayer {
26
26
return self . layer as! ImageLayer // swiftlint:disable:this force_cast
27
27
}
28
28
29
- override class var layerClass : AnyClass {
29
+ override open class var layerClass : AnyClass {
30
30
return ImageLayer . self
31
31
}
32
32
}
33
33
34
34
/// Shape's contents are drawn on a ShapeLayer.
35
- public var imageLayer : ImageLayer {
35
+ open var imageLayer : ImageLayer {
36
36
return self . imageView. imageLayer
37
37
}
38
38
@@ -290,27 +290,27 @@ public class Image: View, NSCopying {
290
290
291
291
/// Returns the UIImageView of the object.
292
292
/// - returns: A UIImageView object.
293
- internal var imageView : ImageView {
293
+ open var imageView : ImageView {
294
294
return self . view as! ImageView // swiftlint:disable:this force_cast
295
295
}
296
296
297
297
/// Returns a UIImage representation of the receiver.
298
298
/// - returns: A UIImage object.
299
- public var uiimage : UIImage {
299
+ open var uiimage : UIImage {
300
300
let layer = imageView. layer as CALayer
301
301
let contents = layer. contents as! CGImage // swiftlint:disable:this force_cast
302
302
return UIImage ( cgImage: contents, scale: CGFloat ( scale) , orientation: imageView. image!. imageOrientation)
303
303
}
304
304
305
305
/// Returns a CGImageRef representation of the receiver.
306
306
/// - returns: A CGImageRef object.
307
- public var cgImage : CGImage {
307
+ open var cgImage : CGImage {
308
308
return uiimage. cgImage!
309
309
}
310
310
311
311
/// Returns a CIImage representation of the receiver. Generally, this would be used to work with filters.
312
312
/// - returns: A CIImage object.
313
- public var ciImage : CIImage {
313
+ open var ciImage : CIImage {
314
314
return CIImage ( cgImage: cgImage)
315
315
}
316
316
@@ -319,7 +319,7 @@ public class Image: View, NSCopying {
319
319
/// If you are using the layer to display a static image, you can set this property to the CGImageRef containing the image
320
320
/// you want to display. Assigning a value to this property causes the layer to use your image rather than create a
321
321
/// separate backing store.
322
- public var contents : CGImage {
322
+ open var contents : CGImage {
323
323
get {
324
324
let layer = imageView. layer as CALayer
325
325
return layer. contents as! CGImage // swiftlint:disable:this force_cast
@@ -330,7 +330,7 @@ public class Image: View, NSCopying {
330
330
331
331
/// The current rotation value of the view. Animatable.
332
332
/// - 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 {
334
334
get {
335
335
if let number = imageLayer. value ( forKeyPath: Layer . rotationKey) as? NSNumber {
336
336
return number. doubleValue
@@ -351,7 +351,7 @@ public class Image: View, NSCopying {
351
351
/// The default value of this property is defined by the image being created.
352
352
/// Assigning a value to this property causes the receiver to change the width of its frame. If the receiver's
353
353
/// `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 {
355
355
get {
356
356
return Double ( view. frame. size. width)
357
357
} set ( val) {
@@ -370,7 +370,7 @@ public class Image: View, NSCopying {
370
370
/// The default value of this property is defined by the image being created.
371
371
/// Assigning a value to this property causes the receiver to change the height of its frame. If the receiver's
372
372
/// `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 {
374
374
get {
375
375
return Double ( view. frame. size. height)
376
376
} set ( val) {
@@ -388,7 +388,7 @@ public class Image: View, NSCopying {
388
388
/// Assigning a value of true to this property will cause the receiver to scale its entire frame whenever its `width` or
389
389
/// `height` variables are set.
390
390
/// The default value of this property is `false`.
391
- public var constrainsProportions : Bool = false
391
+ open var constrainsProportions : Bool = false
392
392
393
393
internal var _originalSize : Size = Size ( )
394
394
/// The original size of the receiver when it was initialized.
0 commit comments