This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <flights> | |
| <flight> | |
| <flight_id>{6A49933F-7FD3-44F1-9278-78E0509B41C0}</flight_id> | |
| <airline_rcd>MM</airline_rcd> | |
| <flight_number>1028</flight_number> | |
| <origin_rcd>TPE</origin_rcd> | |
| <destination_rcd>HND</destination_rcd> | |
| <fare_id>{35C514B6-FFBB-49FC-96F7-1B25FCDA26CA}</fare_id> | |
| <transit_airline_rcd /> |
This file contains hidden or 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
| radioRoundTrip : RoundTrip | |
| radioOneWay : OneWay | |
| promoCode : | |
| selOriginPicker : 台北 (TPE) | |
| selOrigin : TPE | |
| selDestPicker : 東京(成田及羽田機場) | |
| selDest : XX1 | |
| dateDepart : 18 Oct 2016 | |
| dateReturn : 22 Oct 2016 | |
| TT_TripKind : return |
This file contains hidden or 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
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| // This is for dmoe, you can use a generice type to limit your observer to an UIViewController for common usage. | |
| protocol Notifiable { | |
| var name: Notification.Name { get } | |
| func observe(by observer: Any, withSelector selector: Selector, object: Any?) | |
| func post(object: Any? ,userInfo: [AnyHashable: Any]?) | |
| static func remove(observer: Any) |
This file contains hidden or 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
| // | |
| // BorderDesignable.swift | |
| // Gotyou | |
| // | |
| // Created by 默司 on 2016/11/28. | |
| // Copyright © 2016年 默司. All rights reserved. | |
| // | |
| import Foundation | |
| import UIKit |
This file contains hidden or 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
| // | |
| // Deserializable.swift | |
| // MapperDemo | |
| // | |
| // Created by 默司 on 2016/12/1. | |
| // Copyright © 2016年 默司. All rights reserved. | |
| // | |
| import Foundation | |
| import SwiftyJSON |
This file contains hidden or 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 | |
| struct User { | |
| var username: String? | |
| var password: String? | |
| } | |
| extension User { | |
| init(_ node: NodeAccessable) { | |
| self.username = node.child("username").string |
This file contains hidden or 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
| // | |
| // NSObject.swift | |
| // QBDemo01 | |
| // | |
| // Created by 默司 on 2016/12/2. | |
| // Copyright © 2016年 默司. All rights reserved. | |
| // | |
| import Foundation |
This file contains hidden or 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
| // | |
| // CropperView.swift | |
| // Gotyou | |
| // | |
| // Created by 默司 on 2016/12/15. | |
| // Copyright © 2016年 默司. All rights reserved. | |
| // | |
| import UIKit |
This file contains hidden or 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 UIKit | |
| struct FilmFestival { | |
| var Name: String = "" | |
| var FormattedPrice: Int = 0 | |
| } | |
| struct Ticketing { | |
| var Name: String = "" | |
| var FormattedPrice: Int = 0 |
This file contains hidden or 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
| func requestSync(_ path: String, method: HttpMethod = .get, parameters: [String: Any]? = nil, localizedStatus: String? = nil) -> JSON? { | |
| var out: JSON? | |
| let semaphore = DispatchSemaphore(value: 0) | |
| self.request(_ path, method: method, parameters: parameters, localizedStatus: localizedStatus) { (json) in | |
| out = json | |
| semaphore.signal() | |
| } |