@@ -9,6 +9,7 @@ class PinButton: View {
99 var secondary : Button !
1010 var tertiary : Button !
1111 var custom : Button !
12+ var primaryFloating : Button !
1213
1314 override func setup( ) {
1415 primary = Button ( title: " Press me " )
@@ -42,6 +43,8 @@ class PinButton: View {
4243 let customDisabled = Button ( title: " Custom " , font: . caption, style: . custom( textColor: . green, backgroundColor: . red) )
4344 customDisabled. isEnabled = false
4445
46+ primaryFloating = Button ( title: " Continue " )
47+
4548 let stackView = UIStackView ( axis: . vertical, spacing: . spacingM, alignment: . center)
4649 stackView. addArrangedSubviews ( [
4750 primary,
@@ -58,6 +61,13 @@ class PinButton: View {
5861 ] )
5962 addSubview ( stackView)
6063 stackView. anchorToTopSafeArea ( margin: . spacingXXL)
64+
65+ addSubview ( primaryFloating)
66+ NSLayoutConstraint . activate ( [
67+ primaryFloating. leadingAnchor. constraint ( greaterThanOrEqualTo: leadingAnchor, constant: . spacingM) ,
68+ primaryFloating. trailingAnchor. constraint ( equalTo: trailingAnchor, constant: - . spacingM) ,
69+ primaryFloating. bottomAnchor. constraint ( equalTo: safeAreaLayoutGuide. bottomAnchor, constant: - . spacingM)
70+ ] )
6171 }
6272
6373 @objc func loadingPressed( _ button: Button ) {
@@ -83,7 +93,8 @@ class PinButton: View {
8393 }
8494
8595 @objc func loading( ) {
86- primaryLoading. title = primaryLoading. isLoading ? " Save " : " Saving "
87- primaryLoading. showActivityIndicator ( !primaryLoading. isLoading)
96+ // primaryLoading.title = primaryLoading.isLoading ? "Save" : "Saving"
97+ // primaryLoading.showActivityIndicator(!primaryLoading.isLoading)
98+ primaryFloating. showActivityIndicator ( !primaryFloating. isLoading)
8899 }
89100}
0 commit comments