Skip to content

Commit 0034213

Browse files
committed
Minor tweaks
1 parent 9b4d3a7 commit 0034213

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.6
1+
// swift-tools-version:5.7
22
import PackageDescription
33

44
let package = Package(

Sources/Preferences/Section.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ extension Settings {
6464
- label: A view describing the setting handled by this section.
6565
- content: A content view.
6666
*/
67-
public init<Label: View, Content: View>(
67+
public init(
6868
bottomDivider: Bool = false,
6969
verticalAlignment: VerticalAlignment = .firstTextBaseline,
70-
label: @escaping () -> Label,
71-
@ViewBuilder content: @escaping () -> Content
70+
label: @escaping () -> some View,
71+
@ViewBuilder content: @escaping () -> some View
7272
) {
7373
self.label = label()
7474
.overlay(LabelOverlay())
@@ -88,11 +88,11 @@ extension Settings {
8888
- verticalAlignement: The vertical alignment of the section content.
8989
- content: A content view.
9090
*/
91-
public init<Content: View>(
91+
public init(
9292
title: String,
9393
bottomDivider: Bool = false,
9494
verticalAlignment: VerticalAlignment = .firstTextBaseline,
95-
@ViewBuilder content: @escaping () -> Content
95+
@ViewBuilder content: @escaping () -> some View
9696
) {
9797
let textLabel = {
9898
Text(title)

Sources/Preferences/SegmentedControlStyleViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ final class SegmentedControlStyleViewController: NSViewController, SettingsStyle
114114
// context menu that pops up at the right edge of the window.
115115
let toolbarItemGroup = NSToolbarItemGroup(itemIdentifier: toolbarItemIdentifier)
116116
toolbarItemGroup.view = segmentedControl
117-
toolbarItemGroup.subitems = panes.enumerated().map { index, settingsPane -> NSToolbarItem in
117+
toolbarItemGroup.subitems = panes.enumerated().map { index, settingsPane in
118118
let item = NSToolbarItem(itemIdentifier: .init("segment-\(settingsPane.preferencePaneTitle)"))
119119
item.label = settingsPane.preferencePaneTitle
120120

Sources/Preferences/SettingsTabViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class SettingsTabViewController: NSViewController, SettingsStyleController
1717
var isAnimated = true
1818

1919
var activeViewController: NSViewController? {
20-
guard let activeTab = activeTab else {
20+
guard let activeTab else {
2121
return nil
2222
}
2323

@@ -119,7 +119,7 @@ final class SettingsTabViewController: NSViewController, SettingsStyleController
119119
}
120120

121121
private func animateTabTransition(index: Int, animated: Bool) {
122-
guard let activeTab = activeTab else {
122+
guard let activeTab else {
123123
assertionFailure("animateTabTransition called before a tab was displayed; transition only works from one tab to another")
124124
immediatelyDisplayTab(index: index)
125125
return
@@ -189,7 +189,7 @@ final class SettingsTabViewController: NSViewController, SettingsStyleController
189189
}
190190

191191
private func setWindowFrame(for viewController: NSViewController, animated: Bool = false) {
192-
guard let window = window else {
192+
guard let window else {
193193
preconditionFailure()
194194
}
195195

Sources/Preferences/SettingsWindowController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public final class SettingsWindowController: NSWindowController {
8989
- See `showWindow(_:)` to show the window without the convenience of activating the app.
9090
*/
9191
public func show(preferencePane paneIdentifier: Settings.PaneIdentifier? = nil) {
92-
if let paneIdentifier = paneIdentifier {
92+
if let paneIdentifier {
9393
tabViewController.activateTab(paneIdentifier: paneIdentifier, animated: false)
9494
} else {
9595
tabViewController.restoreInitialTab()
@@ -102,7 +102,7 @@ public final class SettingsWindowController: NSWindowController {
102102

103103
private func restoreWindowPosition() {
104104
guard
105-
let window = window,
105+
let window,
106106
let screenContainingWindow = window.screen
107107
else {
108108
return

Sources/Preferences/Utilities.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extension NSImage {
77
extension NSView {
88
@discardableResult
99
func constrainToSuperviewBounds() -> [NSLayoutConstraint] {
10-
guard let superview = superview else {
10+
guard let superview else {
1111
preconditionFailure("superview has to be set first")
1212
}
1313

0 commit comments

Comments
 (0)