Skip to content

Instantly share code, notes, and snippets.

@naokits
Last active June 22, 2016 11:49
Show Gist options
  • Save naokits/6f8f4faf6256856edb5307d551d796b8 to your computer and use it in GitHub Desktop.
Save naokits/6f8f4faf6256856edb5307d551d796b8 to your computer and use it in GitHub Desktop.
IBM Swift Sandboxでサードパーティのパッケージを使用する簡単な方法 ref: http://qiita.com/naokits/items/ff34d0ab0c7962828eef
├── .swift-version
├── Package.swift
└── Sources
└── main.swift
DEVELOPMENT-SNAPSHOT-2016-05-09-a
import PackageDescription
let package = Package(
name: "examples-for-ibm-swift-sandbox",
dependencies: [
.Package(url: "https://github.com/IBM-Swift/SwiftyJSON.git", majorVersion: 8),
.Package(url: "https://github.com/IBM-Swift/BlueCryptor.git", majorVersion: 0, minor: 2),
.Package(url: "https://github.com/IBM-Swift/HeliumLogger.git", majorVersion: 0, minor: 9)
]
import Foundation
import SwiftyJSON
func JSONExample() {
let json = JSON(["name":"naokits", "age": 50])
if let name = json["name"].string {
print(name)
}
if let age = json["age"].int {
print(age)
}
}
JSONExample()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment