Skip to content

Instantly share code, notes, and snippets.

import SwiftUI
import JunoSlider
struct ContentView: View {
@State var sliderValue: CGFloat = 0.5
@State var isSliderActive = false
var body: some View {
VStack {
Image(systemName: "globe")
import SwiftUI
struct BottomSheet: View {
@State private var showSheet = false
@State private var scrollToId = 0
@State private var listView = true
import SwiftUI
struct SearchableStudy: View {
// !! Searchable searchCompletion() seems to have problem
// handling terms with common prefix like "Josh" and "Joshee"
// Try enter "Jos" and tap the "Josh" entery, it doesn't show
// the "Josh" entry. It show "Joshee" completion.
let names = ["Hellen", "Holly", "Josh", "Joshee", "Rhonda", "Ted"]
@State private var searchText = ""
//
// BricsLogo.swift
// iOS17-New-Beginning
//
// Created by Matthew Young on 10/22/23.
//
import SwiftUI
extension ShapeStyle where Self == LinearGradient {
//
// AnimatedSpeakerVolumeWaveSlash.swift
// iOS17-New-Beginning
//
// Created by Matthew Young on 10/12/23.
//
import SwiftUI
struct SpeakerVolumeView: View {
@mattyoung
mattyoung / RubberBandSwitch.swift
Last active October 13, 2023 04:02 — forked from alikaragoz/RubberBandSwitch.swift
iOS Control Center Rubber Band Swift
import SwiftUI
// had to move this out here due to RubberBandSwitch is now generic
enum Const {
static let shapeSize: CGSize = .init(width: 90.0, height: 190.0)
static let cornerRadius: CGFloat = 26.0
}
struct RubberBandSwitch<Icon: View>: View {
@mattyoung
mattyoung / RainbowDashlineAnimation.swift
Created October 5, 2023 20:18
RainbowDashlineAnimation.swift
//
// Created by Matthew Young on 10/4/23.
//
import SwiftUI
struct MatchedInnerOuterCornerRadius: View {
@State private var phase = Double.zero
var body: some View {
import SwiftUI
import ComposableArchitecture
struct CounterFeature: Reducer {
struct State: Equatable {
var count = 99
var numberFactAlert: String?
}
enum Action: Equatable {
import SwiftUI
struct SensoryFeedback: View {
@State private var count = 0
var body: some View {
VStack {
Text(verbatim: "\(count)")
.font(.largeTitle)
.contentTransition(.numericText(value: Double(count)))
//
// AnimatedSlashSpeakerDemo.swift
// SwiftUITestingProject
//
// Created by Matthew on 12/25/19.
// Copyright © 2019 Matthew. All rights reserved.
//
// Speaker animated slash and sound waves