Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Classes/Settings/Settings.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
<color key="textColor" red="0.14117647058823529" green="0.16078431372549018" blue="0.1803921568627451" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="FvK-93-raA">
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="FvK-93-raA" customClass="StyledSwitch" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="311" y="6" width="51" height="31"/>
<connections>
<action selector="onBackgroundFetchChanged" destination="NnB-TU-bkW" eventType="valueChanged" id="gPu-bQ-K9r"/>
Expand Down Expand Up @@ -243,7 +243,7 @@
<color key="textColor" red="0.14117647059999999" green="0.16078431369999999" blue="0.18039215689999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8dQ-YU-Yuw">
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8dQ-YU-Yuw" customClass="StyledSwitch" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="311" y="6" width="51" height="31"/>
<connections>
<action selector="onMarkRead:" destination="NnB-TU-bkW" eventType="valueChanged" id="QPk-DK-Ufx"/>
Expand Down Expand Up @@ -272,7 +272,7 @@
<color key="textColor" red="0.14117647059999999" green="0.16078431369999999" blue="0.18039215689999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ZWv-km-fU1">
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ZWv-km-fU1" customClass="StyledSwitch" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="311" y="6" width="51" height="31"/>
<connections>
<action selector="onSignature:" destination="NnB-TU-bkW" eventType="valueChanged" id="XNf-Bz-K8B"/>
Expand Down Expand Up @@ -389,21 +389,21 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Dj7-Q0-qBc">
<rect key="frame" x="300" y="6" width="51" height="31"/>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Dj7-Q0-qBc" customClass="StyledSwitch" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="311" y="6" width="51" height="31"/>
<connections>
<action selector="toggleDefaultReaction:" destination="D6n-Kh-ydE" eventType="valueChanged" id="WZ3-CL-0ma"/>
</connections>
</switch>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enable" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GDm-2V-Cpa">
<rect key="frame" x="16" y="11" width="173" height="21"/>
<rect key="frame" x="16" y="11" width="184" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="Dj7-Q0-qBc" secondAttribute="trailing" constant="26" id="3VX-9T-e8F"/>
<constraint firstAttribute="trailing" secondItem="Dj7-Q0-qBc" secondAttribute="trailing" constant="15" id="3VX-9T-e8F"/>
<constraint firstItem="Dj7-Q0-qBc" firstAttribute="top" secondItem="xcP-b2-e1A" secondAttribute="top" constant="6" id="Awt-Ph-eh5"/>
<constraint firstAttribute="bottom" secondItem="GDm-2V-Cpa" secondAttribute="bottom" constant="11.5" id="Jls-ZB-Fzs"/>
<constraint firstItem="Dj7-Q0-qBc" firstAttribute="leading" secondItem="GDm-2V-Cpa" secondAttribute="trailing" constant="111" id="QX1-31-arh"/>
Expand Down
6 changes: 0 additions & 6 deletions Classes/Settings/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ NewIssueTableViewControllerDelegate {
signatureSwitch.isOn = Signature.enabled

updateBadge()
style()

NotificationCenter.default.addObserver(
self,
Expand Down Expand Up @@ -253,11 +252,6 @@ NewIssueTableViewControllerDelegate {
NotificationModelController.setReadOnOpen(open: markReadSwitch.isOn)
}

private func style() {
[backgroundFetchSwitch, markReadSwitch, signatureSwitch]
.forEach({ $0.onTintColor = Styles.Colors.Green.medium.color })
}

@IBAction func onSignature(_ sender: Any) {
Signature.enabled = signatureSwitch.isOn
}
Expand Down
18 changes: 18 additions & 0 deletions Classes/Views/StyledSwitch.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// 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
}

}
4 changes: 4 additions & 0 deletions Freetime.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
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 */; };
Expand Down Expand Up @@ -630,6 +631,7 @@
292FF8B81F303DB0009E63F7 /* IssuePreviewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IssuePreviewModel.swift; sourceTree = "<group>"; };
2930988C211F327B00E1178B /* Defaults+Reaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Defaults+Reaction.swift"; sourceTree = "<group>"; };
2930988E211F32D100E1178B /* DefaultReactionDetailController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultReactionDetailController.swift; sourceTree = "<group>"; };
29309894211FD7CC00E1178B /* StyledSwitch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StyledSwitch.swift; sourceTree = "<group>"; };
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 = "<group>"; };
29316DB41ECC7DEB007CAE3F /* ButtonCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ButtonCell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1738,6 +1740,7 @@
29C2950F1EC7B7FF00D46CD2 /* ShowMoreDetailsLabel.swift */,
295840701EE9F4D3007723C6 /* ShowMoreDetailsLabel+Date.swift */,
2971722C1F069E96005E43AC /* SpinnerCell.swift */,
29309894211FD7CC00E1178B /* StyledSwitch.swift */,
291929621F3FF0DA0012067B /* StyledTableCell.swift */,
299F63E7205F09900015D901 /* StyledTextRenderer+ListDiffable.swift */,
299F63D9205DD86E0015D901 /* StyledTextViewCell.swift */,
Expand Down Expand Up @@ -2950,6 +2953,7 @@
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 */,
Expand Down