File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121
2222import SwiftUI
2323
24- extension Image {
24+ public struct SettingsIcon : View {
2525
26- /// Apply settings style for Image
27- ///
28- /// Example:
29- ///
30- /// Image(systemName: "wifi")
31- /// .settingStyle(color: .blue)
32- ///
33- public func settingStyle( color: Color ) -> some View {
34- self
35- . modifier ( SettingsImageModifier ( ) )
36- . foregroundColor ( color)
37- }
38-
39- }
40-
41- struct SettingsImageModifier : ViewModifier {
26+ let systemName : String
27+ let backgroundColor : Color
4228
43- func body( content : Content ) -> some View {
29+ public var body : some View {
4430 ZStack {
4531 Image ( systemName: " app.fill " )
4632 . font ( . system( size: 32 ) )
47- content
33+ . foregroundColor ( backgroundColor)
34+ Image ( systemName: systemName)
4835 . font ( . system( size: 16 ) )
4936 . foregroundColor ( . white)
5037 }
You can’t perform that action at this time.
0 commit comments