Skip to content

Commit

Permalink
Demo app: Rename SwiftUI demo option name
Browse files Browse the repository at this point in the history
  • Loading branch information
etoledom committed Oct 30, 2024
1 parent c2f8659 commit 28a5bb3
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Demo/Demo/Gravatar-Demo/MainTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ class MainTableViewController: UITableViewController {
guard let row = Row(rawValue: indexPath.row) else { return UITableViewCell() }
let cell = tableView.dequeueReusableCell(withIdentifier: Self.reuseID, for: indexPath)
var content = cell.defaultContentConfiguration()
cell.accessoryType = .disclosureIndicator

switch row {
case .swiftUI:
content.text = "SwiftUI Demos"
cell.accessoryType = .none
case .imageDownloadNetworking:
content.text = "Image download - Networking"
case .uiImageViewExtension:
Expand All @@ -60,8 +64,6 @@ class MainTableViewController: UITableViewController {
case .imageCropper:
content.text = "Image Cropper"
#endif
case .swiftUI:
content.text = "Swift UI"
}
cell.contentConfiguration = content
return cell
Expand All @@ -71,6 +73,12 @@ class MainTableViewController: UITableViewController {
guard let row = Row(rawValue: indexPath.row) else { return }

switch row {
case .swiftUI:
let swiftUIContentViewController = UIHostingController(rootView: ContentView(onDismiss: { [weak self] in
self?.dismiss(animated: true)
}))
swiftUIContentViewController.modalPresentationStyle = .fullScreen
present(swiftUIContentViewController, animated: true)
case .imageDownloadNetworking:
let vc = DemoAvatarDownloadViewController()
navigationController?.pushViewController(vc, animated: true)
Expand All @@ -96,12 +104,6 @@ class MainTableViewController: UITableViewController {
case .imageCropper:
navigationController?.pushViewController(DemoImageCropperViewController(), animated: true)
#endif
case .swiftUI:
let swiftUIContentController = UIHostingController(rootView: ContentView(onDismiss: { [weak self] in
self?.dismiss(animated: true)
}))
swiftUIContentController.modalPresentationStyle = .fullScreen
present(swiftUIContentController, animated: true)
}
}
}

0 comments on commit 28a5bb3

Please sign in to comment.