29 lines
631 B
Swift
29 lines
631 B
Swift
import SwiftUI
|
|
import SFSafeSymbols
|
|
|
|
struct RightImageLabel: View {
|
|
|
|
let text: String
|
|
|
|
let systemSymbol: SFSymbol
|
|
|
|
init(_ text: String, systemSymbol: SFSymbol) {
|
|
self.text = text
|
|
self.systemSymbol = systemSymbol
|
|
}
|
|
|
|
var body: some View {
|
|
HStack(alignment: .firstTextBaseline, spacing: 3) {
|
|
Image(systemSymbol: systemSymbol)
|
|
.aspectRatio(1, contentMode: .fill)
|
|
Text(text)
|
|
}
|
|
}
|
|
}
|
|
|
|
struct RightImageLabel_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
RightImageLabel("Home address", systemSymbol: .house)
|
|
}
|
|
}
|