Skip to content

Instantly share code, notes, and snippets.

View divyeshmakwana96's full-sized avatar

Divyesh Makwana divyeshmakwana96

View GitHub Profile
import Foundation
public enum SafeCodableEnum<Nested: RawRepresentable & Codable> where Nested.RawValue: Codable {
case defined(Nested)
case other(Nested.RawValue)
}
extension SafeCodableEnum: RawRepresentable {
@MaximKotliar
MaximKotliar / AVPlayerDelegate.swift
Last active January 16, 2025 11:37
A easier way to handle AVPlayer's events
// AVPlayerDelegate.swift
//
// Created by Maxim Kotliar on 7/30/18.
//
import AVFoundation
@objc protocol AVPlayerDelegate: class {
@objc optional func playerDidStartPlayback()
@objc optional func playerDidPausePlayback()