- Author: Kgen (kgen@catch.la)
- 基于 HTTP
- RESTful
- 采用标准 HTTP Code 返回错误
- 返回格式为 JSON
I've moved this gist to https://github.com/phynet/iOS-Schemes please check it there ;)
| sudo ln -s /usr/local/bin/VBoxManage /usr/bin/VBoxManage |
| 2023.8.28 | |
| 据多名网友回复,此方法已失效。 | |
| 最新解决办法请参考此贴:[v2ex: 请问 github 的两步验证(two-factor authentication)大家是怎么做的?](https://www.v2ex.com/t/967533) | |
| https://www.v2ex.com/t/967533 | |
| --- |
When Swift was first announced, I was gratified to see that one of the (few) philosophies that it shared with Objective-C was that exceptions should not be used for control flow, only for highlighting fatal programming errors at development time.
So it came as a surprise to me when Swift 2 brought (What appeared to be) traditional exception handling to the language.
Similarly surprised were the functional Swift programmers, who had put their faith in the Haskell-style approach to error handling, where every function returns an enum (or monad, if you like) containing either a valid result or an error. This seemed like a natural fit for Swift, so why did Apple instead opt for a solution originally designed for clumsy imperative languages?
I'm going to cover three things in this post:
| http://devstreaming.apple.com/videos/wwdc/2015/217wu453thu1r1/217/217_hd_adopting_new_trackpad_features.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/2267p2ni281ba/226/226_hd_advanced_nsoperations.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/233l9q8hj9mw/233/233_hd_advanced_touch_input_on_ios.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/224o6pqmtb4ik/224/224_hd_app_extension_best_practices.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/2048w4vdjhe1i1m/204/204_hd_apple_watch_accessibility.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/232f1zopzycv/232/232_hd_best_practices_for_progress_reporting.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/213w6grumlfm0q/213/213_hd_building_apps_with_researchkit.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/234reaz1byqc/234/234_hd_building_document_based_apps.mp4?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2015/2313dt427pmq/231/231_hd_cocoa_touch_best_practices.mp4?dl=1 | |
| http://devstreaming.apple.com/vide |
| # Get the already-processed Info.plist, which has our bundleId, etc. | |
| processedInfoPlistFile=$TARGET_BUILD_DIR/$INFOPLIST_PATH | |
| # Copy the bundle identifier from our processed Info.plist | |
| bundleId=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$processedInfoPlistFile") | |
| # Prefix it with "group." to make the application group container id | |
| appGroupContainerId=group.$bundleId | |
| # Get the already-copied Settings.bundle/Root.plist | |
| appPackageFolder=$TARGET_BUILD_DIR/$EXECUTABLE_FOLDER_PATH | |
| copiedSettingsBundlePlistFile=$appPackageFolder/Settings.bundle/Root.plist |
| class ArrayImpl<T> { | |
| var space: Int | |
| var count: Int | |
| var ptr: UnsafeMutablePointer<T> | |
| init(count: Int = 0, ptr: UnsafeMutablePointer<T> = nil) { | |
| self.count = count | |
| self.space = count | |
| func bytes<T: IntegerType>(i: T) -> [UInt8] { | |
| let p = UnsafeMutablePointer<T>.alloc(1) | |
| p.memory = i | |
| let b = unsafeBitCast(p, UnsafePointer<UInt8>.self) | |
| let bytes = reduce(0..<sizeof(T), []) { $0 + [b[$1]] } | |
| p.destroy() | |
| return bytes | |
| } |