Skip to content

Instantly share code, notes, and snippets.

View VAndrJ's full-sized avatar

VAndrJ VAndrJ

  • Ukraine
  • 02:29 (UTC +03:00)
View GitHub Profile
@VAndrJ
VAndrJ / AlertDisabledButtonMRE.swift
Created April 29, 2025 09:07
MRE to check how TextField and disabled Button works with alert on different iOS versions.
//
// MRE.swift
//
// Created by VAndrJ on 4/29/25.
//
import SwiftUI
struct ContentView: View {
@State private var isAlertPresented = false
@VAndrJ
VAndrJ / ContentView.swift
Created April 18, 2025 06:40
Environment values example.
//
// ContentView.swift
// EnvironmentExample
//
// Created by VAndrJ on 4/18/25.
//
import SwiftUI
enum Destination {
@VAndrJ
VAndrJ / TypedThrowsCrashMRE.swift
Created January 28, 2025 18:16
Typed throws issue in iOS lower 18
import SwiftUI
struct ContentView: View {
@StateObject private var someClass = SomeClass(someInjectedFunction: { _ in })
var body: some View {
Text("Example")
}
}
@VAndrJ
VAndrJ / SheetDetentsMRE.swift
Created January 28, 2025 10:50
Sheet presentation detents iOS 18.0+ issue
import SwiftUI
struct ContentView: View {
@State private var isSheetPresented = false
var body: some View {
Button("Open Sheet") {
isSheetPresented = true
}
.sheet(isPresented: $isSheetPresented) {
@VAndrJ
VAndrJ / SearchableRefreshableMRE.swift
Created January 14, 2025 15:38
.searchable + .refreshable with ScrollView memory leak issue iOS 17.3+
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationStack {
NavigationLink("Next") {
TestView()
}
}
}
@VAndrJ
VAndrJ / DraggableMRE.swift
Created January 8, 2025 11:11
iOS 18.0 visual issue.
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Text("Drag me")
.font(.largeTitle)
.padding()
.frame(maxWidth: .infinity, idealHeight: 200)
.border(.blue)
@VAndrJ
VAndrJ / SceneDelegate.swift
Last active January 3, 2025 08:40
UINavigationController pushViewController iOS 18.0+ optimization(issue?) example.
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(
_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
@VAndrJ
VAndrJ / ButtonActionScrollMRE.swift
Last active January 4, 2025 12:06
Issue on iOS 18.0+ with Xcode 16.0+
import SwiftUI
struct ContentView: View {
@State private var isSheetPresented = false
var body: some View {
Button("Open sheet") {
isSheetPresented = true
}
.sheet(isPresented: $isSheetPresented) {
@VAndrJ
VAndrJ / HighPriorityGestureMRE.swift
Last active December 13, 2024 08:28
List scroll issue iOS 18+, Xcode 16+
struct ContentView: View {
@State private var translationWidth = 0.0
var body: some View {
VStack {
List(0...1000, id: \.self) {
Text("\($0)")
}
Text("\(translationWidth)")
.padding(16)