Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-ios
Commits
8f969dbb
Unverified
Commit
8f969dbb
authored
Mar 27, 2018
by
Zach Knox
Browse files
Added review begging
parent
c4c75e28
Changes
1
Hide whitespace changes
Inline
Side-by-side
WhatsOpen/WhatsOpen/Views/FacilityDetailViewController.swift
View file @
8f969dbb
...
...
@@ -7,6 +7,7 @@
//
import
UIKit
import
StoreKit
class
FacilityDetailViewController
:
UIViewController
,
UITableViewDelegate
,
UITableViewDataSource
{
...
...
@@ -68,6 +69,19 @@ class FacilityDetailViewController: UIViewController, UITableViewDelegate, UITab
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
)
>
85
&&
prompt
>=
4
)
{
SKStoreReviewController
.
requestReview
()
UserDefaults
.
standard
.
set
(
0
,
forKey
:
"reviewPrompt"
)
}
else
{
UserDefaults
.
standard
.
set
(
prompt
+
1
,
forKey
:
"reviewPrompt"
)
}
}
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment