Add visibility parameters to control scope of generated extension
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit

This commit is contained in:
2025-07-18 11:53:46 +02:00
parent beca2c6b2b
commit 7162f13166
61 changed files with 1511 additions and 791 deletions

View File

@ -6,6 +6,7 @@
//
import Foundation
import ToolCore
enum ImageExtension: String {
@ -129,16 +130,16 @@ struct ParsedImage {
// MARK: - Extension property
func getImageProperty(isStatic: Bool, isSwiftUI: Bool) -> String {
func getImageProperty(isStatic: Bool, isSwiftUI: Bool, visibility: ExtensionVisibility) -> String {
if isSwiftUI {
return """
\(isStatic ? "static " : "")var \(name): Image {
\(visibility) \(isStatic ? "static " : "")var \(name): Image {
Image("\(name)")
}
"""
}
return """
\(isStatic ? "static " : "")var \(name): UIImage {
\(visibility) \(isStatic ? "static " : "")var \(name): UIImage {
UIImage(named: "\(name)")!
}
"""