Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit e84f3e4

Browse files
rizwankcernystrom
authored andcommitted
[ADD] "Try Beta" cell on Settings (#2346)
Adds "Try Beta" cell on Settings screen, On tap opens the testflight invite link in safari
1 parent 2963cce commit e84f3e4

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

Classes/Settings/Settings.storyboard

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<color key="separatorColor" red="0.73725490196078436" green="0.73333333333333328" blue="0.75686274509803919" alpha="1" colorSpace="calibratedRGB"/>
2121
<inset key="separatorInset" minX="16" minY="0.0" maxX="0.0" maxY="0.0"/>
2222
<view key="tableFooterView" contentMode="scaleToFill" id="jkq-3p-p02">
23-
<rect key="frame" x="0.0" y="693.5" width="375" height="44"/>
23+
<rect key="frame" x="0.0" y="737.5" width="375" height="44"/>
2424
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
2525
<subviews>
2626
<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">
@@ -365,12 +365,39 @@
365365
</tableViewCellContentView>
366366
<inset key="separatorInset" minX="16" minY="0.0" maxX="0.0" maxY="0.0"/>
367367
</tableViewCell>
368+
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="McK-NV-R4T" customClass="StyledTableCell" customModule="Freetime" customModuleProvider="target">
369+
<rect key="frame" x="0.0" y="595.5" width="375" height="44"/>
370+
<autoresizingMask key="autoresizingMask"/>
371+
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="McK-NV-R4T" id="M6U-hF-aEN">
372+
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
373+
<autoresizingMask key="autoresizingMask"/>
374+
<subviews>
375+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Try Beta" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NlT-LX-Mjr" customClass="SettingsLabel" customModule="Freetime" customModuleProvider="target">
376+
<rect key="frame" x="16" y="12" width="60.5" height="20"/>
377+
<fontDescription key="fontDescription" type="system" pointSize="16"/>
378+
<color key="textColor" red="0.14117647059999999" green="0.16078431369999999" blue="0.18039215689999999" alpha="1" colorSpace="calibratedRGB"/>
379+
<nil key="highlightedColor"/>
380+
</label>
381+
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="link-external" translatesAutoresizingMaskIntoConstraints="NO" id="WkB-US-Hey">
382+
<rect key="frame" x="341" y="9.5" width="19" height="25"/>
383+
<color key="tintColor" red="0.63921568630000003" green="0.66666666669999997" blue="0.69411764710000001" alpha="1" colorSpace="calibratedRGB"/>
384+
</imageView>
385+
</subviews>
386+
<constraints>
387+
<constraint firstAttribute="trailing" secondItem="WkB-US-Hey" secondAttribute="trailing" constant="15" id="Wxo-wT-v4F"/>
388+
<constraint firstItem="NlT-LX-Mjr" firstAttribute="leading" secondItem="M6U-hF-aEN" secondAttribute="leading" constant="16" id="Z5T-qn-lwO"/>
389+
<constraint firstItem="NlT-LX-Mjr" firstAttribute="centerY" secondItem="M6U-hF-aEN" secondAttribute="centerY" id="Za0-FK-HlJ"/>
390+
<constraint firstItem="WkB-US-Hey" firstAttribute="centerY" secondItem="M6U-hF-aEN" secondAttribute="centerY" id="gfl-J4-uVz"/>
391+
</constraints>
392+
</tableViewCellContentView>
393+
<inset key="separatorInset" minX="16" minY="0.0" maxX="0.0" maxY="0.0"/>
394+
</tableViewCell>
368395
</cells>
369396
</tableViewSection>
370397
<tableViewSection id="GTg-1u-cvV">
371398
<cells>
372399
<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">
373-
<rect key="frame" x="0.0" y="631.5" width="375" height="44"/>
400+
<rect key="frame" x="0.0" y="675.5" width="375" height="44"/>
374401
<autoresizingMask key="autoresizingMask"/>
375402
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Y2k-Zq-AUW" id="XiT-sq-B22">
376403
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
@@ -415,6 +442,7 @@
415442
<outlet property="setDefaultReaction" destination="gjX-57-UIr" id="aCf-HJ-KKS"/>
416443
<outlet property="signOutCell" destination="Y2k-Zq-AUW" id="QIk-J0-zqg"/>
417444
<outlet property="signatureSwitch" destination="ZWv-km-fU1" id="pf4-kH-RIp"/>
445+
<outlet property="tryTestFlightBetaCell" destination="McK-NV-R4T" id="Nrc-bw-IXY"/>
418446
<outlet property="versionLabel" destination="2bb-Lj-p2k" id="qDb-KP-pnk"/>
419447
<outlet property="viewSourceCell" destination="SAx-6B-29G" id="0Qs-cw-xwG"/>
420448
</connections>

Classes/Settings/SettingsViewController.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ NewIssueTableViewControllerDelegate {
2222
@IBOutlet weak var reviewAccessCell: StyledTableCell!
2323
@IBOutlet weak var githubStatusCell: StyledTableCell!
2424
@IBOutlet weak var reviewOnAppStoreCell: StyledTableCell!
25+
@IBOutlet weak var tryTestFlightBetaCell: StyledTableCell!
2526
@IBOutlet weak var reportBugCell: StyledTableCell!
2627
@IBOutlet weak var viewSourceCell: StyledTableCell!
2728
@IBOutlet weak var setDefaultReaction: StyledTableCell!
@@ -118,6 +119,8 @@ NewIssueTableViewControllerDelegate {
118119
onSetDefaultReaction()
119120
} else if cell === signOutCell {
120121
onSignOut()
122+
} else if cell === tryTestFlightBetaCell {
123+
onTryTestFlightBeta()
121124
}
122125
}
123126

@@ -191,6 +194,12 @@ NewIssueTableViewControllerDelegate {
191194
//showDefaultReactionMenu()
192195
}
193196

197+
func onTryTestFlightBeta() {
198+
guard let url = URL(string: "https://testflight.apple.com/join/QIVXLkkn")
199+
else { fatalError("Failed to decode testflight beta URL") }
200+
presentSafari(url: url)
201+
}
202+
194203
func onSignOut() {
195204
let title = NSLocalizedString("Are you sure?", comment: "")
196205
let message = NSLocalizedString("All of your accounts will be signed out, and their bookmarks will be removed. Do you want to continue?", comment: "")

0 commit comments

Comments
 (0)