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
0b9af0b0
Unverified
Commit
0b9af0b0
authored
Nov 22, 2017
by
Zach Knox
Browse files
fixed search UI bug (Thanks Harshil!) and added category search
parent
4c6764b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
WhatsOpen/WhatsOpen/Views/FacilitiesListViewController.swift
View file @
0b9af0b0
...
...
@@ -124,7 +124,6 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
// present the detail view over the search controller if we're searching
if
searchController
.
isActive
{
searchController
.
present
(
destination
,
animated
:
true
,
completion
:
nil
)
}
else
{
...
...
@@ -147,6 +146,8 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
self
.
definesPresentationContext
=
true
if
(
traitCollection
.
forceTouchCapability
==
.
available
)
{
registerForPreviewing
(
with
:
self
,
sourceView
:
self
.
LocationsList
!
)
}
...
...
@@ -190,7 +191,8 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
filteredFacilities
=
facilitiesArray
.
filter
({(
facility
:
Facility
)
->
Bool
in
let
hasName
=
facility
.
facilityName
.
lowercased
()
.
contains
(
searchText
.
lowercased
())
let
hasBuilding
=
facility
.
facilityLocation
?
.
building
.
lowercased
()
.
contains
(
searchText
.
lowercased
())
??
false
return
hasName
||
hasBuilding
let
hasCategory
=
facility
.
category
?
.
categoryName
.
lowercased
()
.
contains
(
searchText
.
lowercased
())
??
false
return
hasName
||
hasBuilding
||
hasCategory
})
LocationsList
.
reloadData
()
}
...
...
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