Skip to content

Instantly share code, notes, and snippets.

import SwiftUI
import CallKit
class IncomingCallViewController: UIViewController, CXProviderDelegate {
func providerDidReset(_ provider: CXProvider) {
}
override func viewDidLoad() {
super.viewDidLoad()
@GJNilsen
GJNilsen / FlatButton.swift
Last active May 14, 2023 15:24
Subclass of NSButton
import AppKit
public class FlatButton: NSButton {
public var buttonColor: NSColor = NSColor(calibratedRed: 0.201, green: 0.404, blue: 0.192, alpha: 1)
public var onClickColor: NSColor = NSColor(calibratedRed: 0.304, green: 0.601, blue: 0.294, alpha: 1)
public var textColor: NSColor = NSColor.white
public override func draw(_ dirtyRect: NSRect) {
super.draw(dirtyRect)
@powhu
powhu / GIF2MP4.swift
Last active December 28, 2023 22:41
Swift 5.0 GIF to MP4
//
// GIF2MP4.swift
//
// Created by PowHu Yang on 2020/4/24.
// Copyright © 2020 PowHu Yang. All rights reserved.
//
/* How to use
let data = try! Data(contentsOf: Bundle.main.url(forResource: "gif", withExtension: "gif")!)
let tempUrl = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("temp.mp4")
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 27, 2024 10:54
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S