-
Notifications
You must be signed in to change notification settings - Fork 236
/
QM_property_swizzle_weak.codesnippet
31 lines (30 loc) · 1.18 KB
/
QM_property_swizzle_weak.codesnippet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?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>propertySwizzleWeak</string>
<key>IDECodeSnippetCompletionScopes</key>
<array>
<string>ClassImplementation</string>
</array>
<key>IDECodeSnippetContents</key>
<string>static char kAssociatedObjectKey_<#property name#>;
- (void)set<#property name#> {
objc_setAssociatedObject(self, &kAssociatedObjectKey_<#property name#>, <#argument name#>, OBJC_ASSOCIATION_ASSIGN);
}
- <#property getter#> {
return (<#Property type#> *)objc_getAssociatedObject(self, &kAssociatedObjectKey_<#property name#>);
}</string>
<key>IDECodeSnippetIdentifier</key>
<string>B696ADA0-4026-4954-A454-8B7B2FCE40BF</string>
<key>IDECodeSnippetLanguage</key>
<string>Xcode.SourceCodeLanguage.Objective-C</string>
<key>IDECodeSnippetTitle</key>
<string>用swizzle方式创建weak类型的property的getter/setter</string>
<key>IDECodeSnippetUserSnippet</key>
<true/>
<key>IDECodeSnippetVersion</key>
<integer>2</integer>
</dict>
</plist>