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
6dab2e31
Unverified
Commit
6dab2e31
authored
May 27, 2018
by
Zach Knox
Browse files
made review begging better and sorta fixed 3D touch animations
parent
710480be
Changes
4
Show whitespace changes
Inline
Side-by-side
WhatsOpen/WhatsOpen/Base.lproj/Main.storyboard
View file @
6dab2e31
...
@@ -965,6 +965,7 @@
...
@@ -965,6 +965,7 @@
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"667"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"667"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<viewLayoutGuide
key=
"safeArea"
id=
"EXU-fv-Jdf"
/>
</view>
</view>
</viewController>
</viewController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"S2C-YJ-Z2c"
userLabel=
"First Responder"
sceneMemberID=
"firstResponder"
/>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"S2C-YJ-Z2c"
userLabel=
"First Responder"
sceneMemberID=
"firstResponder"
/>
...
@@ -978,6 +979,7 @@
...
@@ -978,6 +979,7 @@
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"509"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"509"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<viewLayoutGuide
key=
"safeArea"
id=
"gRZ-TI-P5X"
/>
</view>
</view>
</viewController>
</viewController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"Rm2-De-TJb"
userLabel=
"First Responder"
sceneMemberID=
"firstResponder"
/>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"Rm2-De-TJb"
userLabel=
"First Responder"
sceneMemberID=
"firstResponder"
/>
...
...
WhatsOpen/WhatsOpen/Info.plist
View file @
6dab2e31
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<key>
CFBundleShortVersionString
</key>
<key>
CFBundleShortVersionString
</key>
<string>
1.1
</string>
<string>
1.1
</string>
<key>
CFBundleVersion
</key>
<key>
CFBundleVersion
</key>
<string>
2
3
</string>
<string>
2
4
</string>
<key>
Fabric
</key>
<key>
Fabric
</key>
<dict>
<dict>
<key>
APIKey
</key>
<key>
APIKey
</key>
...
...
WhatsOpen/WhatsOpen/Views/FacilitiesListViewController.swift
View file @
6dab2e31
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
import
UIKit
import
UIKit
import
DeckTransition
import
DeckTransition
import
RealmSwift
import
RealmSwift
import
StoreKit
//Realm Model
//Realm Model
class
FacilitiesModel
:
Object
{
class
FacilitiesModel
:
Object
{
...
@@ -213,7 +214,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
...
@@ -213,7 +214,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
else
{
else
{
let
finalDestination
=
self
.
storyboard
?
.
instantiateViewController
(
withIdentifier
:
"pulling"
)
as?
PullingViewController
// Fox only, no items
let
finalDestination
=
self
.
storyboard
?
.
instantiateViewController
(
withIdentifier
:
"pulling"
)
as?
PullingViewController
// Fox only, no items
finalDestination
?
.
currentViewController
=
trueDest
finalDestination
?
.
currentViewController
=
trueDest
let
destDelegate
=
DeckTransitioningDelegate
()
let
destDelegate
=
DeckTransitioningDelegate
(
isSwipeToDismissEnabled
:
true
,
dismissCompletion
:
begForReviews
)
finalDestination
?
.
modalPresentationStyle
=
.
custom
finalDestination
?
.
modalPresentationStyle
=
.
custom
finalDestination
?
.
transitioningDelegate
=
destDelegate
finalDestination
?
.
transitioningDelegate
=
destDelegate
...
@@ -229,6 +230,18 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
...
@@ -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
()
{
func
configureSearchController
()
{
searchController
.
searchResultsUpdater
=
self
searchController
.
searchResultsUpdater
=
self
searchController
.
obscuresBackgroundDuringPresentation
=
false
searchController
.
obscuresBackgroundDuringPresentation
=
false
...
@@ -245,11 +258,6 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
...
@@ -245,11 +258,6 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
self
.
definesPresentationContext
=
true
self
.
definesPresentationContext
=
true
if
(
traitCollection
.
forceTouchCapability
==
.
available
)
{
registerForPreviewing
(
with
:
self
,
sourceView
:
self
.
LocationsList
!
)
}
navigationItem
.
title
=
"What's Open"
navigationItem
.
title
=
"What's Open"
navigationController
?
.
navigationBar
.
prefersLargeTitles
=
true
navigationController
?
.
navigationBar
.
prefersLargeTitles
=
true
navigationItem
.
largeTitleDisplayMode
=
.
always
navigationItem
.
largeTitleDisplayMode
=
.
always
...
@@ -680,6 +688,10 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
...
@@ -680,6 +688,10 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
cell
.
layer
.
masksToBounds
=
false
cell
.
layer
.
masksToBounds
=
false
cell
.
layer
.
shadowPath
=
UIBezierPath
(
roundedRect
:
cell
.
bounds
,
cornerRadius
:
cell
.
layer
.
cornerRadius
)
.
cgPath
cell
.
layer
.
shadowPath
=
UIBezierPath
(
roundedRect
:
cell
.
bounds
,
cornerRadius
:
cell
.
layer
.
cornerRadius
)
.
cgPath
self
.
reloadInputViews
()
self
.
reloadInputViews
()
if
(
traitCollection
.
forceTouchCapability
==
.
available
)
{
self
.
registerForPreviewing
(
with
:
self
,
sourceView
:
cell
)
}
return
cell
return
cell
}
}
else
{
else
{
...
@@ -710,7 +722,9 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
...
@@ -710,7 +722,9 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
}
}
cell
.
messageLabel
.
text
=
currentAlerts
[
indexPath
.
row
]
.
message
cell
.
messageLabel
.
text
=
currentAlerts
[
indexPath
.
row
]
.
message
if
(
traitCollection
.
forceTouchCapability
==
.
available
)
{
self
.
registerForPreviewing
(
with
:
self
,
sourceView
:
cell
)
}
return
cell
return
cell
}
}
...
@@ -867,6 +881,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
...
@@ -867,6 +881,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
guard
let
indexPath
=
LocationsList
?
.
indexPathForItem
(
at
:
location
)
else
{
return
nil
}
guard
let
indexPath
=
LocationsList
?
.
indexPathForItem
(
at
:
location
)
else
{
return
nil
}
if
(
indexPath
.
section
==
1
||
currentAlerts
.
count
==
0
)
{
if
(
indexPath
.
section
==
1
||
currentAlerts
.
count
==
0
)
{
let
cell
=
LocationsList
?
.
cellForItem
(
at
:
indexPath
)
as?
FacilityCollectionViewCell
let
cell
=
LocationsList
?
.
cellForItem
(
at
:
indexPath
)
as?
FacilityCollectionViewCell
previewingContext
.
sourceRect
=
(
cell
?
.
bounds
)
!
guard
let
detailView
=
storyboard
?
.
instantiateViewController
(
withIdentifier
:
"detailView"
)
as?
FacilityDetailViewController
else
{
return
nil
}
guard
let
detailView
=
storyboard
?
.
instantiateViewController
(
withIdentifier
:
"detailView"
)
as?
FacilityDetailViewController
else
{
return
nil
}
detailView
.
facility
=
cell
?
.
facility
detailView
.
facility
=
cell
?
.
facility
return
detailView
return
detailView
...
...
WhatsOpen/WhatsOpen/Views/FacilityDetailViewController.swift
View file @
6dab2e31
...
@@ -39,22 +39,6 @@ class FacilityDetailViewController: UIViewController, UITableViewDelegate, UITab
...
@@ -39,22 +39,6 @@ class FacilityDetailViewController: UIViewController, UITableViewDelegate, UITab
return
.
lightContent
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
()
{
override
func
viewDidLoad
()
{
super
.
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