onAppear does not fire properly on iOS 14 due to a longstanding bug in SwiftUI. Add a UIKit onAppear hook for listening to these events and implement inside the backport namespace. Signed-off-by: kingbri <bdashore3@proton.me>
17 lines
322 B
Swift
17 lines
322 B
Swift
//
|
|
// ViewDidAppearModifier.swift
|
|
// Ferrite
|
|
//
|
|
// Created by Brian Dashore on 2/8/23.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ViewDidAppearModifier: ViewModifier {
|
|
let callback: () -> Void
|
|
|
|
func body(content: Content) -> some View {
|
|
content
|
|
.background(ViewDidAppearHandler(callback: callback))
|
|
}
|
|
}
|