david-swift 8eeda083e9
All checks were successful
Deploy Docs / publish (push) Successful in 18m28s
SwiftLint / SwiftLint (push) Successful in 5s
Separate AnyView extensions from widgets
2024-10-16 14:22:34 +02:00

25 lines
615 B
Swift

//
// ViewStorage.swift
// Adwaita
//
// Created by david-swift on 01.08.24.
//
extension ViewStorage {
/// Modify the view.
/// - Parameter modify: The modification function.
public func modify(_ modify: (OpaquePointer?) -> Void) {
modify(opaquePointer)
}
/// Convert the pointer to a pointer of a certain type and modify the view.
/// - Parameters:
/// - type: The pointer's type.
/// - modify: The modification function.
public func modify<T>(_ type: T.Type, _ modify: (UnsafeMutablePointer<T>?) -> Void) {
modify(opaquePointer?.cast())
}
}