FUIImageView
@IBDesignable
open class FUIImageView : UIImageView, FUIObservableValue, InnerViewContainer
extension FUIImageView: FUIGlyphImage
extension FUIImageView: FUIAttributedGlyphImage
FUIImageView
is an enhanced Fiori style UIImageView
that provides the option of applying a circular mask to the view’s image
property. The view also exposes properties for specifying the width and color of an optional border around the image.
The contentMode
of the FUIImageView
is set the scaleAspectFit
by default
Remark
Implements@IBDesignable
Usage
- Initializing programmatically:
let imageView = FUIImageView(image: UIImage(named: "myProfilePic"))
//set image view to be circular
imageView.isCircular = true
// To enable a default gradient layer behind the placehoder text
imageView.isGradientLayerEnabled = true
// Set placeholder text
imageView.placeholder.text = "This is a placehoder"
// Set placeholder background color
imageView.placeholderBackgroundColor = UIColor.white
- Placing inside a Storyboard or xib:
- Drag and drop an
UIImageView
component to Interface Builder canvas. - Switch class name from
UIImageView
toFUIImageView', and set module to
SAPFiori`. - To apply, set
@IBInspectable
propertyisCircular
, totrue
-
Instance of InnerView
Declaration
Swift
public internal(set) var _innerView: FUIPlaceholderView! { get }
-
Alias for
FUIPlaceholderView
.Declaration
Swift
public typealias InnerView = FUIPlaceholderView
-
Undocumented
Declaration
Swift
public var isEmpty: Bool { get }
-
Implementation of change handler. Is invoked on changes to the
value
property.Declaration
Swift
open var onChangeHandler: ((UIImage?) -> Void)?
-
A boolean to enable a default gradient layer. If
placeholderBackgroundColor
is set, the gradient layer won’t be displayed.Declaration
Swift
public var isGradientLayerEnabled: Bool { get set }
-
An array of CGColors for the gradient layer.
Declaration
Swift
public var gradientLayerColors: [CGColor]? { get set }
-
Override of
backgroundColor
, which prevents thealpha
level of thecgColor
from being set to0
. This enables the background color to remain constant when theFUIImageView
is a subview of thecontentView
of aUITableViewCell
, when the cell is tapped.This makes it much more convenient to produce solid color profile images, when setting the
tintColor
of the view to.white
, and usingisCircular = true
.Example:
let cell = FUIObjectTableViewCell(/*...*/) cell.detailImageView.image = FUIIconLibrary.map.marker.asset.withRenderingMode(.alwaysTemplate) cell.detailImageView.backgroundColor = UIColor.blue cell.detailImageView.tintColor = UIColor.white cell.detailImageView.isCircular = true
Declaration
Swift
override open var backgroundColor: UIColor? { get set }
-
Background color behind the placeholder text
Declaration
Swift
public var placeholderBackgroundColor: UIColor? { get set }
-
Override intrinsicContentSize to provide a default image size for Auto Layout
Declaration
Swift
override open var intrinsicContentSize: CGSize { get }
-
Undocumented
Declaration
Swift
override open var gestureRecognizers: [UIGestureRecognizer]? { get set }
-
Undocumented
Declaration
Swift
override open func addGestureRecognizer(_ gestureRecognizer: UIGestureRecognizer)
-
Undocumented
Declaration
Swift
override open func removeGestureRecognizer(_ gestureRecognizer: UIGestureRecognizer)
-
Property defining the circular type of the image view. Default is false, which has no ciruclar mask to the image
Declaration
Swift
@IBInspectable open var isCircular: Bool { get set }
-
Property defining the mask type of the image view. Default is
roundedCorner
, where the image view is corner roundedDeclaration
Swift
open var maskType: FUIImageView.MaskType { get set }
-
Property of supported mask types applied to the image view.
See moreDeclaration
Swift
public enum MaskType : Equatable
-
Property defining the border color.
Declaration
Swift
@IBInspectable open var borderColor: UIColor? { get set }
-
Property defining the border width. A width of 0.0 will result in no border being shown.
Declaration
Swift
@IBInspectable open var borderWidth: CGFloat { get set }
-
Undocumented
Declaration
Swift
open override var forFirstBaselineLayout: UIView { get }
-
Undocumented
Declaration
Swift
open override var forLastBaselineLayout: UIView { get }
-
Undocumented
Declaration
Swift
open var baselineDescenderHeight: CGFloat { get set }
-
Developer formatted
glyphImage
to be displayed as theFUIGlyphImage
Declaration
Swift
public var glyphImage: UIImage? { get }
-
Developer formatted
NSAttributedString
to be displayed as theFUIGlyphImage
Declaration
Swift
public var attributedText: NSAttributedString! { get }
-
Add a size property for
FUIImageView
Declaration
Swift
public var size: CGSize? { get }