forked from shadowfacts/Tusker
Extract Appearance preferences into separate controller
This commit is contained in:
parent
225c7e30fc
commit
a6373f7e10
|
@ -100,6 +100,7 @@
|
|||
D6757A7E2157E02600721E32 /* XCBRequestSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6757A7D2157E02600721E32 /* XCBRequestSpec.swift */; };
|
||||
D6757A822157E8FA00721E32 /* XCBSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6757A812157E8FA00721E32 /* XCBSession.swift */; };
|
||||
D679C09F215850EF00DA27FE /* XCBActions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D679C09E215850EF00DA27FE /* XCBActions.swift */; };
|
||||
D67E0513216438A7000E0927 /* AppearanceTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D67E0512216438A7000E0927 /* AppearanceTableViewController.swift */; };
|
||||
D6BED170212663DA00F02DA0 /* SwiftSoup.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D6BED16E212663DA00F02DA0 /* SwiftSoup.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
D6BED174212667E900F02DA0 /* StatusTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6BED173212667E900F02DA0 /* StatusTableViewCell.swift */; };
|
||||
D6C693CA2161253F007D6A6D /* SilentActionPermissionsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6C693C92161253F007D6A6D /* SilentActionPermissionsTableViewController.swift */; };
|
||||
|
@ -280,6 +281,7 @@
|
|||
D6757A7D2157E02600721E32 /* XCBRequestSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCBRequestSpec.swift; sourceTree = "<group>"; };
|
||||
D6757A812157E8FA00721E32 /* XCBSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCBSession.swift; sourceTree = "<group>"; };
|
||||
D679C09E215850EF00DA27FE /* XCBActions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCBActions.swift; sourceTree = "<group>"; };
|
||||
D67E0512216438A7000E0927 /* AppearanceTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppearanceTableViewController.swift; sourceTree = "<group>"; };
|
||||
D6BED16E212663DA00F02DA0 /* SwiftSoup.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SwiftSoup.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
D6BED173212667E900F02DA0 /* StatusTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusTableViewCell.swift; sourceTree = "<group>"; };
|
||||
D6C693C92161253F007D6A6D /* SilentActionPermissionsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SilentActionPermissionsTableViewController.swift; sourceTree = "<group>"; };
|
||||
|
@ -551,6 +553,7 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
D663626521360DD700C9CBA2 /* Preferences.storyboard */,
|
||||
D67E0512216438A7000E0927 /* AppearanceTableViewController.swift */,
|
||||
D663626721360E2C00C9CBA2 /* PreferencesTableViewController.swift */,
|
||||
D641C78E213DF2AA004B4513 /* VisibilityTableViewController.swift */,
|
||||
D6C693C92161253F007D6A6D /* SilentActionPermissionsTableViewController.swift */,
|
||||
|
@ -1105,6 +1108,7 @@
|
|||
D663626821360E2C00C9CBA2 /* PreferencesTableViewController.swift in Sources */,
|
||||
D64F80E2215875CC00BEF393 /* XCBActionType.swift in Sources */,
|
||||
D66362752137068A00C9CBA2 /* Visibility+Helpers.swift in Sources */,
|
||||
D67E0513216438A7000E0927 /* AppearanceTableViewController.swift in Sources */,
|
||||
D6C693FC2162FE6F007D6A6D /* LoadingViewController.swift in Sources */,
|
||||
D646C95A213B5D0500269FB5 /* LargeImageInteractionController.swift in Sources */,
|
||||
D6F953EC212519E700CF0F2B /* TimelineTableViewController.swift in Sources */,
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
//
|
||||
// AppearanceTableViewController.swift
|
||||
// Tusker
|
||||
//
|
||||
// Created by Shadowfacts on 10/2/18.
|
||||
// Copyright © 2018 Shadowfacts. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class AppearanceTableViewController: UITableViewController {
|
||||
|
||||
@IBOutlet weak var showRepliesInProfilesSwitch: UISwitch!
|
||||
@IBOutlet weak var circularAvatarsSwitch: UISwitch!
|
||||
@IBOutlet weak var hideCustomEmojiInUsernamesSwitch: UISwitch!
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
showRepliesInProfilesSwitch.setOn(Preferences.shared.showRepliesInProfiles, animated: false)
|
||||
circularAvatarsSwitch.setOn(Preferences.shared.avatarStyle == .circle, animated: false)
|
||||
hideCustomEmojiInUsernamesSwitch.setOn(Preferences.shared.hideCustomEmojiInUsernames, animated: false)
|
||||
}
|
||||
|
||||
/*
|
||||
// MARK: - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
||||
// Get the new view controller using segue.destination.
|
||||
// Pass the selected object to the new view controller.
|
||||
}
|
||||
*/
|
||||
|
||||
// MARK: - Interaction
|
||||
|
||||
@IBAction func showRepliesInProfilesChanged(_ sender: Any) {
|
||||
Preferences.shared.showRepliesInProfiles = showRepliesInProfilesSwitch.isOn
|
||||
}
|
||||
|
||||
@IBAction func circularAvatarsChanged(_ sender: Any) {
|
||||
Preferences.shared.avatarStyle = circularAvatarsSwitch.isOn ? .circle : .roundRect
|
||||
}
|
||||
|
||||
@IBAction func hideCustomEmojiInUsernamesChanged(_ sender: Any) {
|
||||
Preferences.shared.hideCustomEmojiInUsernames = hideCustomEmojiInUsernamesSwitch.isOn
|
||||
}
|
||||
|
||||
}
|
|
@ -17,98 +17,37 @@
|
|||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
|
||||
<sections>
|
||||
<tableViewSection id="9cB-GR-Pdp">
|
||||
<tableViewSection id="L3p-2V-jca">
|
||||
<cells>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="ffB-1O-bFL">
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="RYV-cK-4my">
|
||||
<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" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="ffB-1O-bFL" id="PFp-4A-2ka">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="RYV-cK-4my" id="Vmf-7I-FNS">
|
||||
<rect key="frame" x="0.0" y="0.0" width="341" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Show Replies in Profiles" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DkZ-zq-Q4w">
|
||||
<rect key="frame" x="16" y="11.5" width="182" height="21"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Appearance" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Mb9-q2-iNW">
|
||||
<rect key="frame" x="16" y="11.5" width="93" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="iCG-F0-6ZK">
|
||||
<rect key="frame" x="308" y="6.5" width="51" height="31"/>
|
||||
<connections>
|
||||
<action selector="showRepliesInProfilesChanged:" destination="ArB-e7-yko" eventType="valueChanged" id="viU-pi-47n"/>
|
||||
</connections>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="iCG-F0-6ZK" firstAttribute="centerY" secondItem="PFp-4A-2ka" secondAttribute="centerY" id="7aD-RX-CTV"/>
|
||||
<constraint firstAttribute="trailing" secondItem="iCG-F0-6ZK" secondAttribute="trailing" constant="18" id="Vns-XW-ptr"/>
|
||||
<constraint firstItem="DkZ-zq-Q4w" firstAttribute="centerY" secondItem="PFp-4A-2ka" secondAttribute="centerY" id="lGl-bs-NXC"/>
|
||||
<constraint firstItem="DkZ-zq-Q4w" firstAttribute="leading" secondItem="PFp-4A-2ka" secondAttribute="leadingMargin" id="s8Y-iu-VJ6"/>
|
||||
<constraint firstItem="Mb9-q2-iNW" firstAttribute="centerY" secondItem="Vmf-7I-FNS" secondAttribute="centerY" id="3QP-UK-jxr"/>
|
||||
<constraint firstItem="Mb9-q2-iNW" firstAttribute="leading" secondItem="Vmf-7I-FNS" secondAttribute="leadingMargin" id="yi1-5N-Tbj"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="CFN-UV-Jyn">
|
||||
<rect key="frame" x="0.0" y="79" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="CFN-UV-Jyn" id="dcx-Vr-nHa">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Use Circular Avatars" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-z5-4ad">
|
||||
<rect key="frame" x="16" y="11.5" width="155" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="EGF-Yh-zaU">
|
||||
<rect key="frame" x="308" y="6.5" width="51" height="31"/>
|
||||
<connections>
|
||||
<action selector="circularAvatarsChanged:" destination="ArB-e7-yko" eventType="valueChanged" id="ZvM-jR-xgg"/>
|
||||
<segue destination="oM9-mi-wRc" kind="show" id="G45-fS-Nsj"/>
|
||||
</connections>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="GJd-z5-4ad" firstAttribute="centerY" secondItem="dcx-Vr-nHa" secondAttribute="centerY" id="BWk-p9-4xR"/>
|
||||
<constraint firstItem="EGF-Yh-zaU" firstAttribute="centerY" secondItem="dcx-Vr-nHa" secondAttribute="centerY" id="KOD-1g-yqy"/>
|
||||
<constraint firstAttribute="trailing" secondItem="EGF-Yh-zaU" secondAttribute="trailing" constant="18" id="Ncq-4V-0mW"/>
|
||||
<constraint firstItem="GJd-z5-4ad" firstAttribute="leading" secondItem="dcx-Vr-nHa" secondAttribute="leadingMargin" id="pFh-IN-rcq"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="Kaj-yB-gMg">
|
||||
<rect key="frame" x="0.0" y="123" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Kaj-yB-gMg" id="oE9-YZ-9kb">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hide Custom Emoji in Usernames" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4bl-xs-4DS">
|
||||
<rect key="frame" x="16" y="11.5" width="255" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vWi-fm-tjV">
|
||||
<rect key="frame" x="308" y="6.5" width="51" height="31"/>
|
||||
<connections>
|
||||
<action selector="hideCustomEmojiInUsernamesChanged:" destination="ArB-e7-yko" eventType="valueChanged" id="1Tm-o6-ssu"/>
|
||||
</connections>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="vWi-fm-tjV" firstAttribute="centerY" secondItem="oE9-YZ-9kb" secondAttribute="centerY" id="64b-0G-5hd"/>
|
||||
<constraint firstItem="4bl-xs-4DS" firstAttribute="centerY" secondItem="oE9-YZ-9kb" secondAttribute="centerY" id="9ws-m8-Hf6"/>
|
||||
<constraint firstItem="4bl-xs-4DS" firstAttribute="leading" secondItem="oE9-YZ-9kb" secondAttribute="leadingMargin" id="nTB-KX-h8P"/>
|
||||
<constraint firstAttribute="trailing" secondItem="vWi-fm-tjV" secondAttribute="trailing" constant="18" id="xM8-1M-HWj"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
</cells>
|
||||
</tableViewSection>
|
||||
<tableViewSection id="1m2-cM-16u">
|
||||
<cells>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" id="8Y3-if-FhA">
|
||||
<rect key="frame" x="0.0" y="203" width="375" height="44"/>
|
||||
<rect key="frame" x="0.0" y="115" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="8Y3-if-FhA" id="ZpZ-BB-0Ti">
|
||||
<rect key="frame" x="0.0" y="0.0" width="341" height="43.5"/>
|
||||
|
@ -143,7 +82,7 @@
|
|||
<tableViewSection id="QnL-PI-wDE">
|
||||
<cells>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="RwH-Ti-TH8">
|
||||
<rect key="frame" x="0.0" y="283" width="375" height="44"/>
|
||||
<rect key="frame" x="0.0" y="195" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="RwH-Ti-TH8" id="NJF-ED-5cF">
|
||||
<rect key="frame" x="0.0" y="0.0" width="341" height="43.5"/>
|
||||
|
@ -175,16 +114,128 @@
|
|||
</tableView>
|
||||
<navigationItem key="navigationItem" title="Preferences" id="dN7-yl-voz"/>
|
||||
<connections>
|
||||
<outlet property="circularAvatarsSwitch" destination="EGF-Yh-zaU" id="jAS-4F-WwG"/>
|
||||
<outlet property="defaultPostVisibilityLabel" destination="RXt-HZ-X6X" id="KEB-sg-UNE"/>
|
||||
<outlet property="hideCustomEmojiInUsernamesSwitch" destination="vWi-fm-tjV" id="8zA-bD-SE3"/>
|
||||
<outlet property="showRepliesInProfilesSwitch" destination="iCG-F0-6ZK" id="p5E-oK-ZYl"/>
|
||||
</connections>
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="GBL-Cz-yNZ" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="826" y="-234"/>
|
||||
</scene>
|
||||
<!--Appearance-->
|
||||
<scene sceneID="Dvq-ZP-V7u">
|
||||
<objects>
|
||||
<tableViewController id="oM9-mi-wRc" customClass="AppearanceTableViewController" customModule="Tusker" 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="zP4-rb-dsB">
|
||||
<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"/>
|
||||
<sections>
|
||||
<tableViewSection id="gwC-db-0ec">
|
||||
<cells>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="cSJ-mP-CMQ">
|
||||
<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" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="cSJ-mP-CMQ" id="K0u-vm-1cA">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Show Replies in Profiles" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lhL-hU-TwV">
|
||||
<rect key="frame" x="16" y="11.5" width="182" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1r3-n8-8xm">
|
||||
<rect key="frame" x="308" y="6.5" width="51" height="31"/>
|
||||
<connections>
|
||||
<action selector="showRepliesInProfilesChanged:" destination="oM9-mi-wRc" eventType="valueChanged" id="2T6-AX-x81"/>
|
||||
<action selector="showRepliesInProfilesChanged:" destination="ArB-e7-yko" eventType="valueChanged" id="4Dp-OY-jWt"/>
|
||||
</connections>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="lhL-hU-TwV" firstAttribute="leading" secondItem="K0u-vm-1cA" secondAttribute="leadingMargin" id="QM5-y3-iGB"/>
|
||||
<constraint firstItem="lhL-hU-TwV" firstAttribute="centerY" secondItem="K0u-vm-1cA" secondAttribute="centerY" id="Xq4-5w-m1n"/>
|
||||
<constraint firstItem="1r3-n8-8xm" firstAttribute="centerY" secondItem="K0u-vm-1cA" secondAttribute="centerY" id="aC7-WR-8R4"/>
|
||||
<constraint firstAttribute="trailing" secondItem="1r3-n8-8xm" secondAttribute="trailing" constant="18" id="co5-zL-DP5"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="KRM-HM-H3l">
|
||||
<rect key="frame" x="0.0" y="79" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="KRM-HM-H3l" id="1OA-09-UkD">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Use Circular Avatars" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="U0d-1s-1mq">
|
||||
<rect key="frame" x="16" y="11.5" width="155" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Huh-Lk-M4J">
|
||||
<rect key="frame" x="308" y="6.5" width="51" height="31"/>
|
||||
<connections>
|
||||
<action selector="circularAvatarsChanged:" destination="oM9-mi-wRc" eventType="valueChanged" id="Jd1-cu-AUu"/>
|
||||
</connections>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="U0d-1s-1mq" firstAttribute="leading" secondItem="1OA-09-UkD" secondAttribute="leadingMargin" id="RpK-YC-s0g"/>
|
||||
<constraint firstItem="U0d-1s-1mq" firstAttribute="centerY" secondItem="1OA-09-UkD" secondAttribute="centerY" id="TzO-tq-5ab"/>
|
||||
<constraint firstItem="Huh-Lk-M4J" firstAttribute="centerY" secondItem="1OA-09-UkD" secondAttribute="centerY" id="c9P-0f-jL9"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Huh-Lk-M4J" secondAttribute="trailing" constant="18" id="dZP-bT-whk"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="KoZ-lA-gof">
|
||||
<rect key="frame" x="0.0" y="123" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="KoZ-lA-gof" id="ZiQ-kq-AHv">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hide Custom Emoji in Usernames" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fM0-HA-l0w">
|
||||
<rect key="frame" x="16" y="11.5" width="255" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="XJI-I2-vRF">
|
||||
<rect key="frame" x="308" y="6.5" width="51" height="31"/>
|
||||
<connections>
|
||||
<action selector="hideCustomEmojiInUsernamesChanged:" destination="oM9-mi-wRc" eventType="valueChanged" id="dPX-Di-Ie4"/>
|
||||
</connections>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="fM0-HA-l0w" firstAttribute="leading" secondItem="ZiQ-kq-AHv" secondAttribute="leadingMargin" id="CkT-N0-BAq"/>
|
||||
<constraint firstItem="fM0-HA-l0w" firstAttribute="centerY" secondItem="ZiQ-kq-AHv" secondAttribute="centerY" id="ko9-pK-miM"/>
|
||||
<constraint firstAttribute="trailing" secondItem="XJI-I2-vRF" secondAttribute="trailing" constant="18" id="oCf-HZ-z6n"/>
|
||||
<constraint firstItem="XJI-I2-vRF" firstAttribute="centerY" secondItem="ZiQ-kq-AHv" secondAttribute="centerY" id="tti-fN-d32"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
</cells>
|
||||
</tableViewSection>
|
||||
</sections>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="oM9-mi-wRc" id="ubt-jB-z6P"/>
|
||||
<outlet property="delegate" destination="oM9-mi-wRc" id="Mal-XI-CBW"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
<navigationItem key="navigationItem" title="Appearance" id="Ygz-zL-xT0"/>
|
||||
<connections>
|
||||
<outlet property="circularAvatarsSwitch" destination="Huh-Lk-M4J" id="D0Q-1G-ZaY"/>
|
||||
<outlet property="hideCustomEmojiInUsernamesSwitch" destination="XJI-I2-vRF" id="yOV-Zc-uPV"/>
|
||||
<outlet property="showRepliesInProfilesSwitch" destination="1r3-n8-8xm" id="dfM-E0-fYY"/>
|
||||
</connections>
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="Rkj-gt-dSt" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="18" y="537"/>
|
||||
</scene>
|
||||
<!--Default Post Visibility-->
|
||||
<scene sceneID="z9g-ND-zkU">
|
||||
<objects>
|
||||
|
@ -222,7 +273,7 @@
|
|||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="JNY-yb-Efi" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1612" y="-566"/>
|
||||
<point key="canvasLocation" x="825" y="537"/>
|
||||
</scene>
|
||||
<!--Advanced-->
|
||||
<scene sceneID="xgj-Fx-53j">
|
||||
|
@ -270,7 +321,7 @@
|
|||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="4wC-Hp-AZk" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1618" y="114"/>
|
||||
<point key="canvasLocation" x="1612" y="538"/>
|
||||
</scene>
|
||||
<!--Silent Actions-->
|
||||
<scene sceneID="Vyy-sh-Tca">
|
||||
|
@ -289,7 +340,7 @@
|
|||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="Db4-9Z-l6U" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="2404" y="110"/>
|
||||
<point key="canvasLocation" x="1612" y="1280"/>
|
||||
</scene>
|
||||
<!--Preferences-->
|
||||
<scene sceneID="3UV-H1-kd4">
|
||||
|
@ -307,7 +358,7 @@
|
|||
</navigationController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="Otz-oe-r9y" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-23" y="-234"/>
|
||||
<point key="canvasLocation" x="825" y="-1025"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
|
|
|
@ -15,19 +15,9 @@ class PreferencesTableViewController: UITableViewController {
|
|||
return navigationController
|
||||
}
|
||||
|
||||
@IBOutlet weak var showRepliesInProfilesSwitch: UISwitch!
|
||||
@IBOutlet weak var circularAvatarsSwitch: UISwitch!
|
||||
@IBOutlet weak var hideCustomEmojiInUsernamesSwitch: UISwitch!
|
||||
|
||||
@IBOutlet weak var defaultPostVisibilityLabel: UILabel!
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
showRepliesInProfilesSwitch.setOn(Preferences.shared.showRepliesInProfiles, animated: false)
|
||||
circularAvatarsSwitch.setOn(Preferences.shared.avatarStyle == .circle, animated: false)
|
||||
hideCustomEmojiInUsernamesSwitch.setOn(Preferences.shared.hideCustomEmojiInUsernames, animated: false)
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
|
@ -44,16 +34,4 @@ class PreferencesTableViewController: UITableViewController {
|
|||
}
|
||||
*/
|
||||
|
||||
@IBAction func showRepliesInProfilesChanged(_ sender: Any) {
|
||||
Preferences.shared.showRepliesInProfiles = showRepliesInProfilesSwitch.isOn
|
||||
}
|
||||
|
||||
@IBAction func circularAvatarsChanged(_ sender: Any) {
|
||||
Preferences.shared.avatarStyle = circularAvatarsSwitch.isOn ? .circle : .roundRect
|
||||
}
|
||||
|
||||
@IBAction func hideCustomEmojiInUsernamesChanged(_ sender: Any) {
|
||||
Preferences.shared.hideCustomEmojiInUsernames = hideCustomEmojiInUsernamesSwitch.isOn
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue