Skip to content

Instantly share code, notes, and snippets.

@jboullianne
jboullianne / AlignmentControl.swift
Created August 28, 2020 22:40
Text Alignment Control made in SwiftUI
//
// AlignmentControl.swift
// MicroAnimations_Test
//
// Created by Jean-Marc Boullianne on 8/18/20.
//
import SwiftUI
struct AlignmentControl: View {
@jboullianne
jboullianne / ScrollingHStackModifier.swift
Last active March 22, 2023 05:31
Implement Snap to Item scrolling in SwiftUI using this custom ViewModifier technique.
/
// ScrollingStackModifier.swift
// ScrollView_Tests
//
// Created by Jean-Marc Boullianne on 8/7/20.
//
import SwiftUI
struct ScrollingHStackModifier: ViewModifier {
@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 / ImageToggleStyle.swift
Created August 18, 2020 02:21
Custom SwiftUI ToggleStyle - Image Toggle
import SwiftUI
struct ImageToggleStyle: ToggleStyle {
var onImageName: String
var offImageName: String
func makeBody(configuration: Configuration) -> some View {
HStack {
configuration.label
@jboullianne
jboullianne / CheckmarkToggleStyle.swift
Created August 18, 2020 02:19
Custom SwiftUI ToggleStyle - Checkmark
import SwiftUI
struct CheckmarkToggleStyle: ToggleStyle {
func makeBody(configuration: Configuration) -> some View {
HStack {
configuration.label
Spacer()
Rectangle()
.foregroundColor(configuration.isOn ? .green : .gray)
//
// ContentView.swift
// ScrollView_Tests
//
// Created by Jean-Marc Boullianne on 7/30/20.
//
import SwiftUI
struct ContentView: View {
@jboullianne
jboullianne / SlidingSheetModifier.swift
Created September 17, 2020 02:58
SwiftUI Custom Sliding Sheet
//
// SheetBase.swift
// PopoverSheet_Tests
//
// Created by Jean-Marc Boullianne on 9/13/20.
// Copyright © 2020 TrailingClosure. All rights reserved.
//
import SwiftUI
@jboullianne
jboullianne / PowerToggleStyle.swift
Created August 18, 2020 02:20
Custom SwiftUI ToggleStyle - Power Button
import SwiftUI
struct PowerToggleStyle: ToggleStyle {
func makeBody(configuration: Configuration) -> some View {
HStack {
configuration.label
Spacer()
Rectangle()
.foregroundColor(configuration.isOn ? .green : .gray)
@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
//
// SideMenuTest.swift
// CardEffectsTest
//
// Created by Jean-Marc Boullianne on 7/3/20.
//
import SwiftUI
struct SideMenuTest: View {