Skip to content

Commit edfd0ec

Browse files
author
Tim Studt
committed
first snippets
1 parent 003f89f commit edfd0ec

5 files changed

+208
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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> guard postIndex &lt; posts.count else {
7+
return ASCellNode()
8+
}
9+
guard postIndex &lt; posts.count else {
10+
return ASCellNode()
11+
}
12+
swift-ascollectionnode-datasource</string>
13+
<key>IDECodeSnippetCompletionScopes</key>
14+
<array>
15+
<string>All</string>
16+
</array>
17+
<key>IDECodeSnippetContents</key>
18+
<string> //MARK: - ASCollectionDataSource
19+
func numberOfSections(in collectionNode: ASCollectionNode) -&gt; Int {
20+
return &lt;#sections#&gt;
21+
}
22+
23+
func collectionNode(_ collectionNode: ASCollectionNode, numberOfItemsInSection section: Int) -&gt; Int {
24+
return &lt;#rows#&gt;
25+
}
26+
27+
func collectionNode(_ collectionNode: ASCollectionNode, nodeForItemAt indexPath: IndexPath) -&gt; ASCellNode {
28+
guard indexPath.row &lt; &lt;#data#&gt;.count else {
29+
return ASCellNode()
30+
}
31+
let item = &lt;#data#&gt;[indexPath.row]
32+
return ASCellNode()
33+
}
34+
</string>
35+
<key>IDECodeSnippetIdentifier</key>
36+
<string>91D4FDB6-40E8-4835-87D0-165B447CC52D</string>
37+
<key>IDECodeSnippetLanguage</key>
38+
<string>Xcode.SourceCodeLanguage.Generic</string>
39+
<key>IDECodeSnippetTitle</key>
40+
<string>ASCollectionNodeDataSource</string>
41+
<key>IDECodeSnippetUserSnippet</key>
42+
<true/>
43+
<key>IDECodeSnippetVersion</key>
44+
<integer>0</integer>
45+
</dict>
46+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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>swift-ascollectionnode-delegate</string>
7+
<key>IDECodeSnippetCompletionScopes</key>
8+
<array>
9+
<string>CodeBlock</string>
10+
</array>
11+
<key>IDECodeSnippetContents</key>
12+
<string> //MARK: - ASCollectionDelegate
13+
override func collectionNode(_ collectionNode: ASCollectionNode, didSelectItemAt indexPath: IndexPath) {
14+
guard indexPath.row &lt; &lt;#data#&gt;.count else { return }
15+
//delegate?.cellCollection(didSelect: posts[indexPath.row], at: indexPath)
16+
}</string>
17+
<key>IDECodeSnippetIdentifier</key>
18+
<string>D201947A-D127-4B2F-B4F7-4518A034F07D</string>
19+
<key>IDECodeSnippetLanguage</key>
20+
<string>Xcode.SourceCodeLanguage.Swift</string>
21+
<key>IDECodeSnippetPlatformFamily</key>
22+
<string>iphoneos</string>
23+
<key>IDECodeSnippetTitle</key>
24+
<string>ASCollectionNodeDelegate</string>
25+
<key>IDECodeSnippetUserSnippet</key>
26+
<true/>
27+
<key>IDECodeSnippetVersion</key>
28+
<integer>0</integer>
29+
</dict>
30+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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>swift-asdisplaynode-lifecycle</string>
7+
<key>IDECodeSnippetCompletionScopes</key>
8+
<array>
9+
<string>ClassImplementation</string>
10+
</array>
11+
<key>IDECodeSnippetContents</key>
12+
<string> //MARK: - vars
13+
14+
//MARK: - subnodes
15+
16+
//MARK: - constants
17+
fileprivate struct localConstants {
18+
static let insets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
19+
}
20+
21+
//MARK: - init
22+
override init() {
23+
super.init()
24+
initialSetup()
25+
}
26+
27+
//MARK: - ASDisplayNode override
28+
override func didLoad() {
29+
super.didLoad()
30+
setupView()
31+
}
32+
33+
override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -&gt; ASLayoutSpec {
34+
return ASInsetLayoutSpec(insets: localConstants.insets, child: &lt;#node#&gt;)
35+
}
36+
37+
//MARK: - private methods
38+
private func initialSetup() {
39+
automaticallyManagesSubnodes = true
40+
}
41+
42+
private func setupView() {
43+
//backgroundColor = UIColor.white
44+
}
45+
46+
</string>
47+
<key>IDECodeSnippetIdentifier</key>
48+
<string>A6DF07C7-B8BA-427E-AA74-F111DB71AC91</string>
49+
<key>IDECodeSnippetLanguage</key>
50+
<string>Xcode.SourceCodeLanguage.Swift</string>
51+
<key>IDECodeSnippetPlatformFamily</key>
52+
<string>iphoneos</string>
53+
<key>IDECodeSnippetTitle</key>
54+
<string>ASDisplayNode setup</string>
55+
<key>IDECodeSnippetUserSnippet</key>
56+
<true/>
57+
<key>IDECodeSnippetVersion</key>
58+
<integer>0</integer>
59+
</dict>
60+
</plist>

swift/comment-func.codesnippet

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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>swift-comment-func</string>
7+
<key>IDECodeSnippetCompletionScopes</key>
8+
<array>
9+
<string>ClassImplementation</string>
10+
</array>
11+
<key>IDECodeSnippetContents</key>
12+
<string> /**
13+
&lt;# description #&gt;
14+
- parameter &lt;#param#&gt;:
15+
- return &lt;#retValue#&gt;:
16+
*/
17+
</string>
18+
<key>IDECodeSnippetIdentifier</key>
19+
<string>6874C8C2-01CA-4857-BF28-9423958469EA</string>
20+
<key>IDECodeSnippetLanguage</key>
21+
<string>Xcode.SourceCodeLanguage.Swift</string>
22+
<key>IDECodeSnippetTitle</key>
23+
<string>Comment Snippet - func</string>
24+
<key>IDECodeSnippetUserSnippet</key>
25+
<true/>
26+
<key>IDECodeSnippetVersion</key>
27+
<integer>0</integer>
28+
</dict>
29+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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>swift-vc-lifecycle</string>
7+
<key>IDECodeSnippetCompletionScopes</key>
8+
<array>
9+
<string>ClassImplementation</string>
10+
</array>
11+
<key>IDECodeSnippetContents</key>
12+
<string> //MARK - UIViewController life cycle
13+
override func viewDidLoad() {
14+
super.viewDidLoad()
15+
}
16+
17+
override func viewWillAppear(_ animated: Bool) {
18+
super.viewWillAppear(animated)
19+
//navigationController?.setNavigationBarType(.white(showSeparator: true))
20+
}
21+
22+
override func viewWillDisappear(_ animated: Bool) {
23+
super.viewWillDisappear(animated)
24+
}
25+
26+
override func viewDidAppear(_ animated: Bool) {
27+
super.viewDidAppear(animated)
28+
}
29+
</string>
30+
<key>IDECodeSnippetIdentifier</key>
31+
<string>914B1355-18E8-49DC-B2E2-300C7C4A84C3</string>
32+
<key>IDECodeSnippetLanguage</key>
33+
<string>Xcode.SourceCodeLanguage.Swift</string>
34+
<key>IDECodeSnippetPlatformFamily</key>
35+
<string>iphoneos</string>
36+
<key>IDECodeSnippetTitle</key>
37+
<string>UIViewController life cycle</string>
38+
<key>IDECodeSnippetUserSnippet</key>
39+
<true/>
40+
<key>IDECodeSnippetVersion</key>
41+
<integer>0</integer>
42+
</dict>
43+
</plist>

0 commit comments

Comments
 (0)