FUISearchBar
@MainActor
public class FUISearchBar : UISearchBar
Fiori style UISearchBar.
Developer can add a FUIBarcodeScanner to this FUISearchBar by setting the
isBarcodeScannerEnabled property of the FUISearchBar to true. A barcode scanner
icon will be displayed at the bookmark icon location of the search bar.
A barcode scanner view will be displayed when the barcode scanner icon is tapped.
Please refer to FUISearchController about how to use this FUISearchBar.
Attention
The delegate object with type UISearchBarDelegate is declared as a weak reference. So on deallocation it will be automatically set to nil. To keep it alive as expected, developer should retain the delegate object during its whole execution scope.
-
If this is true, there will be a barcode scanner icon at the bookmark location of the search bar. The default is false.
When barcode scanner is enabled, the optional delegate function
searchBarBookmarkButtonClickedis invoked before the barcode scanner is displayed.Declaration
Swift
@MainActor public var isBarcodeScannerEnabled: Bool { get set } -
Undocumented
Declaration
Swift
@MainActor public var barcodeScanner: FUIBarcodeScanner? -
If this is set to true, a microphone icon will be displayed near the bookmark icon in the search bar. The default value is false.
When the microphone is enabled, the optional delegate function
searchBarBookmarkButtonClickedis invoked before the microphone is displayed.Declaration
Swift
@MainActor public var isSpeechRecognizerEnabled: Bool { get set } -
The custom image for the search icon (left side of text field). When set, replaces the default magnifying glass icon. Applied on every
layoutSubviewsto ensure styling persists.Usage
searchBar.searchIconImage = UIImage(systemName: "magnifyingglass.circle.fill")? .withTintColor(.systemBlue, renderingMode: .alwaysOriginal)Declaration
Swift
@MainActor public var searchIconImage: UIImage? { get set } -
The custom image for the bookmark button (barcode scanner or speech recognizer). When set, overrides the default barcode/microphone icon. Applied on every
layoutSubviewsto ensure styling persists.Usage
searchBar.bookmarkButtonImage = UIImage(systemName: "qrcode.viewfinder")? .withTintColor(.systemGreen, renderingMode: .alwaysOriginal) searchBar.isBarcodeScannerEnabled = trueDeclaration
Swift
@MainActor public var bookmarkButtonImage: UIImage? { get set } -
The custom image for the clear button inside
searchTextField. When set, replaces the default “x” circle icon. Applied on everylayoutSubviewsto ensure styling persists.Usage
searchBar.clearButtonImage = UIImage(systemName: "eraser.fill")? .withTintColor(.systemPink, renderingMode: .alwaysOriginal)Declaration
Swift
@MainActor public var clearButtonImage: UIImage? { get set }
-
The customized placeholder text.
Declaration
Swift
@MainActor public var placeholderText: String? { get set } -
The placehoder text font. Default is Fiori style subheadline.
Declaration
Swift
@MainActor public var placeholderTextFont: UIFont { get set } -
The placeholderTextColor. Default is #8E8E8E.
Declaration
Swift
@MainActor public var placeholderTextColor: UIColor { get set }