Skip to content
View alfavata's full-sized avatar

Block or report alfavata

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
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
    }