Home > AI > IOS > SwiftUI >

eraseToAnyView

View+Ext.swift

it will erase the view type to AnyView.

import Foundation
import SwiftUI


extension View {
    func eraseToAnyView() -> AnyView {
        return AnyView(self)
    }
}

Leave a Reply