Skip to content

Instantly share code, notes, and snippets.

@scott-lydon
Created November 2, 2023 11:12
Show Gist options
  • Save scott-lydon/6355c7ce8e46a67f8010d712990aeebc to your computer and use it in GitHub Desktop.
Save scott-lydon/6355c7ce8e46a67f8010d712990aeebc to your computer and use it in GitHub Desktop.
// No Model in names
/*
throw an error when a class or struct is added that doesn't
use the word model in the name, and isn't a subclass of a
UIViewController, nor UIView, nor view, uiviewRepresentable,
codable or observer.
*/
import UIKit
protocol UIVeeiw {}
protocol Bently {}
protocol Observer {}
// Throw an error for the cases below
class Lady: UIVeeiw {}
struct Boss {}
class Verity: Bently {}
// Do not throw an error for the cases below.
struct Cat: Codable {}
class Terble: UIViewController {}
struct MugView {}
struct TeaModel {}
struct Melimodel {}
class Icon: Observer {}
import SwiftUI
struct Cow: View {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment