Skip to content

Commit

Permalink
Switch from titled "Dismiss" button do system done (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
PycKamil authored Mar 10, 2022
1 parent 7c06030 commit 3dec92a
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion SwiftTweaks/StringOptionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal class StringOptionViewController: UITableViewController {
title = tweak.tweakName
toolbarItems = [
UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil),
UIBarButtonItem(title: TweaksViewController.dismissButtonTitle, style: .done, target: self, action: #selector(self.dismissButtonTapped))
UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(self.dismissButtonTapped))
]

self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Reset", style: .plain, target: self, action: #selector(StringOptionViewController.restoreDefaultValue))
Expand Down
2 changes: 1 addition & 1 deletion SwiftTweaks/TweakCollectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ internal final class TweakCollectionViewController: UIViewController {

toolbarItems = [
UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil),
UIBarButtonItem(title: TweaksViewController.dismissButtonTitle, style: .done, target: self, action: #selector(self.dismissButtonTapped))
UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(self.dismissButtonTapped))
]
}

Expand Down
2 changes: 1 addition & 1 deletion SwiftTweaks/TweakColorEditViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ internal final class TweakColorEditViewController: UIViewController {
title = tweak.tweakName
toolbarItems = [
UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil),
UIBarButtonItem(title: TweaksViewController.dismissButtonTitle, style: .done, target: self, action: #selector(self.dismissButtonTapped))
UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(self.dismissButtonTapped))
]

view.tintColor = AppTheme.Colors.controlGrayscale
Expand Down
2 changes: 1 addition & 1 deletion SwiftTweaks/TweaksCollectionsListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ internal final class TweaksCollectionsListViewController: UIViewController {

toolbarItems = [
UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil),
UIBarButtonItem(title: "Dismiss", style: .done, target: self, action: #selector(self.dismissButtonTapped))
UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(self.dismissButtonTapped))
]
}

Expand Down
2 changes: 0 additions & 2 deletions SwiftTweaks/TweaksViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public final class TweaksViewController: UIViewController {
public unowned var delegate: TweaksViewControllerDelegate
internal var floatingTweaksWindowPresenter: FloatingTweaksWindowPresenter?

internal static let dismissButtonTitle = NSLocalizedString("Dismiss", comment: "Button to dismiss TweaksViewController.")

public init(tweakStore: TweakStore, delegate: TweaksViewControllerDelegate) {
self.tweakStore = tweakStore
self.delegate = delegate
Expand Down

0 comments on commit 3dec92a

Please sign in to comment.