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
| let notification = UILocalNotification() | |
| notification.alertAction = "推播滑動的動作名稱" | |
| notification.alertBody = "推播的內容" | |
| notification.alertTitle = "推播的標題" | |
| notification.soundName = UILocalNotificationDefaultSoundName | |
| // 觸發條件以使用者的位置為主 | |
| let region = CLCircularRegion(center: center, radius: radius, identifier: ID) | |
| // 可以設定當使用者進入或離開區域的時候,是否要跳出通知 | |
| region.notifyOnExit = false | |
| region.notifyOnEntry = true |
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
| cryptography | |
| pyjwt | |
| hyper |
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
| from apns import ApnsPusher | |
| ApnsPusher().push("Test Title", "Test Body", "device token", False) |
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 applePay() { | |
| let request = PKPaymentRequest() | |
| request.merchantIdentifier = "merchant.tw.archie" | |
| request.merchantCapabilities = .capability3DS | |
| request.countryCode = "US" | |
| request.currencyCode = "USD" | |
| request.supportedNetworks = [.visa] | |
| request.paymentSummaryItems = [PKPaymentSummaryItem.init(label: "Archie's shake hand", amount: 2000, type: .final)] | |
| request.shippingType = .storePickup | |
| let contact = PKContact() |
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
| if a == 1 { | |
| print("a 等於 1") | |
| } else { | |
| print("a 不等於 1") | |
| } |
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
| public func ALogDebug(_ string: Any, file: String = #file, line: Int = #line) { | |
| print("📒 \(file.components(separatedBy: "/").last ?? "")[\(line)]: \(string)") | |
| } | |
| public func ALogWarn(_ string: Any, file: String = #file, line: Int = #line) { | |
| print("⚠️ \(file.components(separatedBy: "/").last ?? "")[\(line)]: \(string)") | |
| } | |
| public func ALogInfo(_ string: Any, file: String = #file, line: Int = #line) { | |
| print("ℹ️ \(file.components(separatedBy: "/").last ?? "")[\(line)]: \(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
| Host github.com-Apple | |
| HostName github.com | |
| User git | |
| IdentityFile ~/.ssh/Archie_Apple | |
| Host github.com | |
| HostName github.com | |
| User git | |
| IdentityFile ~/.ssh/github |
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 CocoaAsyncSocket | |
| let socket = GCDAsyncSocket(delegate: <#T##GCDAsyncSocketDelegate?#>, delegateQueue: <#T##DispatchQueue?#>) | |
| do { | |
| try socket.connect(toHost: Host, onPort: Port) | |
| } catch { | |
| print(error) | |
| } | |
| // GCDAsyncSocketDelegate |
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
| // | |
| // RxCocoaAsyncSocket.swift | |
| // | |
| // Created by 家齊 on 2017/7/14. | |
| // Copyright © 2017年 張家齊. All rights reserved. | |
| // | |
| import Foundation | |
| import RxSwift | |
| import RxCocoa |