Skip to content

Commit 783c5cc

Browse files
committed
Use Option<T>.optional as a variable instead of a method
1 parent 35e0f7d commit 783c5cc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Source/OptionPickerControl/Option.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public struct Option<T: OptionDescriptive>: Equatable {
4141
// MARK: - Initialization
4242

4343
/// Returns an option that displays the optional value of an `OptionDescriptive` type.
44-
public static func optional() -> Option<T> {
44+
public static var optional: Option<T> {
4545
return Option<T>()
4646
}
4747

Source/OptionPickerControl/OptionPickerControl.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ open class OptionPickerControl<T: OptionDescriptive>: UIControl, UIPickerViewDat
4545
// MARK: - Properties
4646

4747
/// Options that shows in the `UIPickerView`.
48-
public var options: [Option<T>] = [Option<T>.optional()]
48+
public var options: [Option<T>] = [.optional]
4949

5050
/// The currently selected item in the options.
51-
public var selectedOption: Option<T> = Option<T>.optional() {
51+
public var selectedOption: Option<T> = .optional {
5252
didSet {
5353
if hiddenTextField.isFirstResponder {
5454
sendActions(for: .valueChanged)

0 commit comments

Comments
 (0)