| Protection Domain (pdmn) | Keychain Accessibility Values |
|---|---|
ck |
kSecAttrAccessibleAfterFirstUnlock |
cku |
kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly |
dk |
kSecAttrAccessibleAlways |
akpu |
kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly |
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
| language: objective-c | |
| osx_image: xcode7.2 | |
| xcode_sdk: iphonesimulator9.2 | |
| env: | |
| global: | |
| - LANG=en_US.UTF-8 | |
| - WORKSPACE="YOUR_APP_WORKSPACE/YOUR_APP_PROJECT.xcworkspace" | |
| - SCHEME="YOUR_BUILDSCHEME" | |
| - APP_NAME="YOUR_APP_NAME" |
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
| sudo apt-get update | |
| sudo apt-get install lua5.1 alsa-utils triggerhappy curl libcurl3 | |
| wget http://archive.raspberrypi.org/debian/pool/main/r/raspi-config/raspi-config_20160322_all.deb | |
| wget http://archive.raspberrypi.org/debian/pool/main/r/rpi-update/rpi-update_20140705_all.deb | |
| dpkg -i raspi-config_20160322_all.deb | |
| dpkg -i rpi-update_20140705_all.deb |
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 doGetWithBasicAuthCredential() -> Void { | |
| let username = "myUsername" | |
| let password = "myPassword" | |
| let credential = NSURLCredential(user: username, password: password, persistence: NSURLCredentialPersistence.ForSession) | |
| Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(username)/\(password)") | |
| .authenticate(usingCredential: credential) | |
| .responseString { _, _, result in | |
| if let receivedString = result.value |
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 | |
| import CFNetwork | |
| public class FTPUpload { | |
| fileprivate let ftpBaseUrl: String | |
| fileprivate let directoryPath: String | |
| fileprivate let username: String | |
| fileprivate let password: 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
| // For details, see | |
| // http://stackoverflow.com/questions/40261857/remove-nested-key-from-dictionary | |
| import Foundation | |
| extension Dictionary { | |
| subscript(keyPath keyPath: String) -> Any? { | |
| get { | |
| guard let keyPath = Dictionary.keyPathKeys(forKeyPath: keyPath) | |
| else { return nil } | |
| return getValue(forKeyPath: keyPath) |
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
| // | |
| // Obfuscator.swift | |
| // | |
| // Created by Dejan Atanasov on 2017-05-31. | |
| // | |
| import Foundation | |
| class Obfuscator: AnyObject { | |
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 | |
| class MyService: NSObject, MyServiceProtocol { | |
| func upperCaseString(_ string: String, withReply reply: @escaping (String) -> Void) { | |
| let response = string.uppercased() | |
| reply(response) | |
| } | |
| } |
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
| // Based on https://code.tutsplus.com/articles/securing-communications-on-ios--cms-28529 | |
| import Foundation | |
| import Security | |
| struct Certificate { | |
| let certificate: SecCertificate | |
| let data: Data | |
| } |
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 makeGetCall() { | |
| // Set up the URL request | |
| let todoEndpoint: String = "https://jsonplaceholder.typicode.com/todos/1" | |
| guard let url = URL(string: todoEndpoint) else { | |
| print("Error: cannot create URL") | |
| return | |
| } | |
| let urlRequest = URLRequest(url: url) | |
| // set up the session |