Replace fatalError with preconditionFailure (#647)
This commit is contained in:
Родитель
34d1d5eeb0
Коммит
edc6c70da9
|
@ -12,7 +12,7 @@ class TableViewCellFileAccessoryViewDemoController: UITableViewController {
|
|||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
preconditionFailure("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
|
|
|
@ -46,7 +46,7 @@ open class CommandBar: UIView {
|
|||
|
||||
@available(*, unavailable)
|
||||
public required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
preconditionFailure("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
/// Apply `isEnabled` and `isSelected` state from `CommandBarItem` to the buttons
|
||||
|
@ -139,7 +139,7 @@ open class CommandBar: UIView {
|
|||
itemGroups.map { items in
|
||||
CommandBarButtonGroupView(buttons: items.compactMap { item in
|
||||
guard let button = itemsToButtonsMap[item] else {
|
||||
fatalError("Button is not initialized in commandsToButtons")
|
||||
preconditionFailure("Button is not initialized in commandsToButtons")
|
||||
}
|
||||
|
||||
return button
|
||||
|
|
|
@ -50,7 +50,7 @@ class CommandBarButton: UIButton {
|
|||
|
||||
@available(*, unavailable)
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
preconditionFailure("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
func updateState() {
|
||||
|
|
|
@ -24,7 +24,7 @@ class CommandBarButtonGroupView: UIView {
|
|||
|
||||
@available(*, unavailable)
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
preconditionFailure("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
private lazy var stackView: UIStackView = {
|
||||
|
|
|
@ -48,7 +48,7 @@ class SegmentPillButton: UIButton {
|
|||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
preconditionFailure("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func layoutSubviews() {
|
||||
|
|
|
@ -698,7 +698,7 @@ class BorderView: NSView {
|
|||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
preconditionFailure("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func draw(_ dirtyRect: NSRect) {
|
||||
|
|
|
@ -49,11 +49,11 @@ func findUsedResources(in rootPath: String) -> Set<String> {
|
|||
#endif
|
||||
}
|
||||
} catch {
|
||||
fatalError("Failed to read contents resource file: \(filePath) \nError: \(error)")
|
||||
preconditionFailure("Failed to read contents resource file: \(filePath) \nError: \(error)")
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
fatalError("Failed to retrieve resource file: \(fileURL) \nError: \(error)")
|
||||
preconditionFailure("Failed to retrieve resource file: \(fileURL) \nError: \(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче