-
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.
- Loading branch information
Showing
5 changed files
with
48,349 additions
and
6 deletions.
There are no files selected for viewing
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
20 changes: 20 additions & 0 deletions
20
Sources/LHSFSymbolsHelpers/Extensions/Image+Extensions.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,20 @@ | ||
// | ||
// Image+Extensions.swift | ||
// SwiftHelpers/LHSFSymbolsHelpers | ||
// | ||
// Created by Leo Ho on 2023/10/2. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public extension Image { | ||
|
||
init(systemIcon: SFSymbols) { | ||
self.init(systemName: systemIcon.rawValue) | ||
} | ||
|
||
@available(iOS 16.0, *) | ||
init(systemIcon: SFSymbols, variableValue: Double?) { | ||
self.init(systemName: systemIcon.rawValue, variableValue: variableValue) | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
Sources/LHSFSymbolsHelpers/Extensions/Label+Extensions.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,19 @@ | ||
// | ||
// Label+Extensions.swift | ||
// SwiftHelpers/LHSFSymbolsHelpers | ||
// | ||
// Created by Leo Ho on 2023/10/2. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public extension Label where Title == Text, Icon == Image { | ||
|
||
init(_ titleKey: LocalizedStringKey, systemIcon name: SFSymbols) { | ||
self.init(titleKey, systemImage: name.rawValue) | ||
} | ||
|
||
init<S>(_ title: S, systemIcon name: SFSymbols) where S : StringProtocol { | ||
self.init(title, systemImage: name.rawValue) | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Sources/LHSFSymbolsHelpers/Extensions/UIImage+Extensions.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 @@ | ||
// | ||
// UIImage+Extensions.swift | ||
// SwiftHelpers/LHSFSymbolsHelpers | ||
// | ||
// Created by Leo Ho on 2023/10/2. | ||
// | ||
|
||
import UIKit | ||
|
||
public extension UIImage { | ||
|
||
convenience init?(systemIcon: SFSymbols) { | ||
self.init(systemName: systemIcon.rawValue) | ||
} | ||
} |
Oops, something went wrong.