Unverified Commit 6cfb20ae authored by Zach Knox's avatar Zach Knox
Browse files

updated some UI, added some ProductViewController stuff for the review link in settings

parent ba8d8180
......@@ -34,7 +34,7 @@
<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" text="Sort By x" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="rYu-5q-2u8">
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Sort By x" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" id="rYu-5q-2u8">
<rect key="frame" x="16" y="0.0" width="343" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
......@@ -74,14 +74,14 @@
<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" insetsLayoutMarginsFromSafeArea="NO" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="1gJ-n6-QQk">
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" id="1gJ-n6-QQk">
<rect key="frame" x="16" y="12" width="33.5" height="20.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="gbn-2b-WZh">
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" id="gbn-2b-WZh">
<rect key="frame" x="296" y="12" width="44" height="20.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
......@@ -455,7 +455,7 @@
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Johnson Center" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2ce-lS-NfW">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Johnson Center" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2ce-lS-NfW">
<rect key="frame" x="8" y="90" width="359" height="24"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
<nil key="textColor"/>
......@@ -467,7 +467,7 @@
<color key="textColor" white="0.13039822049999999" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Panera Bread" textAlignment="natural" lineBreakMode="tailTruncation" minimumScaleFactor="0.60000002384185791" translatesAutoresizingMaskIntoConstraints="NO" id="hPi-Bj-D4L">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Panera Bread" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" minimumScaleFactor="0.60000002384185791" translatesAutoresizingMaskIntoConstraints="NO" id="hPi-Bj-D4L">
<rect key="frame" x="8" y="45" width="359" height="49"/>
<fontDescription key="fontDescription" type="system" weight="heavy" pointSize="41"/>
<nil key="textColor"/>
......
......@@ -125,6 +125,8 @@ class FacilityDetailViewController: UIViewController, UITableViewDelegate, UITab
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = OpenTimesList.dequeueReusableCell(withIdentifier: "LocationDetailCell", for: indexPath)
cell.selectionStyle = .none
if(Utilities.isSpecialSchedule(facility) == true) {
let openTime = facility.specialSchedule?.openTimes[indexPath.row]
cell.textLabel?.text = Utilities.getDayOfWeek(Day(rawValue: openTime!.startDay)!)
......
......@@ -9,6 +9,7 @@
import UIKit
import SafariServices
import MessageUI
import StoreKit
class SettingsTableViewController: UITableViewController, MFMailComposeViewControllerDelegate {
......@@ -94,10 +95,11 @@ class SettingsTableViewController: UITableViewController, MFMailComposeViewContr
let cell = self.tableView(tableView, cellForRowAt: indexPath)
if let settingcell = cell as? SettingTableViewCell {
// Eventually we should change this logic to make it not reliant on English text
if settingcell.linkURL != nil {
self.showDetailViewController(SFSafariViewController(url: settingcell.linkURL!), sender: settingcell)
}
else if settingcell.textLabel?.text == "Are Our Hours Wrong?" {
else if settingcell.textLabel!.text == "Are Our Hours Wrong?" {
let mailvc = initMail(subject: "What's Open - Your Hours are Wrong", to: "srct@gmu.edu")
if !MFMailComposeViewController.canSendMail() {
/*
......@@ -113,6 +115,23 @@ class SettingsTableViewController: UITableViewController, MFMailComposeViewContr
present(mailvc, animated: true)
}
}
else if settingcell.textLabel?.text == "Review on the App Store" {
let appPage = SKStoreProductViewController()
let params = [SKStoreProductParameterITunesItemIdentifier: 1331260366]
appPage.loadProduct(withParameters: params, completionBlock: { (result, err) in
if err == nil && result == true {
self.present(appPage, animated: true)
print("presenting")
}
else {
let alert = UIAlertController(title: "Cound Not Find App in Store", message: "Check your network connection", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: "Default action"), style: .`default`, handler: { _ in
}))
self.present(alert, animated: true)
print("alerting")
}
})
}
else if settingcell.textLabel!.text == "About What's Open" {
let avc = self.storyboard?.instantiateViewController(withIdentifier: "about")
self.show(avc!, sender: settingcell)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment