Skip to content

Instantly share code, notes, and snippets.

View Roshankumar350's full-sized avatar
🎯
Focusing

Roshan Kumar Sah Roshankumar350

🎯
Focusing
View GitHub Profile
@neilsmithdesign
neilsmithdesign / swift-ui-protocol-view-models.swift
Last active June 18, 2024 15:24
SwiftUI views with protocol interfaces to view models.
import SwiftUI
/// View model protocol
protocol ViewModel: ObservableObject {
var count: Int { get }
func increase()
}
/// Concrete implementation
class MyViewModel: ViewModel {