Skip to content

Commit

Permalink
Rename project from Preferences to Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Mar 20, 2023
1 parent 0208443 commit 3e1816c
Show file tree
Hide file tree
Showing 26 changed files with 81 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .swiftpm/xcode/xcshareddata/xcschemes/Preferences.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1340"
LastUpgradeVersion = "1420"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
8 changes: 4 additions & 4 deletions Example/AccountsScreen.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SwiftUI
import Preferences
import Settings

/**
Function wrapping SwiftUI into `SettingsPane`, which is mimicking view controller's default construction syntax.
Expand Down Expand Up @@ -37,7 +37,7 @@ struct AccountsScreen: View {
Settings.Section(title: "Permissions:") {
Toggle("Allow user to administer this computer", isOn: $isOn1)
Text("Administrator has root access to this machine.")
.preferenceDescription()
.settingDescription()
Toggle("Allow user to access every file", isOn: $isOn2)
}
Settings.Section(title: "Show scroll bars:") {
Expand All @@ -58,7 +58,7 @@ struct AccountsScreen: View {
.labelsHidden()
.frame(width: 120.0)
Text("Automatic mode can slow things down.")
.preferenceDescription()
.settingDescription()
}
Settings.Section(title: "Preview mode:") {
Picker("", selection: $selection3) {
Expand All @@ -68,7 +68,7 @@ struct AccountsScreen: View {
.labelsHidden()
.frame(width: 120.0)
Text("Automatic mode can slow things down.")
.preferenceDescription()
.settingDescription()
}
Settings.Section(title: "Expand this pane:") {
Toggle("Expand", isOn: $isExpanded)
Expand Down
2 changes: 1 addition & 1 deletion Example/AdvancedPreferenceViewController.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Cocoa
import Preferences
import Settings

final class AdvancedSettingsViewController: NSViewController, SettingsPane {
let paneIdentifier = Settings.PaneIdentifier.advanced
Expand Down
2 changes: 1 addition & 1 deletion Example/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Cocoa
import Preferences
import Settings

extension Settings.PaneIdentifier {
static let general = Self("general")
Expand Down
2 changes: 1 addition & 1 deletion Example/GeneralSettingsViewController.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Cocoa
import Preferences
import Settings

final class GeneralSettingsViewController: NSViewController, SettingsPane {
let paneIdentifier = Settings.PaneIdentifier.general
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
objects = {

/* Begin PBXBuildFile section */
502B68E72254947B00789D9F /* PreferencesStyle+UserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 502B68E52254944600789D9F /* PreferencesStyle+UserDefaults.swift */; };
502B68E72254947B00789D9F /* Style+UserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 502B68E52254944600789D9F /* Style+UserDefaults.swift */; };
E3194E4122573FF3006FE775 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3194E4022573FF3006FE775 /* Utilities.swift */; };
E340668C28ADAFF3002F8EA9 /* Preferences in Frameworks */ = {isa = PBXBuildFile; productRef = E340668B28ADAFF3002F8EA9 /* Preferences */; };
E34E9EEA20E6149B002F8F86 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E34E9EE920E6149B002F8F86 /* AppDelegate.swift */; };
E34E9EEC20E6149D002F8F86 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E34E9EEB20E6149D002F8F86 /* Assets.xcassets */; };
E34E9EEF20E6149D002F8F86 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = E34E9EED20E6149D002F8F86 /* MainMenu.xib */; };
E34E9EFF20E617E7002F8F86 /* GeneralSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E34E9EFE20E617E7002F8F86 /* GeneralSettingsViewController.swift */; };
E34E9F0120E61A26002F8F86 /* GeneralSettingsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E34E9F0020E61A26002F8F86 /* GeneralSettingsViewController.xib */; };
E34E9F0320E61BC0002F8F86 /* AdvancedPreferenceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E34E9F0220E61BC0002F8F86 /* AdvancedPreferenceViewController.swift */; };
E34E9F0520E61C06002F8F86 /* AdvancedSettingsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E34E9F0420E61C06002F8F86 /* AdvancedSettingsViewController.xib */; };
E3D37D6429C86E6D00AE5ACC /* Settings in Frameworks */ = {isa = PBXBuildFile; productRef = E3D37D6329C86E6D00AE5ACC /* Settings */; };
E7059F1323C2AC7400F84762 /* AccountsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7059F1123C2AC3700F84762 /* AccountsScreen.swift */; };
/* End PBXBuildFile section */

