File tree Expand file tree Collapse file tree 5 files changed +14
-16
lines changed
Examples/DemosApp/DemosApp/Login
Sources/ComponentsKit/Helpers Expand file tree Collapse file tree 5 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,11 @@ struct SwiftUILogin: View {
2323 @State private var isLoading = false
2424
2525 private var isButtonEnabled : Bool {
26- return self . email. isNotEmpty
27- && self . password. isNotEmpty
26+ return ! self . email. isEmpty
27+ && ! self . password. isEmpty
2828 && self . isConsented
2929 && (
30- self . selectedPage == . signUp && self . name. isNotEmpty
30+ self . selectedPage == . signUp && ! self . name. isEmpty
3131 || self . selectedPage == . signIn
3232 )
3333 }
Original file line number Diff line number Diff line change @@ -76,11 +76,11 @@ final class UIKitLogin: UIViewController {
7676 }
7777
7878 private var isButtonEnabled : Bool {
79- return self . emailInput. text. isNotEmpty
80- && self . passwordInput. text. isNotEmpty
79+ return ! self . emailInput. text. isEmpty
80+ && ! self . passwordInput. text. isEmpty
8181 && self . consentCheckbox. isSelected
8282 && (
83- self . pageControl. selectedId == . signUp && self . nameInput. text. isNotEmpty
83+ self . pageControl. selectedId == . signUp && ! self . nameInput. text. isEmpty
8484 || self . pageControl. selectedId == . signIn
8585 )
8686 }
Original file line number Diff line number Diff line change 11import Foundation
22
33extension Array {
4- /// Returns the element at the specified index iff it is within bounds, nil otherwise.
5- /// Complexity: O(1).
4+ /// Returns the element at the specified index if it is within bounds, nil otherwise.
65 ///
76 /// - Parameter index: The index of the element to be returned.
87 /// - Returns: The value that corresponds to the index. nil if the value cannot be found.
9- public subscript( safe index: Index ) -> Iterator . Element ? {
8+ subscript( safe index: Index ) -> Iterator . Element ? {
109 return self . isIndexValid ( index) ? self [ index] : nil
1110 }
1211
1312 /// Checks whether the index is valid for the array.
14- /// Complexity: O(1).
1513 ///
1614 /// - Parameter index: The index to be checked.
1715 /// - Returns: true if the index is valid for the collection, false otherwise.
18- public func isIndexValid( _ index: Index ) -> Bool {
16+ func isIndexValid( _ index: Index ) -> Bool {
1917 return index >= self . startIndex && index < self . endIndex
2018 }
2119}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Foundation
22
33extension Collection {
44 /// Whether the collection is not empty.
5- public var isNotEmpty : Bool {
5+ var isNotEmpty : Bool {
66 return !self . isEmpty
77 }
88}
Original file line number Diff line number Diff line change @@ -2,19 +2,19 @@ import Foundation
22
33extension Optional {
44 /// Whether the value is nil.
5- public var isNil : Bool {
5+ var isNil : Bool {
66 return self == nil
77 }
88
99 /// Whether the value is not nil.
10- public var isNotNil : Bool {
10+ var isNotNil : Bool {
1111 return self != nil
1212 }
1313}
1414
1515extension Optional where Wrapped: Collection {
1616 /// Whether the value is not nil and empty.
17- public var isNotNilAndEmpty : Bool {
17+ var isNotNilAndEmpty : Bool {
1818 if let self {
1919 return self . isNotEmpty
2020 } else {
@@ -23,7 +23,7 @@ extension Optional where Wrapped: Collection {
2323 }
2424
2525 /// Whether the value is nil or empty.
26- public var isNilOrEmpty : Bool {
26+ var isNilOrEmpty : Bool {
2727 if let self {
2828 return self . isEmpty
2929 } else {
You can’t perform that action at this time.
0 commit comments