Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enzevalos_iphone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
enzevalos
enzevalos_iphone
Commits
48e6988f
Commit
48e6988f
authored
5 years ago
by
lazarog98
Browse files
Options
Downloads
Patches
Plain Diff
#238
remove ios version checks
parent
54e9ce5e
No related branches found
No related tags found
1 merge request
!27
Resolve "Improve searching"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
enzevalos_iphone/InboxViewController.swift
+14
-10
14 additions, 10 deletions
enzevalos_iphone/InboxViewController.swift
enzevalos_iphone/ListViewController.swift
+7
-7
7 additions, 7 deletions
enzevalos_iphone/ListViewController.swift
with
21 additions
and
17 deletions
enzevalos_iphone/InboxViewController.swift
+
14
−
10
View file @
48e6988f
...
@@ -253,18 +253,22 @@ class InboxViewController: UITableViewController, InboxCellDelegator {
...
@@ -253,18 +253,22 @@ class InboxViewController: UITableViewController, InboxCellDelegator {
return
searchController
.
isActive
&&
!
searchBarIsEmpty
return
searchController
.
isActive
&&
!
searchBarIsEmpty
}
}
/// searches a given string with a delay so that the entire client doesn't lag if the inbox is very big
/**
// TODO: Perhaps think of a better name
searches a given string with a delay so that the entire client doesn't lag if the inbox is very big
- parameters:
- searchText: srtring to look for
- scope: where to search (look at _filterContentForSearchText)
*/
func
startSearch
(
searchText
:
String
,
scope
:
Int
=
0
)
{
func
startSearch
(
searchText
:
String
,
scope
:
Int
=
0
)
{
if
#available
(
iOS
10.0
,
*
)
{
// check if a search has been scheduled already and stop it to prevent multiple searches
if
let
searchBarTimer
:
Timer
=
self
.
searchBarTimer
{
if
let
searchBarTimer
:
Timer
=
self
.
searchBarTimer
{
searchBarTimer
.
invalidate
()
searchBarTimer
.
invalidate
()
}
self
.
searchBarTimer
=
Timer
.
scheduledTimer
(
withTimeInterval
:
searchDelay
,
repeats
:
false
,
block
:
{
_
in
self
.
_filterContentForSearchText
(
searchText
,
scope
:
scope
)
})
}
}
self
.
searchBarTimer
=
Timer
.
scheduledTimer
(
withTimeInterval
:
searchDelay
,
repeats
:
false
,
block
:
{
_
in
self
.
_filterContentForSearchText
(
searchText
,
scope
:
scope
)
})
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
enzevalos_iphone/ListViewController.swift
+
7
−
7
View file @
48e6988f
...
@@ -110,14 +110,14 @@ class ListViewController: UITableViewController {
...
@@ -110,14 +110,14 @@ class ListViewController: UITableViewController {
}
}
func
startSearch
(
searchText
:
String
,
scope
:
Int
=
0
)
{
func
startSearch
(
searchText
:
String
,
scope
:
Int
=
0
)
{
if
#available
(
iOS
10.0
,
*
)
{
// check if a search has been scheduled already and stop it to prevent multiple searches
if
let
searchBarTimer
:
Timer
=
self
.
searchTimer
{
if
let
searchBarTimer
:
Timer
=
self
.
searchTimer
{
searchBarTimer
.
invalidate
()
searchBarTimer
.
invalidate
()
}
self
.
searchTimer
=
Timer
.
scheduledTimer
(
withTimeInterval
:
searchDelay
,
repeats
:
false
,
block
:
{
_
in
self
.
filterContentForSearchText
(
searchText
,
scope
:
scope
)
})
}
}
self
.
searchTimer
=
Timer
.
scheduledTimer
(
withTimeInterval
:
searchDelay
,
repeats
:
false
,
block
:
{
_
in
self
.
filterContentForSearchText
(
searchText
,
scope
:
scope
)
})
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment