diff --git a/Mastodon.xcodeproj/project.pbxproj b/Mastodon.xcodeproj/project.pbxproj index 7c90c594a..8cd140147 100644 --- a/Mastodon.xcodeproj/project.pbxproj +++ b/Mastodon.xcodeproj/project.pbxproj @@ -145,6 +145,8 @@ D8318A882A4468D300C0FB73 /* NotificationSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8318A872A4468D300C0FB73 /* NotificationSettingsViewController.swift */; }; D8318A8A2A4468DC00C0FB73 /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8318A892A4468DC00C0FB73 /* AboutViewController.swift */; }; D8363B1629469CE200A74079 /* OnboardingNextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8363B1529469CE200A74079 /* OnboardingNextView.swift */; }; + D852C23C2AC5D02C00309232 /* AboutInstanceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D852C23B2AC5D02C00309232 /* AboutInstanceViewController.swift */; }; + D852C23E2AC5D03300309232 /* InstanceRulesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D852C23D2AC5D03300309232 /* InstanceRulesViewController.swift */; }; D87BFC8B291D5C6B00FEE264 /* MastodonLoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D87BFC8A291D5C6B00FEE264 /* MastodonLoginView.swift */; }; D87BFC8D291EB81200FEE264 /* MastodonLoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D87BFC8C291EB81200FEE264 /* MastodonLoginViewModel.swift */; }; D87BFC8F291EC26A00FEE264 /* MastodonLoginServerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D87BFC8E291EC26A00FEE264 /* MastodonLoginServerTableViewCell.swift */; }; @@ -797,6 +799,8 @@ D8318A872A4468D300C0FB73 /* NotificationSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationSettingsViewController.swift; sourceTree = ""; }; D8318A892A4468DC00C0FB73 /* AboutViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; }; D8363B1529469CE200A74079 /* OnboardingNextView.swift */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = sourcecode.swift; path = OnboardingNextView.swift; sourceTree = ""; tabWidth = 4; }; + D852C23B2AC5D02C00309232 /* AboutInstanceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutInstanceViewController.swift; sourceTree = ""; }; + D852C23D2AC5D03300309232 /* InstanceRulesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstanceRulesViewController.swift; sourceTree = ""; }; D87BFC8A291D5C6B00FEE264 /* MastodonLoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MastodonLoginView.swift; sourceTree = ""; }; D87BFC8C291EB81200FEE264 /* MastodonLoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MastodonLoginViewModel.swift; sourceTree = ""; }; D87BFC8E291EC26A00FEE264 /* MastodonLoginServerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MastodonLoginServerTableViewCell.swift; sourceTree = ""; }; @@ -1790,6 +1794,8 @@ isa = PBXGroup; children = ( D80911072AC4BFDE00EB4D15 /* ServerDetailsViewController.swift */, + D852C23B2AC5D02C00309232 /* AboutInstanceViewController.swift */, + D852C23D2AC5D03300309232 /* InstanceRulesViewController.swift */, ); path = "Server Details"; sourceTree = ""; @@ -3659,6 +3665,7 @@ DB45FAD725CA6C76005A8AC7 /* UIBarButtonItem.swift in Sources */, D808B94E296EFBBA0031EB1E /* StatusEditHistoryTableViewCell.swift in Sources */, 2D8434F525FF465D00EECE90 /* HomeTimelineNavigationBarTitleViewModel.swift in Sources */, + D852C23E2AC5D03300309232 /* InstanceRulesViewController.swift in Sources */, DB938F0F2624119800E5B6C1 /* ThreadViewModel+LoadThreadState.swift in Sources */, DB6180F226391CF40018D199 /* MediaPreviewImageViewModel.swift in Sources */, 62FD27D12893707600B205C5 /* BookmarkViewController.swift in Sources */, @@ -3935,6 +3942,7 @@ D8B5E4F42A4ED0240008970C /* NotificationSettingsViewModel.swift in Sources */, DBD376B2269302A4007FEC24 /* UITableViewCell.swift in Sources */, DB4F0966269ED52200D62E92 /* SearchResultViewModel.swift in Sources */, + D852C23C2AC5D02C00309232 /* AboutInstanceViewController.swift in Sources */, D8F917142A4D74C3008A5370 /* GeneralSettingsDiffableTableViewDataSource.swift in Sources */, DB6180FA26391F2E0018D199 /* MediaPreviewViewModel.swift in Sources */, 2D7631A825C1535600929FB9 /* StatusTableViewCell.swift in Sources */, diff --git a/Mastodon/Scene/Settings/Server Details/AboutInstanceViewController.swift b/Mastodon/Scene/Settings/Server Details/AboutInstanceViewController.swift new file mode 100644 index 000000000..6d6e9d7eb --- /dev/null +++ b/Mastodon/Scene/Settings/Server Details/AboutInstanceViewController.swift @@ -0,0 +1,18 @@ +// Copyright © 2023 Mastodon gGmbH. All rights reserved. + +import UIKit + +protocol AboutInstanceViewControllerDelegate: AnyObject { + +} + +class AboutInstanceViewController: UIViewController { + weak var delegate: AboutInstanceViewControllerDelegate? + + init() { + super.init(nibName: nil, bundle: nil) + } + + required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } +} + diff --git a/Mastodon/Scene/Settings/Server Details/InstanceRulesViewController.swift b/Mastodon/Scene/Settings/Server Details/InstanceRulesViewController.swift new file mode 100644 index 000000000..e28802505 --- /dev/null +++ b/Mastodon/Scene/Settings/Server Details/InstanceRulesViewController.swift @@ -0,0 +1,17 @@ +// Copyright © 2023 Mastodon gGmbH. All rights reserved. + +import UIKit + +protocol InstanceRulesViewControllerDelegate: AnyObject { + +} + +class InstanceRulesViewController: UIViewController { + weak var delegate: InstanceRulesViewControllerDelegate? + + init() { + super.init(nibName: nil, bundle: nil) + } + + required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } +} diff --git a/Mastodon/Scene/Settings/Server Details/ServerDetailsViewController.swift b/Mastodon/Scene/Settings/Server Details/ServerDetailsViewController.swift index dbb947112..8fc8a114c 100644 --- a/Mastodon/Scene/Settings/Server Details/ServerDetailsViewController.swift +++ b/Mastodon/Scene/Settings/Server Details/ServerDetailsViewController.swift @@ -7,14 +7,46 @@ protocol ServerDetailsViewControllerDelegate: AnyObject { } class ServerDetailsViewController: UIViewController { + weak var delegate: ServerDetailsViewControllerDelegate? + // PageController + + let segmentedControl: UISegmentedControl + let containerView: UIView init() { + segmentedControl = UISegmentedControl() + segmentedControl.translatesAutoresizingMaskIntoConstraints = false + + containerView = UIView() + containerView.translatesAutoresizingMaskIntoConstraints = false + containerView.backgroundColor = .green + super.init(nibName: nil, bundle: nil) + view.addSubview(segmentedControl) + view.addSubview(containerView) + view.backgroundColor = .systemGroupedBackground + + setupConstraints() } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } + + private func setupConstraints() { + let constraints = [ + segmentedControl.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), + segmentedControl.leadingAnchor.constraint(equalTo: view.leadingAnchor), + view.trailingAnchor.constraint(equalTo: segmentedControl.trailingAnchor), + + containerView.topAnchor.constraint(equalTo: segmentedControl.bottomAnchor), + containerView.leadingAnchor.constraint(equalTo: view.leadingAnchor), + view.trailingAnchor.constraint(equalTo: containerView.trailingAnchor), + view.bottomAnchor.constraint(equalTo: containerView.bottomAnchor), + ] + + NSLayoutConstraint.activate(constraints) + } } diff --git a/MastodonSDK/Package.swift b/MastodonSDK/Package.swift index 8d44f39f4..e539acae3 100644 --- a/MastodonSDK/Package.swift +++ b/MastodonSDK/Package.swift @@ -125,6 +125,7 @@ let package = Package( .product(name: "PanModal", package: "PanModal"), .product(name: "Stripes", package: "Stripes"), .product(name: "NextLevelSessionExporter", package: "NextLevelSessionExporter"), + .product(name: "SDWebImage", package: "SDWebImage"), ] ), .testTarget(