Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Update Source Selection Button #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 2 additions & 12 deletions NineAnimator/Base.lproj/AnimeDiscovery.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -595,9 +595,7 @@
<navigationItem key="navigationItem" title="Watch Next" id="AWC-Sv-NA3">
<barButtonItem key="rightBarButtonItem" title="Select Source" id="S9D-GU-IOj">
<connections>
<segue destination="16P-Tr-XC2" kind="popoverPresentation" popoverAnchorBarButtonItem="S9D-GU-IOj" id="QIE-hh-9O1">
<popoverArrowDirection key="popoverArrowDirection" up="YES" down="YES" left="YES" right="YES"/>
</segue>
<action selector="selectSourceButtonPressed:" destination="9sh-0o-xaW" id="lGm-40-TUc"/>
</connections>
</barButtonItem>
</navigationItem>
Expand Down Expand Up @@ -777,14 +775,6 @@
</objects>
<point key="canvasLocation" x="1137.68115942029" y="107.8125"/>
</scene>
<!--ServerSelection-->
<scene sceneID="g8v-Gs-nG0">
<objects>
<viewControllerPlaceholder storyboardName="ServerSelection" id="16P-Tr-XC2" sceneMemberID="viewController"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="L1C-dx-18P" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="193" y="510"/>
</scene>
<!--Watch Next-->
<scene sceneID="d6G-dE-Ax4">
<objects>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,21 @@ class DiscoverySceneViewController: UITableViewController {
private var recommendationLoadingTasks = [ObjectIdentifier: NineAnimatorAsyncTask]()
private var dirtySources = Set<ObjectIdentifier>()
private var shouldReloadDirtySourceImmedietly = false

override var preferredStatusBarStyle: UIStatusBarStyle {
Theme.current.preferredStatusBarStyle
}

var source: Source { NineAnimator.default.user.source }

@IBAction private func selectSourceButtonPressed(_ sender: Any) {
ServerSelectionViewController.presentSelectionDialog {
[weak self] _ in
guard let self = self else { return }
self.selectSourceButton.title = self.source.name
}
}

override func viewDidLoad() {
super.viewDidLoad()

Expand Down Expand Up @@ -83,6 +93,7 @@ class DiscoverySceneViewController: UITableViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
tableView.makeThemable()
self.selectSourceButton.title = source.name
}

override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
Expand Down