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
b5a9f637
Unverified
Commit
b5a9f637
authored
Jan 18, 2018
by
Zach Knox
Browse files
fully working persistent alerts
parent
5b298bce
Changes
5
Hide whitespace changes
Inline
Side-by-side
WhatsOpen/WhatsOpen/AppDelegate.swift
View file @
b5a9f637
...
...
@@ -29,9 +29,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let
alerts
=
defaults
.
dictionary
(
forKey
:
"alerts"
)
if
alerts
==
nil
{
var
setAlerts
=
[
String
:
Bool
]()
setAlerts
.
updateValue
(
true
,
forKey
:
"
I
nformational"
)
setAlerts
.
updateValue
(
true
,
forKey
:
"
M
inor
A
lerts"
)
setAlerts
.
updateValue
(
true
,
forKey
:
"
M
ajor
A
lerts"
)
setAlerts
.
updateValue
(
true
,
forKey
:
"
i
nformational"
)
setAlerts
.
updateValue
(
true
,
forKey
:
"
m
inor
a
lerts"
)
setAlerts
.
updateValue
(
true
,
forKey
:
"
m
ajor
a
lerts"
)
defaults
.
set
(
setAlerts
,
forKey
:
"alerts"
)
}
...
...
WhatsOpen/WhatsOpen/Base.lproj/Main.storyboard
View file @
b5a9f637
...
...
@@ -28,26 +28,27 @@
<autoresizingMask
key=
"autoresizingMask"
/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
selectionStyle=
"
default
"
indentationWidth=
"10"
reuseIdentifier=
"Checkbox Filter"
textLabel=
"rYu-5q-2u8"
style=
"IBUITableViewCellStyleDefault"
id=
"x5H-BH-cVX
"
customClass=
"CheckingTableViewCell"
customModule=
"WhatsOpen"
customModuleProvider=
"target"
>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
selectionStyle=
"
none
"
indentationWidth=
"10"
reuseIdentifier=
"Checkbox Filter"
id=
"acT-0Y-66n
"
customClass=
"CheckingTableViewCell"
customModule=
"WhatsOpen"
customModuleProvider=
"target"
>
<rect
key=
"frame"
x=
"0.0"
y=
"99.5"
width=
"375"
height=
"44"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
tableViewCell=
"
x5H-BH-cVX"
id=
"xf1-yc-ynP
"
>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
tableViewCell=
"
acT-0Y-66n"
id=
"eyW-ce-b3u
"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"43.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<subviews>
<label
opaque=
"NO"
multipleTouchEnabled=
"YES"
contentMode=
"left"
text=
"Sort By x"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
id=
"rYu-5q-2u8"
>
<rect
key=
"frame"
x=
"16"
y=
"0.0"
width=
"343"
height=
"43.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"17"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
</tableViewCellContentView>
<color
key=
"tintColor"
red=
"0.0"
green=
"0.40000000000000002"
blue=
"0.20000000000000001"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
</tableViewCell>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
selectionStyle=
"none"
accessoryType=
"disclosureIndicator"
indentationWidth=
"10"
reuseIdentifier=
"toSelection"
id=
"AYg-3T-fMg"
>
<rect
key=
"frame"
x=
"0.0"
y=
"143.5"
width=
"375"
height=
"44"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
tableViewCell=
"AYg-3T-fMg"
id=
"b0b-tc-t8O"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"341"
height=
"43.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
</tableViewCellContentView>
<connections>
<segue
destination=
"yIT-AR-gdn"
kind=
"show"
identifier=
"toSelection"
id=
"lwF-fe-hI5"
/>
</connections>
</tableViewCell>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
preservesSuperviewLayoutMargins=
"YES"
selectionStyle=
"none"
indentationWidth=
"10"
reuseIdentifier=
"picking"
rowHeight=
"157"
id=
"Qzo-pS-g9l"
customClass=
"PickingTableViewCell"
customModule=
"WhatsOpen"
customModuleProvider=
"target"
>
<rect
key=
"frame"
x=
"0.0"
y=
"1
43
.5"
width=
"375"
height=
"157"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"1
87
.5"
width=
"375"
height=
"157"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
preservesSuperviewLayoutMargins=
"YES"
insetsLayoutMarginsFromSafeArea=
"NO"
tableViewCell=
"Qzo-pS-g9l"
id=
"gyt-MF-bQ2"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"156.5"
/>
...
...
@@ -68,33 +69,6 @@
<outlet
property=
"pickerView"
destination=
"Rpt-Of-2BY"
id=
"ek7-I8-MFW"
/>
</connections>
</tableViewCell>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
preservesSuperviewLayoutMargins=
"YES"
selectionStyle=
"default"
accessoryType=
"disclosureIndicator"
indentationWidth=
"10"
reuseIdentifier=
"toSelection"
textLabel=
"1gJ-n6-QQk"
detailTextLabel=
"gbn-2b-WZh"
style=
"IBUITableViewCellStyleValue1"
id=
"HkW-HK-Uqf"
>
<rect
key=
"frame"
x=
"0.0"
y=
"300.5"
width=
"375"
height=
"44"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
preservesSuperviewLayoutMargins=
"YES"
insetsLayoutMarginsFromSafeArea=
"NO"
tableViewCell=
"HkW-HK-Uqf"
id=
"3BF-KX-2nF"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"341"
height=
"43.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<subviews>
<label
opaque=
"NO"
multipleTouchEnabled=
"YES"
contentMode=
"left"
insetsLayoutMarginsFromSafeArea=
"NO"
text=
"Title"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
id=
"1gJ-n6-QQk"
>
<rect
key=
"frame"
x=
"16"
y=
"12"
width=
"33.5"
height=
"20.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"17"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
multipleTouchEnabled=
"YES"
contentMode=
"left"
insetsLayoutMarginsFromSafeArea=
"NO"
text=
"Detail"
textAlignment=
"right"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
id=
"gbn-2b-WZh"
>
<rect
key=
"frame"
x=
"296"
y=
"12"
width=
"44"
height=
"20.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"17"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue
destination=
"yIT-AR-gdn"
kind=
"show"
identifier=
"toSelection"
id=
"86R-Fz-PuY"
/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet
property=
"dataSource"
destination=
"jkQ-vu-LQa"
id=
"DbO-38-R86"
/>
...
...
@@ -376,31 +350,15 @@
<autoresizingMask
key=
"autoresizingMask"
/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
preservesSuperviewLayoutMargins=
"YES"
selectionStyle=
"
default
"
accessoryType=
"disclosureIndicator"
indentationWidth=
"10"
reuseIdentifier=
"settingSelection"
textLabel=
"uld-Wy-NHl"
detailTextLabel=
"D5h-89-67A"
style=
"IBUITableViewCellStyleValue1"
id=
"tdz-HQ-rmz
"
>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
selectionStyle=
"
none
"
accessoryType=
"disclosureIndicator"
indentationWidth=
"10"
reuseIdentifier=
"settingSelection"
id=
"fc0-pe-nJl
"
>
<rect
key=
"frame"
x=
"0.0"
y=
"99.5"
width=
"375"
height=
"44"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
preservesSuperviewLayoutMargins=
"YES"
insetsLayoutMarginsFromSafeArea=
"NO"
tableViewCell=
"tdz-HQ-rmz"
id=
"H43-kY-wZi
"
>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
tableViewCell=
"fc0-pe-nJl"
id=
"dQS-VU-1IK
"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"341"
height=
"43.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<subviews>
<label
opaque=
"NO"
multipleTouchEnabled=
"YES"
contentMode=
"left"
insetsLayoutMarginsFromSafeArea=
"NO"
text=
"Title"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
id=
"uld-Wy-NHl"
>
<rect
key=
"frame"
x=
"16"
y=
"12"
width=
"33.5"
height=
"20.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"17"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
multipleTouchEnabled=
"YES"
contentMode=
"left"
insetsLayoutMarginsFromSafeArea=
"NO"
text=
"Detail"
textAlignment=
"right"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
id=
"D5h-89-67A"
>
<rect
key=
"frame"
x=
"296"
y=
"12"
width=
"44"
height=
"20.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"17"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue
destination=
"yIT-AR-gdn"
kind=
"show"
identifier=
"settingSelection"
id=
"
b6G-Gf-D4M
"
/>
<segue
destination=
"yIT-AR-gdn"
kind=
"show"
identifier=
"settingSelection"
id=
"
FRf-a6-Dgs
"
/>
</connections>
</tableViewCell>
</prototypes>
...
...
@@ -872,7 +830,7 @@
<image
name=
"major"
width=
"266"
height=
"266"
/>
</resources>
<inferredMetricsTieBreakers>
<segue
reference=
"
b6G-Gf-D4M
"
/>
<segue
reference=
"
FRf-a6-Dgs
"
/>
</inferredMetricsTieBreakers>
<color
key=
"tintColor"
red=
"0.0"
green=
"0.40000000000000002"
blue=
"0.20000000000000001"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
</document>
WhatsOpen/WhatsOpen/SRCTUtilities.swift
View file @
b5a9f637
...
...
@@ -345,7 +345,7 @@ class Utilities: NSObject {
}
}
for
alert
in
alerts
!
{
alerts
!.
updateValue
(
!
foundFalse
,
forKey
:
alert
.
key
)
alerts
!.
updateValue
(
foundFalse
,
forKey
:
alert
.
key
)
}
defaults
.
set
(
alerts
,
forKey
:
"alerts"
)
return
true
...
...
WhatsOpen/WhatsOpen/Views/FacilitiesListViewController.swift
View file @
b5a9f637
...
...
@@ -278,15 +278,15 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
if
now
.
isGreaterThanDate
(
dateToCompare
:
formatter
.
date
(
from
:
alert
.
startDate
)
!
)
&&
now
.
isLessThanDate
(
dateToCompare
:
formatter
.
date
(
from
:
alert
.
endDate
)
!
)
{
switch
alert
.
urgency
{
case
"info"
:
if
(
alertFilers
!
[
"
I
nformational"
])
!
{
if
(
alertFilers
!
[
"
i
nformational"
])
!
{
shown
.
append
(
alert
)
}
case
"minor"
:
if
(
alertFilers
!
[
"
M
inor
A
lerts"
])
!
{
if
(
alertFilers
!
[
"
m
inor
a
lerts"
])
!
{
shown
.
append
(
alert
)
}
case
"major"
:
if
(
alertFilers
!
[
"
M
ajor
A
lerts"
])
!
{
if
(
alertFilers
!
[
"
m
ajor
a
lerts"
])
!
{
shown
.
append
(
alert
)
}
default
:
...
...
@@ -718,9 +718,12 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
func
collectionView
(
_
collectionView
:
UICollectionView
,
layout
collectionViewLayout
:
UICollectionViewLayout
,
insetForSectionAt
section
:
Int
)
->
UIEdgeInsets
{
var
sectionInsets
=
LocationsListLayout
.
sectionInset
if
(
section
!=
1
&&
a
lerts
List
.
count
!=
0
)
{
if
(
section
!=
1
&&
currentA
lerts
.
count
!=
0
)
{
sectionInsets
.
top
=
0
}
else
if
currentAlerts
.
count
==
0
{
sectionInsets
.
top
=
15
}
return
sectionInsets
}
...
...
WhatsOpen/WhatsOpen/Views/SettingsTableViewController.swift
View file @
b5a9f637
...
...
@@ -21,6 +21,10 @@ class SettingsTableViewController: UITableViewController, MFMailComposeViewContr
self
.
dismiss
(
animated
:
true
,
completion
:
nil
)
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
tableView
.
reloadData
()
}
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