diff --git a/Mastodon.xcodeproj/project.pbxproj b/Mastodon.xcodeproj/project.pbxproj index d15860a60..63e5fdc37 100644 --- a/Mastodon.xcodeproj/project.pbxproj +++ b/Mastodon.xcodeproj/project.pbxproj @@ -132,6 +132,7 @@ D809907A294BC9390050219F /* PrivacyTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8099079294BC9390050219F /* PrivacyTableViewCell.swift */; }; D809907C294D25510050219F /* PrivacyViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D809907B294D25510050219F /* PrivacyViewModel.swift */; }; D81439862AD415DE0071A88F /* AboutInstance.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81439852AD415DE0071A88F /* AboutInstance.swift */; }; + D81439882AD450A40071A88F /* AboutInstanceTableViewDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81439872AD450A40071A88F /* AboutInstanceTableViewDataSource.swift */; }; D81A22752AB4643200905D71 /* SearchResultsOverviewTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A22742AB4643200905D71 /* SearchResultsOverviewTableViewController.swift */; }; D81A22782AB4782400905D71 /* SearchResultOverviewSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A22772AB4782400905D71 /* SearchResultOverviewSection.swift */; }; D81A227B2AB47B9A00905D71 /* SearchResultDefaultSectionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A227A2AB47B9A00905D71 /* SearchResultDefaultSectionTableViewCell.swift */; }; @@ -784,6 +785,7 @@ D8099079294BC9390050219F /* PrivacyTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrivacyTableViewCell.swift; sourceTree = ""; }; D809907B294D25510050219F /* PrivacyViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrivacyViewModel.swift; sourceTree = ""; }; D81439852AD415DE0071A88F /* AboutInstance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutInstance.swift; sourceTree = ""; }; + D81439872AD450A40071A88F /* AboutInstanceTableViewDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutInstanceTableViewDataSource.swift; sourceTree = ""; }; D81A22742AB4643200905D71 /* SearchResultsOverviewTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultsOverviewTableViewController.swift; sourceTree = ""; }; D81A22772AB4782400905D71 /* SearchResultOverviewSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultOverviewSection.swift; sourceTree = ""; }; D81A227A2AB47B9A00905D71 /* SearchResultDefaultSectionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultDefaultSectionTableViewCell.swift; sourceTree = ""; }; @@ -1957,6 +1959,7 @@ D8FAAE402AD0475900DC1832 /* AboutInstanceTableViewHeader.swift */, D8FAAE422AD047B200DC1832 /* AboutInstanceTableFooterView.swift */, D81439852AD415DE0071A88F /* AboutInstance.swift */, + D81439872AD450A40071A88F /* AboutInstanceTableViewDataSource.swift */, ); path = "Table View Components"; sourceTree = ""; @@ -3325,7 +3328,7 @@ ); mainGroup = DB427DC925BAA00100D1B89D; packageReferences = ( - 2AB501192992322500346092 /* XCRemoteSwiftPackageReference "LightChart.git" */, + 2AB501192992322500346092 /* XCRemoteSwiftPackageReference "LightChart" */, ); productRefGroup = DB427DD325BAA00100D1B89D /* Products */; projectDirPath = ""; @@ -3882,6 +3885,7 @@ DB68A04A25E9027700CFDF14 /* AdaptiveStatusBarStyleNavigationController.swift in Sources */, 0FB3D33825E6401400AAD544 /* PickServerCell.swift in Sources */, 6213AF5C28939C8A00BCADB6 /* BookmarkViewModel+State.swift in Sources */, + D81439882AD450A40071A88F /* AboutInstanceTableViewDataSource.swift in Sources */, D807C6C029DE197900A4E17C /* EducationViewController.swift in Sources */, 2D364F7825E66D8300204FDC /* MastodonResendEmailViewModel.swift in Sources */, DBEFCD7B282A162400C0ABEA /* ReportReasonView.swift in Sources */, @@ -5455,7 +5459,7 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 2AB501192992322500346092 /* XCRemoteSwiftPackageReference "LightChart.git" */ = { + 2AB501192992322500346092 /* XCRemoteSwiftPackageReference "LightChart" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/Bearologics/LightChart.git"; requirement = { @@ -5476,7 +5480,7 @@ }; 2AB5011A2992322500346092 /* LightChart */ = { isa = XCSwiftPackageProductDependency; - package = 2AB501192992322500346092 /* XCRemoteSwiftPackageReference "LightChart.git" */; + package = 2AB501192992322500346092 /* XCRemoteSwiftPackageReference "LightChart" */; productName = LightChart; }; 357FEEAE29523D470021C9DC /* MastodonSDKDynamic */ = { diff --git a/Mastodon/Scene/Settings/Server Details/AboutInstanceViewController.swift b/Mastodon/Scene/Settings/Server Details/AboutInstanceViewController.swift index 7b7e7cc93..7fc54209f 100644 --- a/Mastodon/Scene/Settings/Server Details/AboutInstanceViewController.swift +++ b/Mastodon/Scene/Settings/Server Details/AboutInstanceViewController.swift @@ -11,7 +11,7 @@ protocol AboutInstanceViewControllerDelegate: AnyObject { class AboutInstanceViewController: UIViewController { weak var delegate: AboutInstanceViewControllerDelegate? - var dataSource: UITableViewDiffableDataSource? + var dataSource: AboutInstanceTableViewDataSource? let tableView: UITableView let headerView: AboutInstanceTableHeaderView @@ -30,7 +30,7 @@ class AboutInstanceViewController: UIViewController { super.init(nibName: nil, bundle: nil) - let dataSource = UITableViewDiffableDataSource(tableView: tableView) { tableView, indexPath, itemIdentifier in + let dataSource = AboutInstanceTableViewDataSource(tableView: tableView) { tableView, indexPath, itemIdentifier in switch itemIdentifier { case .adminAccount(let account): diff --git a/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstanceTableViewDataSource.swift b/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstanceTableViewDataSource.swift new file mode 100644 index 000000000..c047e0669 --- /dev/null +++ b/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstanceTableViewDataSource.swift @@ -0,0 +1,14 @@ +// Copyright © 2023 Mastodon gGmbH. All rights reserved. + +import UIKit + +class AboutInstanceTableViewDataSource: UITableViewDiffableDataSource { + + override init(tableView: UITableView, cellProvider: @escaping UITableViewDiffableDataSource.CellProvider) { + super.init(tableView: tableView, cellProvider: cellProvider) + } + + override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { + return "Administrator".uppercased() + } +} diff --git a/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstanceTableViewHeader.swift b/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstanceTableViewHeader.swift index a9a7235f6..955a6d813 100644 --- a/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstanceTableViewHeader.swift +++ b/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstanceTableViewHeader.swift @@ -24,7 +24,7 @@ class AboutInstanceTableHeaderView: UIView { thumbnailImageView.topAnchor.constraint(equalTo: topAnchor), thumbnailImageView.leadingAnchor.constraint(equalTo: leadingAnchor), trailingAnchor.constraint(equalTo: thumbnailImageView.trailingAnchor), - bottomAnchor.constraint(equalTo: thumbnailImageView.bottomAnchor, constant: 24), + bottomAnchor.constraint(equalTo: thumbnailImageView.bottomAnchor), thumbnailImageView.heightAnchor.constraint(equalToConstant: 188), ]