Expand All @@ -34,10 +34,9 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
502B68E52254944600789D9F /* PreferencesStyle+UserDefaults.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "PreferencesStyle+UserDefaults.swift"; sourceTree = "<group>"; usesTabs = 1; };
502B68E52254944600789D9F /* Style+UserDefaults.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "Style+UserDefaults.swift"; sourceTree = "<group>"; usesTabs = 1; };
E3194E4022573FF3006FE775 /* Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Utilities.swift; sourceTree = "<group>"; usesTabs = 1; };
E340668928ADAFD5002F8EA9 /* Preferences */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Preferences; path = ..; sourceTree = "<group>"; };
E34E9EE720E6149B002F8F86 /* PreferencesExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PreferencesExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
E34E9EE720E6149B002F8F86 /* SettingsExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SettingsExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
E34E9EE920E6149B002F8F86 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = AppDelegate.swift; sourceTree = "<group>"; usesTabs = 1; };
E34E9EEB20E6149D002F8F86 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
E34E9EEE20E6149D002F8F86 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
Expand All @@ -46,6 +45,7 @@
E34E9F0020E61A26002F8F86 /* GeneralSettingsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GeneralSettingsViewController.xib; sourceTree = "<group>"; };
E34E9F0220E61BC0002F8F86 /* AdvancedPreferenceViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = AdvancedPreferenceViewController.swift; sourceTree = "<group>"; usesTabs = 1; };
E34E9F0420E61C06002F8F86 /* AdvancedSettingsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AdvancedSettingsViewController.xib; sourceTree = "<group>"; };
E3D37D6229C86E6100AE5ACC /* Settings */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Settings; path = ..; sourceTree = "<group>"; };
E7059F1123C2AC3700F84762 /* AccountsScreen.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = AccountsScreen.swift; sourceTree = "<group>"; tabWidth = 4; usesTabs = 1; wrapsLines = 1; };
/* End PBXFileReference section */

