Skip to content

Instantly share code, notes, and snippets.

import AVFoundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
extension AVPlayerItemStatus {
var description: String {
switch self {
case .failed:
return "Failed"
@B-Lach
B-Lach / NetworkManager.swift
Created November 13, 2016 19:56
Public Key Pinning Example
struct Constants {
static let resource = "certificate"
static let type = "der"
}
// https://infinum.co/the-capsized-eight/articles/how-to-make-your-ios-apps-more-secure-with-ssl-pinning
extension NetworkManager: URLSessionDelegate {
func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {