Skip to content

Commit 90908cc

Browse files
committed
ADD: add notification sample snippet
1 parent 81731e4 commit 90908cc

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDECodeSnippetCompletionPrefix</key>
6+
<string>notification</string>
7+
<key>IDECodeSnippetCompletionScopes</key>
8+
<array>
9+
<string>CodeExpression</string>
10+
</array>
11+
<key>IDECodeSnippetContents</key>
12+
<string> [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(&lt;#methodName#&gt;) name:kLoginNotification object:nil];
13+
[[NSNotificationCenter defaultCenter] removeObserver:self];
14+
// post notification
15+
NSDictionary * userInfo = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:200] forKey:@"code"];
16+
[[NSNotificationCenter defaultCenter] postNotificationName:&lt;#notification_name#&gt; object:self userInfo:userInfo];
17+
</string>
18+
<key>IDECodeSnippetIdentifier</key>
19+
<string>84587A91-678A-4727-9EBA-6F9D327EF485</string>
20+
<key>IDECodeSnippetLanguage</key>
21+
<string>Xcode.SourceCodeLanguage.Objective-C</string>
22+
<key>IDECodeSnippetSummary</key>
23+
<string>Notification sample</string>
24+
<key>IDECodeSnippetTitle</key>
25+
<string>Notification sample</string>
26+
<key>IDECodeSnippetUserSnippet</key>
27+
<true/>
28+
<key>IDECodeSnippetVersion</key>
29+
<integer>0</integer>
30+
</dict>
31+
</plist>

0 commit comments

Comments
 (0)