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
a2f40249
Unverified
Commit
a2f40249
authored
Jan 16, 2018
by
Zach Knox
Browse files
iPad popover fixes, 3D touch fixes, and other UI bugfixes
parent
e2e3c873
Changes
2
Hide whitespace changes
Inline
Side-by-side
WhatsOpen/WhatsOpen/Base.lproj/Main.storyboard
View file @
a2f40249
...
...
@@ -741,8 +741,6 @@
<constraint
firstItem=
"wLk-ur-Xnx"
firstAttribute=
"centerX"
secondItem=
"SRQ-jA-ECr"
secondAttribute=
"centerX"
id=
"ATy-Xh-ZMq"
/>
<constraint
firstItem=
"7YD-bF-DBg"
firstAttribute=
"leading"
secondItem=
"SRQ-jA-ECr"
secondAttribute=
"leading"
id=
"B09-9Q-OeG"
/>
<constraint
firstItem=
"wLk-ur-Xnx"
firstAttribute=
"top"
secondItem=
"SRQ-jA-ECr"
secondAttribute=
"top"
constant=
"8"
id=
"Nmz-FD-yyL"
/>
<constraint
firstItem=
"7YD-bF-DBg"
firstAttribute=
"width"
secondItem=
"7hV-xC-3RZ"
secondAttribute=
"width"
id=
"foH-mJ-TWU"
/>
<constraint
firstItem=
"7YD-bF-DBg"
firstAttribute=
"centerX"
secondItem=
"SRQ-jA-ECr"
secondAttribute=
"centerX"
id=
"jeB-k7-2WW"
/>
<constraint
firstItem=
"SRQ-jA-ECr"
firstAttribute=
"bottom"
secondItem=
"7YD-bF-DBg"
secondAttribute=
"bottom"
id=
"kJu-VN-DbH"
/>
<constraint
firstItem=
"SRQ-jA-ECr"
firstAttribute=
"trailing"
secondItem=
"7YD-bF-DBg"
secondAttribute=
"trailing"
id=
"mP7-MZ-p8n"
/>
<constraint
firstItem=
"7YD-bF-DBg"
firstAttribute=
"top"
secondItem=
"wLk-ur-Xnx"
secondAttribute=
"bottom"
constant=
"8"
id=
"plI-X0-912"
/>
...
...
WhatsOpen/WhatsOpen/Views/FacilitiesListViewController.swift
View file @
a2f40249
...
...
@@ -173,31 +173,30 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
if
(
indexPath
!=
nil
)
{
if
(
indexPath
?
.
section
==
1
||
currentAlerts
.
count
==
0
)
{
let
destination
=
self
.
storyboard
?
.
instantiateViewController
(
withIdentifier
:
"pulling"
)
as?
PullingViewController
destination
?
.
currentViewController
=
self
.
storyboard
?
.
instantiateViewController
(
withIdentifier
:
"detailView"
)
as?
FacilityDetailViewController
let
destination
=
self
.
storyboard
?
.
instantiateViewController
(
withIdentifier
:
"detailView"
)
as?
FacilityDetailViewController
let
tapped
=
self
.
LocationsList
.
cellForItem
(
at
:
indexPath
!
)
as!
FacilityCollectionViewCell
(
destination
?
.
currentViewController
as?
FacilityDetailViewController
)?
.
facility
=
tapped
.
facility
self
.
presentDetailView
(
destination
!
)
destination
?
.
facility
=
tapped
.
facility
self
.
presentDetailView
(
destination
!
,
tapped
:
tapped
)
}
else
{
let
destination
=
self
.
storyboard
?
.
instantiateViewController
(
withIdentifier
:
"pulling"
)
as?
PullingViewController
destination
?
.
currentViewController
=
self
.
storyboard
?
.
instantiateViewController
(
withIdentifier
:
"alertDetail"
)
as?
AlertDetailViewController
let
destination
=
self
.
storyboard
?
.
instantiateViewController
(
withIdentifier
:
"alertDetail"
)
as?
AlertDetailViewController
let
tapped
=
self
.
LocationsList
.
cellForItem
(
at
:
indexPath
!
)
as!
AlertCollectionViewCell
(
destination
?
.
currentViewController
as?
AlertDetailViewController
)?
.
alert
=
tapped
.
alert
self
.
presentDetailView
(
destination
!
)
destination
?
.
alert
=
tapped
.
alert
self
.
presentDetailView
(
destination
!
,
tapped
:
tapped
)
}
}
}
func
presentDetailView
(
_
destination
:
Pulling
ViewController
)
{
func
presentDetailView
(
_
destination
:
UI
ViewController
,
tapped
:
UICollectionViewCell
)
{
if
(
self
.
view
.
traitCollection
.
horizontalSizeClass
==
.
regular
&&
self
.
view
.
traitCollection
.
verticalSizeClass
==
.
regular
)
{
//do a popover here for the iPad
//iPads are cool right?
destination
.
modalPresentationStyle
=
.
popover
let
popoverController
=
destination
.
popoverPresentationController
popoverController
?
.
permittedArrowDirections
=
.
any
popoverController
?
.
sourceView
=
destination
.
view
popoverController
?
.
sourceView
=
tapped
.
contentView
popoverController
?
.
sourceRect
=
tapped
.
bounds
// present the detail view over the search controller if we're searching
if
searchController
.
isActive
{
...
...
@@ -208,16 +207,18 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
}
}
else
{
let
finalDestination
=
self
.
storyboard
?
.
instantiateViewController
(
withIdentifier
:
"pulling"
)
as?
PullingViewController
// Fox only, no items
finalDestination
?
.
currentViewController
=
destination
let
destDelegate
=
DeckTransitioningDelegate
()
d
estination
.
modalPresentationStyle
=
.
custom
d
estination
.
transitioningDelegate
=
destDelegate
finalD
estination
?
.
modalPresentationStyle
=
.
custom
finalD
estination
?
.
transitioningDelegate
=
destDelegate
// present the detail view over the search controller if we're searching
if
searchController
.
isActive
{
searchController
.
present
(
d
estination
,
animated
:
true
,
completion
:
nil
)
searchController
.
present
(
finalD
estination
!
,
animated
:
true
,
completion
:
nil
)
}
else
{
present
(
d
estination
,
animated
:
true
,
completion
:
nil
)
present
(
finalD
estination
!
,
animated
:
true
,
completion
:
nil
)
}
}
...
...
@@ -677,7 +678,8 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
let
height
=
LocationsListLayout
.
itemSize
.
height
let
width
:
CGFloat
let
windowWidth
=
self
.
view
.
frame
.
size
.
width
let
edgeInsets
=
self
.
view
.
safeAreaInsets
let
windowWidth
=
self
.
view
.
frame
.
size
.
width
-
edgeInsets
.
left
-
edgeInsets
.
right
if
(
windowWidth
<
640
)
{
width
=
windowWidth
-
20
...
...
@@ -695,7 +697,8 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
return
CGSize
(
width
:
width
,
height
:
height
)
}
else
{
return
CGSize
(
width
:
self
.
view
.
frame
.
size
.
width
,
height
:
43
)
let
edgeInsets
=
self
.
view
.
safeAreaInsets
return
CGSize
(
width
:
self
.
view
.
frame
.
size
.
width
-
edgeInsets
.
left
-
edgeInsets
.
right
,
height
:
43
)
}
}
...
...
@@ -820,11 +823,13 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
}
func
previewingContext
(
_
previewingContext
:
UIViewControllerPreviewing
,
commit
viewControllerToCommit
:
UIViewController
)
{
let
finalDestination
=
self
.
storyboard
?
.
instantiateViewController
(
withIdentifier
:
"pulling"
)
as?
PullingViewController
// Fox only, no items
finalDestination
?
.
currentViewController
=
viewControllerToCommit
let
destDelegate
=
DeckTransitioningDelegate
()
viewControllerToCommit
.
modalPresentationStyle
=
.
custom
viewControllerToCommit
.
transitioningDelegate
=
destDelegate
finalDestination
?
.
modalPresentationStyle
=
.
custom
finalDestination
?
.
transitioningDelegate
=
destDelegate
//If one day 3D touch comes to the iPad, this is no longer good.
present
(
viewControllerToCommit
,
animated
:
true
,
completion
:
nil
)
present
(
finalDestination
!
,
animated
:
true
,
completion
:
nil
)
}
}
...
...
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