48 lines
1.1 KiB
Swift
48 lines
1.1 KiB
Swift
|
//
|
||
|
// FeedUnavailableView.swift
|
||
|
// Feed
|
||
|
//
|
||
|
// Created by Javier Cicchelli on 22/03/2024.
|
||
|
// Copyright © 2024 Röck+Cöde. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import ReviewsUIKit
|
||
|
import SwiftUI
|
||
|
import UIKit
|
||
|
|
||
|
|
||
|
final class FeedUnavailableView: UIHostingController<UnavailableView> {
|
||
|
|
||
|
// MARK: Initialisers
|
||
|
convenience init(
|
||
|
systemImage: String,
|
||
|
title: String,
|
||
|
description: String,
|
||
|
button: String? = nil,
|
||
|
action: (() -> Void)? = nil
|
||
|
) {
|
||
|
self.init(rootView: .init(
|
||
|
systemImage: systemImage,
|
||
|
title: title,
|
||
|
description: description,
|
||
|
button: button,
|
||
|
action: action
|
||
|
))
|
||
|
}
|
||
|
|
||
|
// MARK: Functions
|
||
|
override func viewSafeAreaInsetsDidChange() {
|
||
|
super.viewSafeAreaInsetsDidChange()
|
||
|
|
||
|
if view.safeAreaInsets.bottom > 0 {
|
||
|
additionalSafeAreaInsets = .init(
|
||
|
top: 0,
|
||
|
left: 0,
|
||
|
bottom: -view.safeAreaInsets.bottom,
|
||
|
right: 0
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|