diff --git a/.gitignore b/.gitignore index a766fc62..24e748a9 100644 --- a/.gitignore +++ b/.gitignore @@ -120,4 +120,6 @@ xcuserdata # End of https://www.toptal.com/developers/gitignore/api/swift,swiftpm,xcode,cocoapods Localization/StringsConvertor/input -Localization/StringsConvertor/output \ No newline at end of file +Localization/StringsConvertor/output +.DS_Store +/Mastodon.xcworkspace/xcshareddata/swiftpm diff --git a/Mastodon.xcodeproj/project.pbxproj b/Mastodon.xcodeproj/project.pbxproj index 2911667b..f4127506 100644 --- a/Mastodon.xcodeproj/project.pbxproj +++ b/Mastodon.xcodeproj/project.pbxproj @@ -1161,8 +1161,8 @@ 5B90C455262599800002E742 /* Settings */ = { isa = PBXGroup; children = ( - 5B90C456262599800002E742 /* SettingsViewModel.swift */, 5B90C457262599800002E742 /* View */, + 5B90C456262599800002E742 /* SettingsViewModel.swift */, 5B90C45D262599800002E742 /* SettingsViewController.swift */, ); path = Settings; diff --git a/Mastodon/Scene/Settings/View/SettingsSectionHeader.swift b/Mastodon/Scene/Settings/View/SettingsSectionHeader.swift index 67dff982..ccd7fd87 100644 --- a/Mastodon/Scene/Settings/View/SettingsSectionHeader.swift +++ b/Mastodon/Scene/Settings/View/SettingsSectionHeader.swift @@ -7,6 +7,11 @@ import UIKit +struct GroupedTableViewConstraints { + static let topMargin: CGFloat = 40 + static let bottomMargin: CGFloat = 10 +} + /// section header which supports add a custom view blelow the title class SettingsSectionHeader: UIView { lazy var titleLabel: UILabel = { @@ -21,7 +26,12 @@ class SettingsSectionHeader: UIView { let view = UIStackView() view.translatesAutoresizingMaskIntoConstraints = false view.isLayoutMarginsRelativeArrangement = true - view.layoutMargins = UIEdgeInsets(top: 40, left: 12, bottom: 10, right: 12) + view.layoutMargins = UIEdgeInsets( + top: GroupedTableViewConstraints.topMargin, + left: 0, + bottom: GroupedTableViewConstraints.bottomMargin, + right: 0 + ) view.axis = .vertical return view }() @@ -37,8 +47,8 @@ class SettingsSectionHeader: UIView { addSubview(stackView) NSLayoutConstraint.activate([ - stackView.leadingAnchor.constraint(equalTo: self.leadingAnchor), - stackView.trailingAnchor.constraint(lessThanOrEqualTo: self.trailingAnchor), + stackView.leadingAnchor.constraint(equalTo: self.readableContentGuide.leadingAnchor), + stackView.trailingAnchor.constraint(lessThanOrEqualTo: self.readableContentGuide.trailingAnchor), stackView.bottomAnchor.constraint(equalTo: self.bottomAnchor), stackView.topAnchor.constraint(equalTo: self.topAnchor), ])