Skip to content

Commit

Permalink
add sample project
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuhiro4949 committed Oct 22, 2018
1 parent 8d5c12d commit 2105430
Show file tree
Hide file tree
Showing 14 changed files with 669 additions and 23 deletions.
Binary file not shown.
10 changes: 10 additions & 0 deletions SwiftyXMLParser.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
3 changes: 3 additions & 0 deletions iOS Sample/SwiftyXMLParser.playground/Contents.swift
Expand Up @@ -25,6 +25,9 @@ if let text = xml["ResultSet", "Result", "Hit", 0, "Name"].text {
print(text)
}

let texts = xml["ResultSet", "Result", "Hit"].compactMap({ $0.Name.text })
print(texts)

if let text = xml.ResultSet.Result.Hit[0].Name.text {
print(text)
}
Expand Down

0 comments on commit 2105430

Please sign in to comment.