Skip to content

Instantly share code, notes, and snippets.

import SwiftUI
struct SideMenu: View {
@Binding var selected: Int
var options: [String]
var body: some View {
GeometryReader { geo in
HStack {
@jboullianne
jboullianne / ProductCard.swift
Last active February 13, 2023 11:45
SwiftUI Card designed for Food Products
//
// ProductCard.swift
// FoodProductCard
//
// Created by Jean-Marc Boullianne on 11/17/19.
// Copyright © 2019 Jean-Marc Boullianne. All rights reserved.
//
import SwiftUI
@jboullianne
jboullianne / STSegmentedView.swift
Created July 8, 2019 21:43
Custom UISegmentedControl with Icons and Animations
//
// STSegmentedView.swift
//
//
// Created by Jean-Marc Boullianne on 6/16/19.
// Copyright © 2019 Jean-Marc Boullianne. All rights reserved.
//
import UIKit
@jboullianne
jboullianne / swift_design_patterns_singleton.swift
Created May 9, 2019 01:34
Singleton Design Pattern in Swift
// Singleton Design Pattern Example
// Author: Jean-Marc Boullianne
class Singleton {
static let instance = Singleton()
private init() {
// Initialize class variable here
}
@jboullianne
jboullianne / swift_design_patterns_observer.swift
Last active May 11, 2019 20:53
Observer Design Pattern in Swift
// Observer pattern in Swift
// Author: Jean-Marc Boullianne
class Subject<T> {
var val:T {
didSet {
notifyObservers()
}
}