Last active
June 22, 2016 11:49
-
-
Save naokits/6f8f4faf6256856edb5307d551d796b8 to your computer and use it in GitHub Desktop.
IBM Swift Sandboxでサードパーティのパッケージを使用する簡単な方法 ref: http://qiita.com/naokits/items/ff34d0ab0c7962828eef
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
├── .swift-version | |
├── Package.swift | |
└── Sources | |
└── main.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEVELOPMENT-SNAPSHOT-2016-05-09-a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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