Skip to content

Instantly share code, notes, and snippets.

View VAndrJ's full-sized avatar

VAndrJ VAndrJ

  • Ukraine
  • 03:50 (UTC +02:00)
View GitHub Profile
@VAndrJ
VAndrJ / SplitMRE.swift
Created October 31, 2024 19:46
NavigationSplitView issue MRE.
import SwiftUI
@main
struct SplitMREApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
@VAndrJ
VAndrJ / InteractiveDismissMRE.swift
Created November 6, 2024 15:43
interactiveDismissDisabled issue.
import SwiftUI
struct ContentView: View {
@State private var isSheetPresented = false
var body: some View {
NavigationStack {
Button("Present sheet") {
isSheetPresented = true
}
@VAndrJ
VAndrJ / NavigationStackRootMREApp.swift
Last active November 18, 2024 17:02
NavigationStack path clear issue on iOS 18.0+
import SwiftUI
@main
struct TestNavigationSearchApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
@VAndrJ
VAndrJ / NavigationStackDestinationMRE.swift
Created November 22, 2024 08:01
isPresented navigationDestionation NavigationStack iOS 16 issue.
import SwiftUI
@main
struct NavigationStackIsPresentedMREApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
@VAndrJ
VAndrJ / SingletonActorMRE.swift
Created December 5, 2024 16:12
Swift 6 actor deinit issue.
import SwiftUI
struct ContentView: View {
var body: some View {
Button("increment") {
Task {
await CountActor.shared.increment()
}
}
}
@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)
@VAndrJ
VAndrJ / ObservableMRE.swift
Created December 19, 2024 15:20
Observable class naming issue.
import SwiftUI
import Observation
struct ContentView: View {
@State var member = Member(name: "Swift")
var body: some View {
VStack(spacing: 24) {
Text("\(member.name)")
Text("\(member.subscription ? "Member" : "Guest")")
@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 / 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 / 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)