Skip to content

Instantly share code, notes, and snippets.

@Ben-G
Ben-G / DynamicInit.swift
Last active May 5, 2025 13:33
Dynamically create instance based on type in Swift
protocol Initializable {
init()
}
class A : Initializable {
var content:String
required init() {
content = "TestContent"
}