FUIImageView

@IBDesignable
open class FUIImageView : UIImageView, FUIObservableValue

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.

Remark

Implements @IBDesignable

Usage

  • Initializing programmatically:
let imageView = FUIImageView(image: UIImage(named: "myProfilePic"))
//set image view to be circular
imageView.isCircular = true
  • Placing inside a Storyboard or xib:
  1. Drag and drop an UIImageView component to Interface Builder canvas.
  2. Switch class name from UIImageView to FUIImageView', and set module toSAPFiori`.
  3. To apply, set @IBInspectable property isCircular, to true
  • Implementation of change handler. Is invoked on changes to the value property.

    Declaration

    Swift

    open var onChangeHandler: ((Optional<UIImage>) -> Void)?
  • Override of backgroundColor, which prevents the alpha level of the cgColor from being set to 0. This enables the background color to remain constant when the FUIImageView is a subview of the contentView of a UITableViewCell, 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 using isCircular = 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 }
  • 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 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 }
  • Undocumented

    Declaration

    Swift

    public var glyphImage: UIImage? { get }
  • Developer formatted NSAttributedString to be displayed as the FUIGlyphImage

    Declaration

    Swift

    public var attributedText: NSAttributedString! { get }
  • Undocumented

    Declaration

    Swift

    public var attributes: [NSAttributedStringKey : Any] { get }
  • Undocumented

    Declaration

    Swift

    public var size: CGSize? { get }