Merge pull request #1077 from rdeassis/rdeassis/macOS_10.15

Updating FluentUI target deployment version to MacOS 10.15.
This commit is contained in:
Sophia Lee 2022-07-27 01:39:00 -07:00 коммит произвёл GitHub
Родитель 8560485d3a 5caac4917e
Коммит d9849d82ac
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 25 добавлений и 34 удалений

Просмотреть файл

@ -322,7 +322,7 @@ fi', :execution_position => :before_compile }
# Mac
s.osx.deployment_target = "10.14"
s.osx.deployment_target = "10.15"
s.subspec 'Appearance_mac' do |appearance_mac|
appearance_mac.platform = :osx

Просмотреть файл

@ -14,7 +14,7 @@ Fluent UI Apple contains native UIKit and AppKit controls aligned with [Microsof
#### Requirements
- iOS 14+ or macOS 10.14+
- iOS 14+ or macOS 10.15+
- Xcode 13+
- Swift 5.4+

Просмотреть файл

@ -144,11 +144,7 @@ open class Link: NSButton {
@objc private func linkClicked() {
if let url = url {
if #available(macOS 10.15, *) {
NSWorkspace.shared.open(url, configuration: NSWorkspace.OpenConfiguration(), completionHandler: nil)
} else {
NSWorkspace.shared.open(url)
}
NSWorkspace.shared.open(url, configuration: NSWorkspace.OpenConfiguration(), completionHandler: nil)
}
}
}

Просмотреть файл

@ -50,33 +50,29 @@ class TestColorViewController: NSViewController {
primaryColorsStackView.trailingAnchor.constraint(equalTo: documentView.trailingAnchor)
]
if #available(OSX 10.15, *) {
let switchButton = NSSwitch(frame: CGRect(x: 1, y: 1, width: 100, height: 50))
switchButton.target = self
switchButton.action = #selector(toggleClicked)
toggleTextView.string = "Default"
toggleTextView.font = .systemFont(ofSize: 20)
toggleTextView.isEditable = false
toggleTextView.isSelectable = false
toggleTextView.backgroundColor = .clear
let switchButton = NSSwitch(frame: CGRect(x: 1, y: 1, width: 100, height: 50))
switchButton.target = self
switchButton.action = #selector(toggleClicked)
toggleTextView.string = "Default"
toggleTextView.font = .systemFont(ofSize: 20)
toggleTextView.isEditable = false
toggleTextView.isSelectable = false
toggleTextView.backgroundColor = .clear
let toggleStackView = NSStackView()
toggleStackView.translatesAutoresizingMaskIntoConstraints = false
toggleStackView.orientation = .horizontal
toggleStackView.spacing = 20.0
toggleStackView.addArrangedSubview(switchButton)
toggleStackView.addArrangedSubview(toggleTextView)
documentView.addSubview(toggleStackView)
let toggleStackView = NSStackView()
toggleStackView.translatesAutoresizingMaskIntoConstraints = false
toggleStackView.orientation = .horizontal
toggleStackView.spacing = 20.0
toggleStackView.addArrangedSubview(switchButton)
toggleStackView.addArrangedSubview(toggleTextView)
documentView.addSubview(toggleStackView)
subviewConstraints.append(contentsOf: [
toggleStackView.topAnchor.constraint(equalTo: primaryColorsStackView.bottomAnchor, constant: colorRowSpacing),
toggleStackView.leadingAnchor.constraint(equalTo: documentView.leadingAnchor, constant: colorRowSpacing),
toggleStackView.trailingAnchor.constraint(equalTo: documentView.trailingAnchor, constant: colorRowSpacing),
toggleStackView.bottomAnchor.constraint(equalTo: documentView.bottomAnchor, constant: -colorRowSpacing)
])
} else {
subviewConstraints.append(primaryColorsStackView.bottomAnchor.constraint(equalTo: documentView.bottomAnchor, constant: -colorRowSpacing))
}
subviewConstraints.append(contentsOf: [
toggleStackView.topAnchor.constraint(equalTo: primaryColorsStackView.bottomAnchor, constant: colorRowSpacing),
toggleStackView.leadingAnchor.constraint(equalTo: documentView.leadingAnchor, constant: colorRowSpacing),
toggleStackView.trailingAnchor.constraint(equalTo: documentView.trailingAnchor, constant: colorRowSpacing),
toggleStackView.bottomAnchor.constraint(equalTo: documentView.bottomAnchor, constant: -colorRowSpacing)
])
NSLayoutConstraint.activate(subviewConstraints)
view = containerView
@ -94,7 +90,6 @@ class TestColorViewController: NSViewController {
return rowStackView
}
@available(OSX 10.15, *)
@objc private func toggleClicked(button: NSSwitch?) {
primaryColorsStackView.subviews.removeAll()
loadPrimaryColors(state: button?.state ?? NSControl.StateValue.off)

Просмотреть файл

@ -36,6 +36,6 @@ GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14
MACOSX_DEPLOYMENT_TARGET = 10.15
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES
SWIFT_VERSION = 5.0