Choose double tap (#2022)

* Addresses #2013

* fixed issue with creating reaction from string

* Switched from MenuController to Separate TableViewController

* Minor wording change

* Minor wording update

* Switched all cells to StyleTextCells

* UX fixes.
Migrated back into GitHawk Section
Removed None and replaced it with a switch

* Switched Set Double Tap Reaction -> Double Tap Reaction
This commit is contained in:
Ehud Adler
2018-08-11 11:02:29 -04:00
committed by Ryan Nystrom
parent e5cac53149
commit af4e0f8fb8
8 changed files with 399 additions and 16 deletions

View File

@@ -27,10 +27,7 @@ class IssueCommentBaseCell: UICollectionViewCell, UIGestureRecognizerDelegate {
contentView.clipsToBounds = true
doubleTapGesture.addTarget(self, action: #selector(onDoubleTap))
doubleTapGesture.numberOfTapsRequired = 2
doubleTapGesture.delegate = self
addGestureRecognizer(doubleTapGesture)
setUpDoubleTapIfNeeded()
collapseLayer.isHidden = true
collapseLayer.colors = [
@@ -98,6 +95,16 @@ class IssueCommentBaseCell: UICollectionViewCell, UIGestureRecognizerDelegate {
// MARK: Private API
private func setUpDoubleTapIfNeeded()
{
// If reaction is set to none, no need for the double-tap
if ReactionContent.defaultReaction == .__unknown("Disabled") { return }
doubleTapGesture.addTarget(self, action: #selector(onDoubleTap))
doubleTapGesture.numberOfTapsRequired = 2
doubleTapGesture.delegate = self
addGestureRecognizer(doubleTapGesture)
}
@objc private func onDoubleTap() {
doubleTapDelegate?.didDoubleTap(cell: self)
}

View File

@@ -442,7 +442,7 @@ final class IssueCommentSectionController:
// MARK: IssueCommentDoubleTapDelegate
func didDoubleTap(cell: IssueCommentBaseCell) {
let reaction = ReactionContent.thumbsUp
let reaction = ReactionContent.defaultReaction
guard let reactions = reactionMutation ?? self.object?.reactions,
!reactions.viewerDidReact(reaction: reaction)
else { return }

View File

@@ -0,0 +1,24 @@
//
// Defaults+Reaction.swift
// Freetime
//
// Created by Ehud Adler on 7/30/18.
// Copyright © 2018 Ryan Nystrom. All rights reserved.
//
extension UserDefaults {
// Stores ReactionContent in string form but
// accepts and returns in original form
static func setDefault(reaction: ReactionContent)
{
standard.set(reaction.emoji, forKey: "default.reaction")
}
static var getDefaultReaction: ReactionContent
{
guard let reactionAsString = standard.string(forKey: "default.reaction")
else { return ReactionContent.thumbsUp }
let reaction = reactionAsString.reaction
return reaction
}
}

View File

@@ -15,8 +15,26 @@ extension ReactionContent {
case .heart: return "❤️"
case .hooray: return "🎉"
case .laugh: return "😄"
case .__unknown("Disabled"): return "Disabled"
case .thumbsUp, .__unknown: return "👍"
case .thumbsDown: return "👎"
}
}
static var defaultReaction: ReactionContent {
return UserDefaults.getDefaultReaction
}
}
extension String {
var reaction: ReactionContent {
switch self {
case "😕": return .confused
case "❤️": return .heart
case "🎉": return .hooray
case "😄": return .laugh
case "👍": return .thumbsUp
case "👎": return .thumbsDown
default: return .__unknown(self)
}
}
}

View File

@@ -0,0 +1,118 @@
//
// DefaultReactionSubController.swift
// Freetime
//
// Created by Ehud Adler on 8/5/18.
// Copyright © 2018 Ryan Nystrom. All rights reserved.
//
import UIKit
class DefaultReactionDetailController: UITableViewController {
@IBOutlet var thumbsUpCell: UITableViewCell!
@IBOutlet var thumbsDownCell: UITableViewCell!
@IBOutlet var laughCell: UITableViewCell!
@IBOutlet var hoorayCell: UITableViewCell!
@IBOutlet var confusedCell: UITableViewCell!
@IBOutlet var heartCell: UITableViewCell!
@IBOutlet var enabledSwitch: UISwitch!
override func viewDidLoad() {
super.viewDidLoad()
checkCurrentDefault()
tableView.reloadData()
}
override func numberOfSections(in tableView: UITableView) -> Int {
return enabledSwitch.isOn ? 2 : 1
}
private func checkCurrentDefault() {
switch (ReactionContent.defaultReaction)
{
case ReactionContent.thumbsUp:
updateCells(cell: thumbsUpCell)
case ReactionContent.thumbsDown:
updateCells(cell: thumbsDownCell)
case ReactionContent.laugh:
updateCells(cell: laughCell)
case ReactionContent.hooray:
updateCells(cell: hoorayCell)
case ReactionContent.confused:
updateCells(cell: confusedCell)
case ReactionContent.heart:
updateCells(cell: heartCell)
case ReactionContent.__unknown("Disabled"):
enabledSwitch.isOn = false
default:
updateCells(cell: thumbsUpCell)
}
}
private func updateCells(cell: UITableViewCell) {
rz_smoothlyDeselectRows(tableView: self.tableView)
// Reset all to none
thumbsUpCell.accessoryType = .none
thumbsDownCell.accessoryType = .none
laughCell.accessoryType = .none
hoorayCell.accessoryType = .none
confusedCell.accessoryType = .none
heartCell.accessoryType = .none
// Set proper cell to check
cell.accessoryType = .checkmark
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: trueUnlessReduceMotionEnabled)
let cell = tableView.cellForRow(at: indexPath)
switch cell {
case thumbsUpCell:
updateDefaultReaction(.thumbsUp)
case thumbsDownCell:
updateDefaultReaction(.thumbsDown)
case laughCell:
updateDefaultReaction(.laugh)
case hoorayCell:
updateDefaultReaction(.hooray)
case confusedCell:
updateDefaultReaction(.confused)
case heartCell:
updateDefaultReaction(.heart)
default:
break
}
}
@IBAction func toggleDefaultReaction(_ sender: Any) {
if(enabledSwitch.isOn) {
updateDefaultReaction(.thumbsUp)
} else {
updateDefaultReaction(.__unknown("Disabled"))
}
updateSections()
}
private func updateDefaultReaction(_ reaction: ReactionContent) {
UserDefaults.setDefault(reaction: reaction)
checkCurrentDefault()
}
private func updateSections() {
tableView.performBatchUpdates({
if(enabledSwitch.isOn) {
self.tableView.insertSections(IndexSet(integer: 1), with: .top)
} else {
self.tableView.deleteSections(IndexSet(integer: 1), with: .top)
}
}, completion: nil)
}
}

View File

@@ -20,7 +20,7 @@
<color key="separatorColor" red="0.73725490196078436" green="0.73333333333333328" blue="0.75686274509803919" alpha="1" colorSpace="calibratedRGB"/>
<inset key="separatorInset" minX="16" minY="0.0" maxX="0.0" maxY="0.0"/>
<view key="tableFooterView" contentMode="scaleToFill" id="jkq-3p-p02">
<rect key="frame" x="0.0" y="605.5" width="375" height="44"/>
<rect key="frame" x="0.0" y="649.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Version 1.4.0 (1207)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2bb-Lj-p2k" customClass="SettingsLabel" customModule="Freetime" customModuleProvider="target">
@@ -161,9 +161,37 @@
</tableViewCellContentView>
<inset key="separatorInset" minX="16" minY="0.0" maxX="0.0" maxY="0.0"/>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="pnm-5p-yC5" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="wm1-n0-0PA" detailTextLabel="UHH-lU-DUe" style="IBUITableViewCellStyleValue1" id="gjX-57-UIr" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="0.0" y="331.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="gjX-57-UIr" id="RUD-Yw-Zkq">
<rect key="frame" x="0.0" y="0.0" width="341" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Double Tap Reaction" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="wm1-n0-0PA">
<rect key="frame" x="16" y="12" width="158" height="20.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.14117647059999999" green="0.16078431369999999" blue="0.18039215689999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="UHH-lU-DUe">
<rect key="frame" x="298.5" y="13" width="41.5" height="19.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<inset key="separatorInset" minX="16" minY="0.0" maxX="0.0" maxY="0.0"/>
<connections>
<segue destination="D6n-Kh-ydE" kind="show" id="t7M-y6-pfg"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="pnm-5p-yC5" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="0.0" y="375.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="pnm-5p-yC5" id="Cu2-kJ-7ah">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
@@ -203,7 +231,7 @@
<inset key="separatorInset" minX="16" minY="0.0" maxX="0.0" maxY="0.0"/>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="U6l-Zw-17s" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="0.0" y="375.5" width="375" height="44"/>
<rect key="frame" x="0.0" y="419.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="U6l-Zw-17s" id="cMZ-jh-esi">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
@@ -232,7 +260,7 @@
<inset key="separatorInset" minX="16" minY="0.0" maxX="0.0" maxY="0.0"/>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="0eH-mW-WpD" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="0.0" y="419.5" width="375" height="44"/>
<rect key="frame" x="0.0" y="463.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="0eH-mW-WpD" id="dAx-L4-nLX">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
@@ -261,7 +289,7 @@
<inset key="separatorInset" minX="16" minY="0.0" maxX="0.0" maxY="0.0"/>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="Z8j-JQ-qiy" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="0.0" y="463.5" width="375" height="44"/>
<rect key="frame" x="0.0" y="507.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Z8j-JQ-qiy" id="uAb-lB-GZA">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
@@ -292,7 +320,7 @@
<tableViewSection id="GTg-1u-cvV">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="ku5-ZI-OG9" style="IBUITableViewCellStyleDefault" id="Y2k-Zq-AUW" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="0.0" y="543.5" width="375" height="44"/>
<rect key="frame" x="0.0" y="587.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Y2k-Zq-AUW" id="XiT-sq-B22">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
@@ -324,12 +352,14 @@
<outlet property="apiStatusView" destination="1mP-Dr-7rt" id="f66-HG-AkG"/>
<outlet property="backgroundFetchSwitch" destination="FvK-93-raA" id="Huy-vc-MoM"/>
<outlet property="badgeCell" destination="pnm-5p-yC5" id="hdC-aO-QSy"/>
<outlet property="defaultReactionLabel" destination="UHH-lU-DUe" id="ew2-Hr-5UH"/>
<outlet property="githubStatusCell" destination="x9n-2O-buf" id="xc3-W3-bZW"/>
<outlet property="markReadSwitch" destination="8dQ-YU-Yuw" id="5jz-5d-osk"/>
<outlet property="openSettingsButton" destination="36B-Ge-m5V" id="tsc-wS-3vb"/>
<outlet property="reportBugCell" destination="WwO-m1-s3q" id="nCb-BL-DRJ"/>
<outlet property="reviewAccessCell" destination="TXs-sw-hO1" id="10W-u8-ofC"/>
<outlet property="reviewOnAppStoreCell" destination="Z8j-JQ-qiy" id="QRZ-5e-WQi"/>
<outlet property="setDefaultReaction" destination="gjX-57-UIr" id="aCf-HJ-KKS"/>
<outlet property="signOutCell" destination="Y2k-Zq-AUW" id="QIk-J0-zqg"/>
<outlet property="signatureSwitch" destination="ZWv-km-fU1" id="pf4-kH-RIp"/>
<outlet property="versionLabel" destination="2bb-Lj-p2k" id="qDb-KP-pnk"/>
@@ -340,6 +370,178 @@
</objects>
<point key="canvasLocation" x="-940" y="-131.78410794602701"/>
</scene>
<!--Double Tap Reaction-->
<scene sceneID="7SH-vC-PA6">
<objects>
<tableViewController id="D6n-Kh-ydE" customClass="DefaultReactionDetailController" customModule="Freetime" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="bOV-gp-5Q9">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<color key="separatorColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<sections>
<tableViewSection id="um3-Ah-wWf">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="UJb-ob-yCk" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="0.0" y="35" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="UJb-ob-yCk" id="xcP-b2-e1A">
<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"/>
<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"/>
<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 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"/>
<constraint firstItem="GDm-2V-Cpa" firstAttribute="top" secondItem="xcP-b2-e1A" secondAttribute="top" constant="11" id="WWF-rW-rNm"/>
<constraint firstItem="GDm-2V-Cpa" firstAttribute="leading" secondItem="xcP-b2-e1A" secondAttribute="leading" constant="16" id="ZAF-0a-1CO"/>
<constraint firstAttribute="bottom" secondItem="Dj7-Q0-qBc" secondAttribute="bottom" constant="6.5" id="nBa-qM-kEa"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Reactions" id="kLr-tw-ovq">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" textLabel="upo-Hg-6yy" style="IBUITableViewCellStyleDefault" id="qc4-aU-1zn" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="0.0" y="135" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="qc4-aU-1zn" id="aLV-iI-cJa">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="👍 Thumbs Up" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="upo-Hg-6yy">
<rect key="frame" x="16" y="0.0" width="343" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" textLabel="9GJ-Bs-G8n" style="IBUITableViewCellStyleDefault" id="ISD-qw-50W" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="0.0" y="179" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="ISD-qw-50W" id="ohK-7Z-xlK">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="👎 Thumbs Down" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="9GJ-Bs-G8n">
<rect key="frame" x="16" y="0.0" width="343" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" textLabel="msM-LM-9Ff" style="IBUITableViewCellStyleDefault" id="jkZ-Ag-Uss" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="0.0" y="223" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="jkZ-Ag-Uss" id="fWt-px-f3j">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="😄 Laugh" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="msM-LM-9Ff">
<rect key="frame" x="16" y="0.0" width="343" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" textLabel="bP0-mi-UfX" style="IBUITableViewCellStyleDefault" id="NBn-uY-24s" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="0.0" y="267" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="NBn-uY-24s" id="VkR-jV-ZfS">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="🎉 Hooray" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="bP0-mi-UfX">
<rect key="frame" x="16" y="0.0" width="343" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" textLabel="WYa-tH-X3b" style="IBUITableViewCellStyleDefault" id="X0F-M1-kZ7" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="0.0" y="311" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="X0F-M1-kZ7" id="iPc-xz-C7d">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="😕 Confused" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="WYa-tH-X3b">
<rect key="frame" x="16" y="0.0" width="343" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" textLabel="Qnn-4C-dZV" style="IBUITableViewCellStyleDefault" id="lKi-qn-1Lw" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="0.0" y="355" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="lKi-qn-1Lw" id="9kY-Kq-xV0">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="❤️ Heart" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Qnn-4C-dZV">
<rect key="frame" x="16" y="0.0" width="343" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="D6n-Kh-ydE" id="QDW-xY-YYy"/>
<outlet property="delegate" destination="D6n-Kh-ydE" id="kRN-6X-8be"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Double Tap Reaction" id="LjI-zd-eqP"/>
<connections>
<outlet property="confusedCell" destination="X0F-M1-kZ7" id="bvF-iv-PVz"/>
<outlet property="enabledSwitch" destination="Dj7-Q0-qBc" id="UlX-Jw-KJM"/>
<outlet property="heartCell" destination="lKi-qn-1Lw" id="c6c-gg-fqo"/>
<outlet property="hoorayCell" destination="NBn-uY-24s" id="90x-RY-v8E"/>
<outlet property="laughCell" destination="jkZ-Ag-Uss" id="ooc-D4-RUk"/>
<outlet property="thumbsDownCell" destination="ISD-qw-50W" id="dcM-3X-5h9"/>
<outlet property="thumbsUpCell" destination="qc4-aU-1zn" id="yoU-W7-RdX"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="2Iq-39-nex" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-215" y="-131"/>
</scene>
<!--Accounts-->
<scene sceneID="Xjx-IC-OZR">
<objects>
@@ -384,7 +586,7 @@
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="YHM-PS-ThT" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="862" y="-132"/>
<point key="canvasLocation" x="1420" y="-133"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="D9x-gg-9aE">
@@ -418,7 +620,7 @@
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="OVs-04-lfm" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="57" y="-131"/>
<point key="canvasLocation" x="615" y="-132"/>
</scene>
</scenes>
<resources>

View File

@@ -27,6 +27,7 @@ NewIssueTableViewControllerDelegate {
@IBOutlet weak var reviewOnAppStoreCell: StyledTableCell!
@IBOutlet weak var reportBugCell: StyledTableCell!
@IBOutlet weak var viewSourceCell: StyledTableCell!
@IBOutlet weak var setDefaultReaction: StyledTableCell!
@IBOutlet weak var signOutCell: StyledTableCell!
@IBOutlet weak var backgroundFetchSwitch: UISwitch!
@IBOutlet weak var openSettingsButton: UIButton!
@@ -36,8 +37,9 @@ NewIssueTableViewControllerDelegate {
@IBOutlet weak var apiStatusLabel: UILabel!
@IBOutlet weak var apiStatusView: UIView!
@IBOutlet weak var signatureSwitch: UISwitch!
override func viewDidLoad() {
@IBOutlet weak var defaultReactionLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
versionLabel.text = Bundle.main.prettyVersionString
@@ -58,6 +60,9 @@ NewIssueTableViewControllerDelegate {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
defaultReactionLabel.text = ReactionContent.defaultReaction.emoji
rz_smoothlyDeselectRows(tableView: tableView)
accountsCell.detailTextLabel?.text = sessionManager.focusedUserSession?.username ?? Constants.Strings.unknown
@@ -108,6 +113,8 @@ NewIssueTableViewControllerDelegate {
onReportBug()
} else if cell === viewSourceCell {
onViewSource()
} else if cell === setDefaultReaction {
onSetDefaultReaction()
} else if cell === signOutCell {
onSignOut()
}
@@ -177,6 +184,10 @@ NewIssueTableViewControllerDelegate {
let repoViewController = RepositoryViewController(client: client, repo: repo)
navigationController?.showDetailViewController(repoViewController, sender: self)
}
func onSetDefaultReaction() {
//showDefaultReactionMenu()
}
func onSignOut() {
let title = NSLocalizedString("Are you sure?", comment: "")

View File

@@ -27,5 +27,8 @@ class StyledTableCell: UITableViewCell {
background.backgroundColor = Styles.Colors.Gray.alphaLighter
selectedBackgroundView = background
}
override var canBecomeFirstResponder: Bool {
return true
}
}