Pinned Loading
-
Encryption.swift
Encryption.swift 1func encrypt(_ text: String) -> String? {
2guard
3let bundle = Bundle(identifier: "com.example.bundle.identifier"),
4let url = bundle.url(forResource: "certificate", withExtension: "der"),
5let certData = try? Data(contentsOf: url),
-
Failable Codable initialiser for Raw...
Failable Codable initialiser for RawRepresentable types 1extension RawRepresentable where RawValue: Decodable {
2init?(from decoder: Decoder) throws {
3self.init(rawValue: try decoder.singleValueContainer().decode(RawValue.self))
4}
5}
-
Protocols, inheritance, default impl...
Protocols, inheritance, default implementations, and optional methods 1import Foundation
23protocol P {
4var required: String { get }
5}
-
Codable doesn't play nicely with sub...
Codable doesn't play nicely with subclasses 1import Foundation
23class C: Codable {
4var p: String?
5}
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.