UIViewController
extension UIViewController
-
Sets the Fiori Style items on
UIToolbarThis function only arranges items when the toolbar associated with the navigation controller is an instance of
FUIToolbar, This function will convert the array ofUIButtontoUIBarButtonItemarray and use the standardsetToolbarItemsAPI to set the items to the toolbar.Note that Fiori only handles the button with text titles. For icon buttons, use
UIBarButtonItemwith image instead.If the toolbar associated with the navigation controller is not
FUIToolbar, then the convertedUIBarButtonItemarray is used directly in the standardsetToolbarItemsAPI of theUIViewController.When the
hasPrimaryActionItemparameter istrue, 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
@MainActor public func setFioriStyleToolbarItems(_ buttons: [UIButton]?, helperText: String? = nil, hasPrimaryActionItem: Bool = false, animated: Bool)Parameters
buttonsThe array of buttons to be displayed in the
UIToolbar. The first item in the array is the primary action button when thehasPrimaryActionItemparameter istrue.helperTextThe helper text to be displayed in the
UIToolbar.hasPrimaryActionItemTrue if the first item is the primary action item.
animatedIf true, animate the change of items in the toolbar.
-
Sets the Fiori Style items on
UIToolbarThis 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
customViewof theUIBarButtonItemarray elements are all UIButton with title text. - Icon type: The
UIBarButtonItemarray elements are all allUIBarButtonItemwith image.
- Text button type: the
If the toolbar associated with the navigation controller is not
FUIToolbar, or the array contains different types, then theUIBarButtonItemarray is used directly in the standardsetToolbarItemsAPI of theUIViewController.When
hasPrimaryActionItemparameter 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
@MainActor public func setFioriStyleToolbarItems(_ toolbarItems: [UIBarButtonItem]?, helperText: String? = nil, hasPrimaryActionItem: Bool = false, animated: Bool)Parameters
buttonsThe array of
UIBarButtonItemobjects to be displayed in theUIToolbar. The first item in the array is the primary action item when thehasPrimaryActionItemparameter is true.helperTextThe helper text to be displayed in the
UIToolbar.hasPrimaryActionItemTrue if the first item is the primary action item.
animatedIf true, animate the change of items in the toolbar.
- The toolbar associated with the navigation controller is an instance of
-
Set
NSAttributedStringtitle and subtitle totitleViewof UINavigationItemDeclaration
Swift
@MainActor public func setTitleView(_ attributedTitle: NSAttributedString, attributedSubtitle: NSAttributedString? = nil, withPopover: Bool = false)Parameters
attributedTitleNSAttributedStringtitle for thetitleViewattributedSubtitleNSAttributedStringsubtitle for thetitleView; the default is nil.withPopovertrue to show the full title and subtitle in popover once longpressed the
titleView -
Set title and subtitle to
titleViewofUINavigationItemDeclaration
Swift
@MainActor public func setTitleView(_ title: String, subtitle: String? = nil, withPopover: Bool = false)Parameters
titletitle for the
titleViewsubtitlesubtitle for the
titleView; the default is nil.withPopovertrue to show the full title and subtitle in the popover once the
titleViewhas been longpressed.