FUIEULAViewController
@MainActor
open class FUIEULAViewController : FUIWelcomeController, FUISolidNavigationBarProtocol, UIScrollViewDelegate
This UIViewController is used to display the End User License Agreement, EULA.
There are two buttons on the tool bar at the bottom of the screen, “Agree” and “Disagree”, to choose to
confirm or reject the agreement. In addition, there is a “Cancel” button at the
left on the navigation bar.
Developer should provide the text for the headlineLabel property, the attributed text for the eulaTextView property,
and set the delegate property to handle user interactions.
let eulaController = FUIEULAViewController.createInstanceFromStoryboard()
eulaController.headlineLabel.text = "CUSTOM EULA"
eulaController.eulaTextView.attributedText = NSAttributedString(string: "This is a legally binding agreement (\"Agreement\") between ...", attributes: [NSAttributedStringKey.font: UIFont(name: "Georgia", size: 24.0)!
])
eulaController.delegate = self
let navController = UINavigationController.init(rootViewController: eulaController)
self.navigationController?.present(navController, animated: true, completion: nil)
Theming
fdlFUIEULAView_headlineLabel {
font-size: 28;
font-name: thinSystem;
font-color: @primary1;
}
fdlFUIEULAView_confirmButton {
background-tint-color: @tintColorDark;
}
fdlFUIEULAView_rejectButton {
background-tint-color: @tintColorDark;
}
fdlFUIEULAView_cancelButton {
background-tint-color: @tintColorDark;
}
fdlFUIEULAView_navigationBar {
background-color: clear;
background-tint-color: @tintColor;
bar-style: default;
}
Attention
The delegate object with type FUIEULADelegate is declared as a weak reference. 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.
-
The
UILabelto hold the EULA title - Developer should set the text for this headline label.Declaration
Swift
@IBOutlet @MainActor public private(set) weak var headlineLabel: UILabel! { get } -
The
UITextViewto hold the EULA text - Developer should set the text using itsattributedTextproperty.Declaration
Swift
@IBOutlet @MainActor public private(set) weak var eulaTextView: UITextView! { get } -
The confirmation button - The default string is from localized strings file - “Agree”.
Declaration
Swift
@IBOutlet @MainActor public private(set) weak var confirmButton: UIBarButtonItem! { get } -
The confirmation button - The default string is from localized strings file - “Disagree”.
Declaration
Swift
@IBOutlet @MainActor public private(set) weak var rejectButton: UIBarButtonItem! { get } -
The cancel button. This is configured as the iOS system “Cancel” bar button item.
Declaration
Swift
@IBOutlet @MainActor public private(set) weak var cancelButton: UIBarButtonItem! { get } -
The delegate to handle user interaction on the screen.
Declaration
Swift
@MainActor public weak var delegate: FUIEULADelegate? -
This property indicates if the “Confirm” button should be disabled until the user scrolls the EULA text to the end.
The default is false. Which means the “Confirm” button is always enabled.
Declaration
Swift
@MainActor open var disablesConfirmActionUntilScrollingToEnd: Bool -
Creates a
FUIEULAViewControllerobject from storyboard.Declaration
Swift
@MainActor public class func createInstanceFromStoryboard() -> FUIEULAViewController -
Undocumented
Declaration
Swift
@MainActor public func scrollViewDidScroll(_ scrollView: UIScrollView) -
Set EULA attributedText and enable the dynamic type when using customized font.
Declaration
Swift
@MainActor public func setEULAText(_ attrString: NSAttributedString, replaceWithScaledFont: Bool = false)Parameters
attrStringThe value of NSAttributedString.
replaceWithScaledFontThe Bool value to enable the dynamic type for customized font. It is false by default.