SwiftyXML
SwiftyXML use most swifty way to deal with XML data.
Features
- [x] Infinity subscript
- [x] dynamicMemberLookup Support (use $ started string to subscript attribute)
- [x] Optional | Non-optional value access
- [x] Directly access Enum type value (enums extends from RawRepresentable)
- [x] Directly for loop in XML children nodes
- [x] Accurate error throwing
- [x] XML construct, formatting
- [x] Single source file
Sample XML:
With SwiftyXML all you have to do is:
This is same as below, SwiftyXML will auto pick the first element as default:
What about if you input some wrong keys:
Requirements
- iOS 8.0+ | macOS 10.10+ | tvOS 9.0+ | watchOS 2.0+
- Xcode 8
Installation
CocoaPods
You can use CocoaPods to install SwiftyXML
by adding it to your Podfile
:
Carthage
Create a Cartfile
that lists the framework and run carthage update
. Follow the instructions to add $(SRCROOT)/Carthage/Build/iOS/SwiftyXML.framework
to an iOS project.
github "chenyunguiMilook/SwiftyXML" ~> 3.0.0
Manually
- Download and drop
XML.swift
into your project. - Congratulations!
Swift Package Manager
You can use The Swift Package Manager to install SwiftyXML
by adding the proper description to your Package.swift
file: