Skip to content
View alfavata's full-sized avatar
https://ohme-ev.com/job-postings/
https://ohme-ev.com/job-postings/

Block or report alfavata

Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned Loading

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