File tree 5 files changed +14
-16
lines changed
Examples/DemosApp/DemosApp/Login
Sources/ComponentsKit/Helpers
5 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,11 @@ struct SwiftUILogin: View {
23
23
@State private var isLoading = false
24
24
25
25
private var isButtonEnabled : Bool {
26
- return self . email. isNotEmpty
27
- && self . password. isNotEmpty
26
+ return ! self . email. isEmpty
27
+ && ! self . password. isEmpty
28
28
&& self . isConsented
29
29
&& (
30
- self . selectedPage == . signUp && self . name. isNotEmpty
30
+ self . selectedPage == . signUp && ! self . name. isEmpty
31
31
|| self . selectedPage == . signIn
32
32
)
33
33
}
Original file line number Diff line number Diff line change @@ -76,11 +76,11 @@ final class UIKitLogin: UIViewController {
76
76
}
77
77
78
78
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
81
81
&& self . consentCheckbox. isSelected
82
82
&& (
83
- self . pageControl. selectedId == . signUp && self . nameInput. text. isNotEmpty
83
+ self . pageControl. selectedId == . signUp && ! self . nameInput. text. isEmpty
84
84
|| self . pageControl. selectedId == . signIn
85
85
)
86
86
}
Original file line number Diff line number Diff line change 1
1
import Foundation
2
2
3
3
extension 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.
6
5
///
7
6
/// - Parameter index: The index of the element to be returned.
8
7
/// - 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 ? {
10
9
return self . isIndexValid ( index) ? self [ index] : nil
11
10
}
12
11
13
12
/// Checks whether the index is valid for the array.
14
- /// Complexity: O(1).
15
13
///
16
14
/// - Parameter index: The index to be checked.
17
15
/// - 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 {
19
17
return index >= self . startIndex && index < self . endIndex
20
18
}
21
19
}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Foundation
2
2
3
3
extension Collection {
4
4
/// Whether the collection is not empty.
5
- public var isNotEmpty : Bool {
5
+ var isNotEmpty : Bool {
6
6
return !self . isEmpty
7
7
}
8
8
}
Original file line number Diff line number Diff line change @@ -2,19 +2,19 @@ import Foundation
2
2
3
3
extension Optional {
4
4
/// Whether the value is nil.
5
- public var isNil : Bool {
5
+ var isNil : Bool {
6
6
return self == nil
7
7
}
8
8
9
9
/// Whether the value is not nil.
10
- public var isNotNil : Bool {
10
+ var isNotNil : Bool {
11
11
return self != nil
12
12
}
13
13
}
14
14
15
15
extension Optional where Wrapped: Collection {
16
16
/// Whether the value is not nil and empty.
17
- public var isNotNilAndEmpty : Bool {
17
+ var isNotNilAndEmpty : Bool {
18
18
if let self {
19
19
return self . isNotEmpty
20
20
} else {
@@ -23,7 +23,7 @@ extension Optional where Wrapped: Collection {
23
23
}
24
24
25
25
/// Whether the value is nil or empty.
26
- public var isNilOrEmpty : Bool {
26
+ var isNilOrEmpty : Bool {
27
27
if let self {
28
28
return self . isEmpty
29
29
} else {
You can’t perform that action at this time.
0 commit comments