-
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.
Merge pull request #8 from surfstudio/SPT-2156-environmentAccessible
SPT-2156 Макрос для добавления EnvironmentKey и EnvironmentValues
- Loading branch information
Showing
3 changed files
with
53 additions
and
1 deletion.
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
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,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDECodeSnippetCompletionPrefix</key> | ||
<string>envacc</string> | ||
<key>IDECodeSnippetCompletionScopes</key> | ||
<array> | ||
<string>TopLevel</string> | ||
</array> | ||
<key>IDECodeSnippetContents</key> | ||
<string>public enum <#Style#>Key: EnvironmentKey { | ||
|
||
public static var defaultValue: any <#Style#> = <#defaultValue#> | ||
|
||
} | ||
|
||
public extension EnvironmentValues { | ||
|
||
var <#style#>: any <#Style#> { | ||
get { self[<#Style#>Key.self] } | ||
set { self[<#Style#>Key.self] = newValue } | ||
} | ||
|
||
} | ||
|
||
public extension View { | ||
|
||
func <#style#>(_ style: any <#Style#>) -> some View { | ||
self.environment(\.<#style#>, style) | ||
} | ||
|
||
} | ||
</string> | ||
<key>IDECodeSnippetIdentifier</key> | ||
<string>4D299F53-806E-4E29-8B00-8A0DFA5E500D</string> | ||
<key>IDECodeSnippetLanguage</key> | ||
<string>Xcode.SourceCodeLanguage.Swift</string> | ||
<key>IDECodeSnippetSummary</key> | ||
<string>Содержит все необходимое для добавления Style в SwiftUI</string> | ||
<key>IDECodeSnippetTitle</key> | ||
<string>EnvironmentAccessible</string> | ||
<key>IDECodeSnippetUserSnippet</key> | ||
<true/> | ||
<key>IDECodeSnippetVersion</key> | ||
<integer>2</integer> | ||
</dict> | ||
</plist> |
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