This is how i use it in code:
@State var selectedType: BiblePlanOffsetType = .verse
@State var types = [BiblePlanOffsetType.verse, .chapter]
Picker("", selection: $selectedType) {
ForEach(types, id: \.self) { elem in
Text(elem.title)
}
}
.pickerStyle(.segmented)
enum BiblePlanOffsetType: Int16, CaseIterable {
case verse = 0
case chapter = 1
var title: String {
switch self {
case .verse:
return "\(Image(systemName: "quote.opening")) " + "verses".localized
case .chapter:
return "\(Image(systemName: "text.quote")) " + "chapters".localized
}
}
}
Why it results with no icon displayed?
According to this article, it should work.