Expand All @@ -54,7 +54,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E340668C28ADAFF3002F8EA9 /* Preferences in Frameworks */,
E3D37D6429C86E6D00AE5ACC /* Settings in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -64,7 +64,7 @@
E340668A28ADAFF3002F8EA9 /* Frameworks */ = {
isa = PBXGroup;
children = (
E340668928ADAFD5002F8EA9 /* Preferences */,
E3D37D6229C86E6100AE5ACC /* Settings */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -73,7 +73,7 @@
isa = PBXGroup;
children = (
E34E9EE920E6149B002F8F86 /* AppDelegate.swift */,
502B68E52254944600789D9F /* PreferencesStyle+UserDefaults.swift */,
502B68E52254944600789D9F /* Style+UserDefaults.swift */,
E34E9EED20E6149D002F8F86 /* MainMenu.xib */,
E34E9EFE20E617E7002F8F86 /* GeneralSettingsViewController.swift */,
E34E9F0020E61A26002F8F86 /* GeneralSettingsViewController.xib */,
Expand All @@ -90,7 +90,7 @@
OBJ_12 /* Products */ = {
isa = PBXGroup;
children = (
E34E9EE720E6149B002F8F86 /* PreferencesExample.app */,
E34E9EE720E6149B002F8F86 /* SettingsExample.app */,
);
name = Products;
sourceTree = BUILT_PRODUCTS_DIR;
Expand All @@ -108,9 +108,9 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
E34E9EE620E6149B002F8F86 /* PreferencesExample */ = {
E34E9EE620E6149B002F8F86 /* SettingsExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = E34E9EF220E6149D002F8F86 /* Build configuration list for PBXNativeTarget "PreferencesExample" */;
buildConfigurationList = E34E9EF220E6149D002F8F86 /* Build configuration list for PBXNativeTarget "SettingsExample" */;
buildPhases = (
E34E9EE320E6149B002F8F86 /* Sources */,
E34E9EE420E6149B002F8F86 /* Frameworks */,
Expand All @@ -121,12 +121,12 @@
);
dependencies = (
);
name = PreferencesExample;
name = SettingsExample;
packageProductDependencies = (
E340668B28ADAFF3002F8EA9 /* Preferences */,
E3D37D6329C86E6D00AE5ACC /* Settings */,
);
productName = PreferencesExample;
productReference = E34E9EE720E6149B002F8F86 /* PreferencesExample.app */;
productReference = E34E9EE720E6149B002F8F86 /* SettingsExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
Expand All @@ -136,7 +136,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0940;
LastUpgradeCheck = 1200;
LastUpgradeCheck = 1420;
TargetAttributes = {
E34E9EE620E6149B002F8F86 = {
CreatedOnToolsVersion = 9.4.1;
Expand All @@ -149,7 +149,7 @@
};
};
};
buildConfigurationList = OBJ_2 /* Build configuration list for PBXProject "Preferences" */;
buildConfigurationList = OBJ_2 /* Build configuration list for PBXProject "Settings" */;
compatibilityVersion = "Xcode 13.0";
developmentRegion = en;
hasScannedForEncodings = 0;
Expand All @@ -162,7 +162,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
E34E9EE620E6149B002F8F86 /* PreferencesExample */,
E34E9EE620E6149B002F8F86 /* SettingsExample */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -191,7 +191,7 @@
E7059F1323C2AC7400F84762 /* AccountsScreen.swift in Sources */,
E34E9F0320E61BC0002F8F86 /* AdvancedPreferenceViewController.swift in Sources */,
E3194E4122573FF3006FE775 /* Utilities.swift in Sources */,
502B68E72254947B00789D9F /* PreferencesStyle+UserDefaults.swift in Sources */,
502B68E72254947B00789D9F /* Style+UserDefaults.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -227,6 +227,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
Expand Down Expand Up @@ -269,6 +270,7 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -311,6 +313,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = YES;
Expand Down Expand Up @@ -360,6 +363,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand All @@ -386,7 +390,7 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
E34E9EF220E6149D002F8F86 /* Build configuration list for PBXNativeTarget "PreferencesExample" */ = {
E34E9EF220E6149D002F8F86 /* Build configuration list for PBXNativeTarget "SettingsExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
E34E9EF320E6149D002F8F86 /* Debug */,
Expand All @@ -395,7 +399,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
OBJ_2 /* Build configuration list for PBXProject "Preferences" */ = {
OBJ_2 /* Build configuration list for PBXProject "Settings" */ = {
isa = XCConfigurationList;
buildConfigurations = (
OBJ_3 /* Debug */,
Expand All @@ -407,9 +411,9 @@
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
E340668B28ADAFF3002F8EA9 /* Preferences */ = {
E3D37D6329C86E6D00AE5ACC /* Settings */ = {
isa = XCSwiftPackageProductDependency;
productName = Preferences;
productName = Settings;
};
/* End XCSwiftPackageProductDependency section */
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1420"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E34E9EE620E6149B002F8F86"
BuildableName = "PreferencesExample.app"
BlueprintName = "PreferencesExample"
ReferencedContainer = "container:Preferences.xcodeproj">
BuildableName = "SettingsExample.app"
BlueprintName = "SettingsExample"
ReferencedContainer = "container:Settings.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand All @@ -31,9 +31,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E34E9EE620E6149B002F8F86"
BuildableName = "PreferencesExample.app"
BlueprintName = "PreferencesExample"
ReferencedContainer = "container:Preferences.xcodeproj">
BuildableName = "SettingsExample.app"
BlueprintName = "SettingsExample"
ReferencedContainer = "container:Settings.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
Expand All @@ -54,9 +54,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E34E9EE620E6149B002F8F86"
BuildableName = "PreferencesExample.app"
BlueprintName = "PreferencesExample"
ReferencedContainer = "container:Preferences.xcodeproj">
BuildableName = "SettingsExample.app"
BlueprintName = "SettingsExample"
ReferencedContainer = "container:Settings.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
Expand All @@ -71,9 +71,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E34E9EE620E6149B002F8F86"
BuildableName = "PreferencesExample.app"
BlueprintName = "PreferencesExample"
ReferencedContainer = "container:Preferences.xcodeproj">
BuildableName = "SettingsExample.app"
BlueprintName = "SettingsExample"
ReferencedContainer = "container:Settings.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1420"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -17,7 +17,7 @@
BlueprintIdentifier = "Preferences::Preferences"
BuildableName = "Preferences.framework"
BlueprintName = "Preferences"
ReferencedContainer = "container:Preferences.xcodeproj">
ReferencedContainer = "container:Settings.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand Down Expand Up @@ -46,7 +46,7 @@
BlueprintIdentifier = "Preferences::Preferences"
BuildableName = "Preferences.framework"
BlueprintName = "Preferences"
ReferencedContainer = "container:Preferences.xcodeproj">
ReferencedContainer = "container:Settings.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Foundation
import Preferences
import Settings

// Helpers to write styles to and read them from UserDefaults.

Expand Down
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
import PackageDescription

let package = Package(
name: "Preferences",
name: "Settings",
platforms: [
.macOS(.v10_13)
],
products: [
.library(
name: "Preferences",
name: "Settings",
targets: [
"Preferences"
"Settings"
]
)
],
targets: [
.target(
name: "Preferences"
name: "Settings"
)
]
)
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 3e1816c

Please sign in to comment.