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

made review begging better and sorta fixed 3D touch animations

parent 710480be
......@@ -965,6 +965,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="EXU-fv-Jdf"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="S2C-YJ-Z2c" userLabel="First Responder" sceneMemberID="firstResponder"/>
......@@ -978,6 +979,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="509"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="gRZ-TI-P5X"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Rm2-De-TJb" userLabel="First Responder" sceneMemberID="firstResponder"/>
......
......@@ -23,7 +23,7 @@
<key>CFBundleShortVersionString</key>
<string>1.1</string>
<key>CFBundleVersion</key>
<string>23</string>
<string>24</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
......
......@@ -9,6 +9,7 @@
import UIKit
import DeckTransition
import RealmSwift
import StoreKit
//Realm Model
class FacilitiesModel: Object {
......@@ -213,7 +214,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
else {
let finalDestination = self.storyboard?.instantiateViewController(withIdentifier: "pulling") as? PullingViewController // Fox only, no items
finalDestination?.currentViewController = trueDest
let destDelegate = DeckTransitioningDelegate()
let destDelegate = DeckTransitioningDelegate(isSwipeToDismissEnabled: true, dismissCompletion: begForReviews)
finalDestination?.modalPresentationStyle = .custom
finalDestination?.transitioningDelegate = destDelegate
......@@ -229,6 +230,18 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
}
func begForReviews(_ dismissed: Bool) {
// MARK - Begging for App Reviews
let prompt = UserDefaults.standard.integer(forKey: "reviewPrompt")
if(arc4random_uniform(100) > 92 && prompt >= 4) {
SKStoreReviewController.requestReview()
UserDefaults.standard.set(0, forKey: "reviewPrompt")
}
else {
UserDefaults.standard.set(prompt + 1, forKey: "reviewPrompt")
}
}
func configureSearchController() {
searchController.searchResultsUpdater = self
searchController.obscuresBackgroundDuringPresentation = false
......@@ -245,11 +258,6 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
self.definesPresentationContext = true
if(traitCollection.forceTouchCapability == .available) {
registerForPreviewing(with: self, sourceView: self.LocationsList!)
}
navigationItem.title = "What's Open"
navigationController?.navigationBar.prefersLargeTitles = true
navigationItem.largeTitleDisplayMode = .always
......@@ -680,6 +688,10 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
cell.layer.masksToBounds = false
cell.layer.shadowPath = UIBezierPath(roundedRect: cell.bounds, cornerRadius: cell.layer.cornerRadius).cgPath
self.reloadInputViews()
if(traitCollection.forceTouchCapability == .available) {
self.registerForPreviewing(with: self, sourceView: cell)
}
return cell
}
else {
......@@ -710,7 +722,9 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
}
cell.messageLabel.text = currentAlerts[indexPath.row].message
if(traitCollection.forceTouchCapability == .available) {
self.registerForPreviewing(with: self, sourceView: cell)
}
return cell
}
......@@ -867,6 +881,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
guard let indexPath = LocationsList?.indexPathForItem(at: location) else { return nil }
if(indexPath.section == 1 || currentAlerts.count == 0) {
let cell = LocationsList?.cellForItem(at: indexPath) as? FacilityCollectionViewCell
previewingContext.sourceRect = (cell?.bounds)!
guard let detailView = storyboard?.instantiateViewController(withIdentifier: "detailView") as? FacilityDetailViewController else { return nil }
detailView.facility = cell?.facility
return detailView
......
......@@ -39,22 +39,6 @@ class FacilityDetailViewController: UIViewController, UITableViewDelegate, UITab
return .lightContent
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(true)
}
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(true)
// MARK - Begging for App Reviews
let prompt = UserDefaults.standard.integer(forKey: "reviewPrompt")
if(arc4random_uniform(100) > 90 && prompt >= 4) {
SKStoreReviewController.requestReview()
UserDefaults.standard.set(0, forKey: "reviewPrompt")
}
else {
UserDefaults.standard.set(prompt + 1, forKey: "reviewPrompt")
}
}
override func viewDidLoad() {
super.viewDidLoad()
......
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