Skip to content

Commit

Permalink
first (#1)
Browse files Browse the repository at this point in the history
* travis

* xcode_sdk

* README
  • Loading branch information
uny authored Jan 1, 2018
1 parent 5da1d32 commit 0d9638a
Show file tree
Hide file tree
Showing 10 changed files with 2,242 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: swift
osx_image: xcode9.2
xcode_project: XMLDecoder.xcodeproj
xcode_scheme: XMLDecoder
xcode_sdk: iphonesimulator
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,40 @@
# XMLDecoder
XMLDecoder for Swift

[![Build Status](https://travis-ci.org/uny/XMLDecoder.svg?branch=feature%2Ffirst)](https://travis-ci.org/uny/XMLDecoder)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

XMLDecoder for Swift.

## Requirements

- iOS 8.0+
- Xcode 9.0+
- Swift 4.0+

## Installation

### Carthage

To integrate XMLDecoder into your Xcode project using Carthage, specify it in your `Cartfile`:
```
github "uny/XMLDecoder"
```

## Usage
You can use XMLDecoder like JSONDecoder:
```swift
struct Object {
let string: String
let int: Int
}

let data = "<root><string>string</string><int>100</int></root>".data(using: .utf8)!
let decoder = XMLDecoder()
do {
let object = try decoder.decode(Object.self, from: data)
print(object)
} catch let error {
// ...
}
```
XMLDecoder currently does not support attributes.
24 changes: 24 additions & 0 deletions Sources/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
18 changes: 18 additions & 0 deletions Sources/XMLDecoder.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// XMLDecoder.h
// XMLDecoder
//
// Created by Yuki Nagai on 2017/12/17.
//

#import <UIKit/UIKit.h>

//! Project version number for XMLDecoder.
FOUNDATION_EXPORT double XMLDecoderVersionNumber;

//! Project version string for XMLDecoder.
FOUNDATION_EXPORT const unsigned char XMLDecoderVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <XMLDecoder/PublicHeader.h>


Loading

0 comments on commit 0d9638a

Please sign in to comment.