Skip to content

Instantly share code, notes, and snippets.

@igorzhukov
igorzhukov / Stack.swift
Last active February 22, 2023 13:05
Stack in #swift
public struct Stack<Element> {
private var storage: [Element] = []
public init() { }
public init(_ elements: [Element]) {
storage = elements
}
@igorzhukov
igorzhukov / UIKitWrapper.swift
Last active February 22, 2023 11:34
Wrapper for embedding UIKit UIView in SwiftUI
import Foundation
import SwiftUI
struct UIKitWrapper<Type: UIView>: UIViewRepresentable {
let configuration: ((Type) -> Void)
func makeUIView(context: UIViewRepresentableContext<Self>) -> Type {
return Type()
}