UIViewController

extension UIViewController
  • Sets the Fiori Style items on UIToolbar

    This function only arranges items when the toolbar associated with the navigation controller is an instance of FUIToolbar, This function will convert the array of UIButton to UIBarButtonItem array and use the standard setToolbarItems API to set the items to the toolbar.

    Note that Fiori only handles the button with text titles. For icon buttons, use UIBarButtonItem with image instead.

    If the toolbar associated with the navigation controller is not FUIToolbar, then the converted UIBarButtonItem array is used directly in the standard setToolbarItems API of the UIViewController.

    When the hasPrimaryActionItem parameter is true, the buttons will be displayed from right-to-left for the left-to-right layout, and from left-to-right for the right-to-left layout.

    Declaration

    Swift

    public func setFioriStyleToolbarItems(_ buttons: [UIButton]?, helperText: String? = nil, hasPrimaryActionItem: Bool = false, animated: Bool)

    Parameters

    buttons

    The array of buttons to be displayed in the UIToolbar. The first item in the array is the primary action button when the hasPrimaryActionItem parameter is true.

    helperText

    The helper text to be displayed in the UIToolbar.

    hasPrimaryActionItem

    True if the first item is the primary action item.

    animated

    If true, animate the change of items in the toolbar.

  • Sets the Fiori Style items on UIToolbar

    This function only arranges items when the following conditions are met:

    • The toolbar associated with the navigation controller is an instance of FUIToolbar.
    • All items are in the same type
      • Text button type: the customView of the UIBarButtonItem array elements are all UIButton with title text.
      • Icon type: The UIBarButtonItem array elements are all all UIBarButtonItem with image.

    If the toolbar associated with the navigation controller is not FUIToolbar, or the array contains different types, then the UIBarButtonItem array is used directly in the standard setToolbarItems API of the UIViewController.

    When hasPrimaryActionItem parameter is true, the buttons will be displayed from right to left for left-to-right layout, and from left to right for right-to-left layout.

    Declaration

    Swift

    public func setFioriStyleToolbarItems(_ toolbarItems: [UIBarButtonItem]?, helperText: String? = nil, hasPrimaryActionItem: Bool = false, animated: Bool)

    Parameters

    buttons

    The array of UIBarButtonItem objects to be displayed in the UIToolbar. The first item in the array is the primary action item when the hasPrimaryActionItem parameter is true.

    helperText

    The helper text to be displayed in the UIToolbar.

    hasPrimaryActionItem

    True if the first item is the primary action item.

    animated

    If true, animate the change of items in the toolbar.

  • Set NSAttributedString title and subtitle to titleView of UINavigationItem

    Declaration

    Swift

    public func setTitleView(_ attributedTitle: NSAttributedString, attributedSubtitle: NSAttributedString? = nil, withPopover: Bool = false)

    Parameters

    attributedTitle

    NSAttributedString title for the titleView

    attributedSubtitle

    NSAttributedString subtitle for the titleView; the default is nil.

    withPopover

    true to show the full title and subtitle in popover once longpressed the titleView

  • Set title and subtitle to titleView of UINavigationItem

    Declaration

    Swift

    public func setTitleView(_ title: String, subtitle: String? = nil, withPopover: Bool = false)

    Parameters

    title

    title for the titleView

    subtitle

    subtitle for the titleView; the default is nil.

    withPopover

    true to show the full title and subtitle in the popover once the titleView has been longpressed.