From 80bbe15691217182ba4d95235307dde39a9702e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Talip=20G=C3=B6ksu?= Date: Sun, 26 Aug 2018 23:12:06 +0200 Subject: [PATCH 1/2] Add(UIAppearance styling for UISwitch) --- Classes/Settings/Settings.storyboard | 8 ++++---- Classes/Views/StyledSwitch.swift | 18 ------------------ Classes/Views/Styles.swift | 1 + Freetime.xcodeproj/project.pbxproj | 4 ---- 4 files changed, 5 insertions(+), 26 deletions(-) delete mode 100644 Classes/Views/StyledSwitch.swift diff --git a/Classes/Settings/Settings.storyboard b/Classes/Settings/Settings.storyboard index fbb3eb8f6..952246ef9 100644 --- a/Classes/Settings/Settings.storyboard +++ b/Classes/Settings/Settings.storyboard @@ -202,7 +202,7 @@ - + @@ -243,7 +243,7 @@ - + @@ -272,7 +272,7 @@ - + @@ -389,7 +389,7 @@ - + diff --git a/Classes/Views/StyledSwitch.swift b/Classes/Views/StyledSwitch.swift deleted file mode 100644 index af1edc3f8..000000000 --- a/Classes/Views/StyledSwitch.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// StyledSwitch.swift -// Freetime -// -// Created by Ryan Nystrom on 8/11/18. -// Copyright © 2018 Ryan Nystrom. All rights reserved. -// - -import UIKit - -class StyledSwitch: UISwitch { - - override func awakeFromNib() { - super.awakeFromNib() - onTintColor = Styles.Colors.Green.medium.color - } - -} diff --git a/Classes/Views/Styles.swift b/Classes/Views/Styles.swift index a24a872b3..4278241df 100644 --- a/Classes/Views/Styles.swift +++ b/Classes/Views/Styles.swift @@ -121,6 +121,7 @@ enum Styles { UINavigationBar.appearance().tintColor = Styles.Colors.Blue.medium.color UINavigationBar.appearance().titleTextAttributes = [NSAttributedStringKey.foregroundColor: Styles.Colors.Gray.dark.color] + UISwitch.appearance().onTintColor = Styles.Colors.Green.medium.color } } diff --git a/Freetime.xcodeproj/project.pbxproj b/Freetime.xcodeproj/project.pbxproj index 85008f445..bf751b82b 100644 --- a/Freetime.xcodeproj/project.pbxproj +++ b/Freetime.xcodeproj/project.pbxproj @@ -113,7 +113,6 @@ 292FF8B91F303DB0009E63F7 /* IssuePreviewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 292FF8B81F303DB0009E63F7 /* IssuePreviewModel.swift */; }; 2930988D211F327C00E1178B /* Defaults+Reaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2930988C211F327B00E1178B /* Defaults+Reaction.swift */; }; 2930988F211F32D100E1178B /* DefaultReactionDetailController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2930988E211F32D100E1178B /* DefaultReactionDetailController.swift */; }; - 29309895211FD7CC00E1178B /* StyledSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29309894211FD7CC00E1178B /* StyledSwitch.swift */; }; 2930F2711F894AA10082BA26 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 2930F2701F894AA10082BA26 /* Settings.bundle */; }; 2930F2731F8A27750082BA26 /* WidthCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2930F2721F8A27750082BA26 /* WidthCache.swift */; }; 29316DB51ECC7DEB007CAE3F /* ButtonCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29316DB41ECC7DEB007CAE3F /* ButtonCell.swift */; }; @@ -629,7 +628,6 @@ 292FF8B81F303DB0009E63F7 /* IssuePreviewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IssuePreviewModel.swift; sourceTree = ""; }; 2930988C211F327B00E1178B /* Defaults+Reaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Defaults+Reaction.swift"; sourceTree = ""; }; 2930988E211F32D100E1178B /* DefaultReactionDetailController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultReactionDetailController.swift; sourceTree = ""; }; - 29309894211FD7CC00E1178B /* StyledSwitch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StyledSwitch.swift; sourceTree = ""; }; 2930F2701F894AA10082BA26 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = SOURCE_ROOT; }; 2930F2721F8A27750082BA26 /* WidthCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidthCache.swift; sourceTree = ""; }; 29316DB41ECC7DEB007CAE3F /* ButtonCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ButtonCell.swift; sourceTree = ""; }; @@ -1733,7 +1731,6 @@ 29C2950F1EC7B7FF00D46CD2 /* ShowMoreDetailsLabel.swift */, 295840701EE9F4D3007723C6 /* ShowMoreDetailsLabel+Date.swift */, 2971722C1F069E96005E43AC /* SpinnerCell.swift */, - 29309894211FD7CC00E1178B /* StyledSwitch.swift */, 291929621F3FF0DA0012067B /* StyledTableCell.swift */, 299F63E7205F09900015D901 /* StyledTextRenderer+ListDiffable.swift */, 299F63D9205DD86E0015D901 /* StyledTextViewCell.swift */, @@ -2945,7 +2942,6 @@ 5DB4DD471FC5C10000DF7ABF /* Accessibility.swift in Sources */, D8BAD0641FDF221900C41071 /* LabelListView.swift in Sources */, 2924C18820D5B2F200FCFCFF /* PeopleSectionController.swift in Sources */, - 29309895211FD7CC00E1178B /* StyledSwitch.swift in Sources */, 292ACE181F5C945B00C9A02C /* RepositoryIssueSummaryModel.swift in Sources */, DCA5ED1B1FAEF78B0072F074 /* BookmarkSectionController.swift in Sources */, 29693EE520FAA05F00336200 /* IssueAutocomplete.swift in Sources */, From b8b2a690b3c0288ce92a0b40b9a8c421bdc743ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Talip=20G=C3=B6ksu?= Date: Sun, 26 Aug 2018 23:36:57 +0200 Subject: [PATCH 2/2] Add(UIAppearance for UISearchBar) --- Classes/Bookmark/BookmarkViewController.swift | 1 - Classes/Search/SearchViewController.swift | 1 - Classes/Section Controllers/SearchBar/SearchBarCell.swift | 1 - Classes/Views/Styles.swift | 1 + 4 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Classes/Bookmark/BookmarkViewController.swift b/Classes/Bookmark/BookmarkViewController.swift index c97866a3d..053142462 100644 --- a/Classes/Bookmark/BookmarkViewController.swift +++ b/Classes/Bookmark/BookmarkViewController.swift @@ -76,7 +76,6 @@ TabNavRootViewControllerType { searchBar.delegate = self searchBar.placeholder = Constants.Strings.searchBookmarks - searchBar.tintColor = Styles.Colors.Blue.medium.color searchBar.backgroundColor = .clear searchBar.searchBarStyle = .minimal navigationItem.titleView = searchBar diff --git a/Classes/Search/SearchViewController.swift b/Classes/Search/SearchViewController.swift index 006ea7499..d0d0f8315 100644 --- a/Classes/Search/SearchViewController.swift +++ b/Classes/Search/SearchViewController.swift @@ -82,7 +82,6 @@ SearchResultSectionControllerDelegate { searchBar.delegate = self searchBar.placeholder = Constants.Strings.searchGitHub - searchBar.tintColor = Styles.Colors.Blue.medium.color searchBar.backgroundColor = .clear searchBar.searchBarStyle = .minimal navigationItem.titleView = searchBar diff --git a/Classes/Section Controllers/SearchBar/SearchBarCell.swift b/Classes/Section Controllers/SearchBar/SearchBarCell.swift index 22ef5ff6c..942c02299 100644 --- a/Classes/Section Controllers/SearchBar/SearchBarCell.swift +++ b/Classes/Section Controllers/SearchBar/SearchBarCell.swift @@ -28,7 +28,6 @@ final class SearchBarCell: UICollectionViewCell, UISearchBarDelegate { searchBar.enablesReturnKeyAutomatically = false searchBar.searchBarStyle = .minimal searchBar.delegate = self - searchBar.tintColor = Styles.Colors.Blue.medium.color contentView.addSubview(searchBar) searchBar.snp.makeConstraints { make in make.leading.equalTo(contentView) diff --git a/Classes/Views/Styles.swift b/Classes/Views/Styles.swift index 4278241df..6c7c1c29f 100644 --- a/Classes/Views/Styles.swift +++ b/Classes/Views/Styles.swift @@ -122,6 +122,7 @@ enum Styles { UINavigationBar.appearance().titleTextAttributes = [NSAttributedStringKey.foregroundColor: Styles.Colors.Gray.dark.color] UISwitch.appearance().onTintColor = Styles.Colors.Green.medium.color + UISearchBar.appearance().tintColor = Styles.Colors.Blue.medium.color } }