Skip to content

Commit

Permalink
⚗️ (tuist): Experiment with macros
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Nov 15, 2023
1 parent aa4bbbb commit 3413f11
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Examples/iOSApp/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ let project = Project.iOSApp(
name: "iOSApp",
version: "1.0.0",
dependencies: [
.project(target: "Module", path: Path("../../Examples/Module"))
.project(target: "Module", path: Path("../../Examples/Module")),
.package(product: "SFSymbolsMacro"),
])
14 changes: 13 additions & 1 deletion Examples/iOSApp/Sources/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@
// SPDX-License-Identifier: Apache-2.0

import Module
import SFSymbolsMacro
import SwiftUI

@SFSymbol
enum Symbols: String {
case circle
case circleFill = "circle.fill"
case shareIcon = "square.and.arrow.up"
case globe
}

struct ContentView: View {
var body: some View {
HelloView(color: .mint, name: "iOS App Example")
VStack {
Image(systemName: Symbols.globe())
HelloView(color: .mint, name: "iOS App Example")
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions Tuist/Dependencies.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ let dependencies = Dependencies(
url: "https://github.com/mxcl/Version",
requirement: .exact("2.0.1")
),
.package(
url: "https://github.com/lukepistrol/SFSymbolsMacro",
.exact("0.5.0")
),
]),
platforms: [.iOS, .macOS]
)

0 comments on commit 3413f11

Please sign in to comment.