-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from MrAsterisco/1-multiple-combopicker-in-the-…
…same-view-conflict-with-each-other Fix multiple pickers on iOS, add value formatter
- Loading branch information
Showing
11 changed files
with
241 additions
and
63 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
Examples/ComboPickerExample/ComboPickerExample/Data/ExampleModelFormatter.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// ExampleModelFormatter.swift | ||
// ComboPickerExample | ||
// | ||
// Created by Alessio Moiso on 03.07.22. | ||
// | ||
|
||
import Foundation | ||
import ComboPicker | ||
|
||
final class ExampleModelFormatter: ValueFormatterType { | ||
func string(from value: ExampleModel) -> String { | ||
"# \(NumberFormatter().string(from: .init(value: value.value)) ?? "")" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alessio Moiso on 03.07.22. | ||
// | ||
|
||
import Foundation | ||
|
||
/// A type that represents a generic formatter. | ||
/// | ||
/// # Overview | ||
/// You can provide an implementation of this protocol to format | ||
/// the values you want to display in a `ComboPicker`. | ||
public protocol ValueFormatterType { | ||
associatedtype Value | ||
|
||
func string(from value: Value) -> String | ||
} |
Oops, something went wrong.