Empty
Empty Page
To create your own Empty page, you create a class that implements BaseEmptyComponent.
- Boilerplate
- Full Example
import SwiftUI
import MealziOSSDK
@available(iOS 14, *)
public struct MyCustomEmptyView: EmptyProtocol {
public func content(params: BaseEmptyParameters) -> some View {
// your implementation here
}
}
import SwiftUI
import MealziOSSDK
@available(iOS 14, *)
public struct MyCustomEmptyView: EmptyProtocol {
public init() {}
public func content(params: BaseEmptyParameters) -> some View {
EmptyView()
}
}
with
public struct BaseEmptyParameters {
/// An closure for pages that need to redirect on empty (like empty favorites, myMeals)
public let onOptionalCallback: (() -> Void)?