You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-12Lines changed: 10 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,6 @@ A Swift Macro for enhanced automatic memberwise initializers, greatly reducing m
9
9
10
10
Informed by explicit developer cues, MemberwiseInit can more often automatically provide your intended memberwise `init`, while following the same safe-by-default semantics underlying [Swift’s memberwise initializers][swifts-memberwise-init].
11
11
12
-
> :warning::warning::warning:**Pre-release**<br>
13
-
> I’m on the cusp of the official release and excited to share this with you! Dive in, experiment, and any feedback you provide will be greatly appreciated.
14
-
15
12
> :warning:**Important**<br>
16
13
> `@MemberwiseInit` is a Swift Macro requiring **swift-tools-version: 5.9** or later (**Xcode 15** onwards).
17
14
@@ -33,23 +30,24 @@ Informed by explicit developer cues, MemberwiseInit can more often automatically
33
30
To use MemberwiseInit:
34
31
35
32
1.**Installation**
36
-
<br> Add MemberwiseInit via Swift Package Manager by providing the package URL to your Xcode project: `https://github.com/gohanlon/swift-memberwise-init-macro`.
33
+
<br> In Xcode, add MemberwiseInit with: `File` → `Add Package Dependencies…` and input the package URL:
37
34
38
-
Or, for SPM-based projects, add it to your package dependencies and target dependency:
<br> After importing MemberwiseInit, add `@MemberwiseInit` before your type definition. This will mirror Swift’s behavior: it provides an initializer with up to internal access, but scales down if any properties are more restrictive. Here, `age` being private makes the initializer private too:
0 commit comments