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
dddbff61
Unverified
Commit
dddbff61
authored
Sep 16, 2017
by
Zach Knox
Browse files
large title bars
yeah the search bar is gross looking right now... I'm trying some things out...
parent
f275210a
Changes
4
Hide whitespace changes
Inline
Side-by-side
WhatsOpen/WhatsOpen/Base.lproj/Main.storyboard
View file @
dddbff61
...
...
@@ -305,6 +305,7 @@
<outlet
property=
"LocationsListLayout"
destination=
"eqw-AF-DSB"
id=
"kLH-bz-bdn"
/>
<outlet
property=
"RightButton"
destination=
"vtX-VZ-RB4"
id=
"iv8-Xb-WoJ"
/>
<outlet
property=
"favoritesControl"
destination=
"9BX-Nz-NN6"
id=
"94S-gq-Nni"
/>
<outlet
property=
"navigationItem"
destination=
"lS5-pu-Adr"
id=
"4tw-ID-qgg"
/>
<outlet
property=
"settingsButton"
destination=
"MHZ-t0-Moj"
id=
"nyC-iO-GTe"
/>
</connections>
</viewController>
...
...
@@ -588,10 +589,14 @@
<navigationBar
key=
"navigationBar"
contentMode=
"scaleToFill"
barStyle=
"black"
translucent=
"NO"
id=
"ulx-sh-XJ1"
>
<rect
key=
"frame"
x=
"0.0"
y=
"20"
width=
"375"
height=
"44"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<color
key=
"barTintColor"
red=
"0.0"
green=
"0.40000000000000002"
blue=
"0.20000000000000001"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<textAttributes
key=
"titleTextAttributes"
>
<color
key=
"textColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
</textAttributes>
<textAttributes
key=
"largeTitleTextAttributes"
>
<color
key=
"textColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
</textAttributes>
</navigationBar>
<nil
name=
"viewControllers"
/>
<connections>
...
...
WhatsOpen/WhatsOpen/FacilityCollectionViewCell.swift
View file @
dddbff61
...
...
@@ -7,6 +7,7 @@
//
import
UIKit
import
QuartzCore
class
FacilityCollectionViewCell
:
UICollectionViewCell
{
@IBOutlet
var
nameLabel
:
UILabel
!
...
...
@@ -17,13 +18,25 @@ class FacilityCollectionViewCell: UICollectionViewCell {
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
self
.
layer
.
cornerRadius
=
8
self
.
layer
.
borderWidth
=
1.0
self
.
layer
.
borderColor
=
UIColor
.
clear
.
cgColor
/*
self.layer.shadowColor = UIColor.darkGray.cgColor
self.layer.shadowOffset = CGSize(width: 0, height: 0)
self.layer.shadowRadius = 3.0
self.layer.shadowOpacity = 1.0
self.layer.masksToBounds = false
self.layer.shadowPath = UIBezierPath(roundedRect: self.bounds, cornerRadius: self.layer.cornerRadius).cgPath
*/
openClosedLabel
.
layer
.
cornerRadius
=
12
openClosedLabel
.
layer
.
masksToBounds
=
true
isAccessibilityElement
=
true
shouldGroupAccessibilityChildren
=
true
self
.
layer
.
cornerRadius
=
8
// Initialization code
}
}
WhatsOpen/WhatsOpen/Views/FacilitiesListViewController.swift
View file @
dddbff61
...
...
@@ -46,20 +46,25 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
let
refreshControl
=
UIRefreshControl
()
override
func
viewWillLayoutSubviews
()
{
LocationsListLayout
.
itemSize
.
width
=
getCellWidth
()
LocationsListLayout
.
invalidateLayout
()
}
func
getCellWidth
()
->
CGFloat
{
let
windowWidth
=
self
.
view
.
frame
.
size
.
width
if
(
windowWidth
>
320
&&
windowWidth
<
640
)
{
LocationsListLayout
.
itemSize
.
width
=
windowWidth
-
20
if
(
windowWidth
<
640
)
{
return
windowWidth
-
20
}
else
if
(
windowWidth
>=
640
&&
windowWidth
<
1024
)
{
LocationsListLayout
.
itemSize
.
width
=
(
windowWidth
/
2
)
-
15
return
(
windowWidth
/
2
)
-
15
}
else
if
(
windowWidth
>=
1024
)
{
LocationsListLayout
.
itemSize
.
width
=
(
windowWidth
/
3
)
-
15
return
(
windowWidth
/
3
)
-
15
}
LocationsListLayout
.
invalidateLayout
()
return
0
}
@IBAction
func
RefreshButton
(
_
sender
:
Any
)
{
...
...
@@ -68,6 +73,10 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
LastUpdatedLabel
.
isEnabled
=
false
navigationItem
.
title
=
"What's Open?"
}
override
func
viewDidLoad
()
{
...
...
@@ -77,6 +86,15 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
registerForPreviewing
(
with
:
self
,
sourceView
:
self
.
LocationsList
!
)
}
let
searchController
=
UISearchController
(
searchResultsController
:
nil
)
//TODO: ADD SEARCH
if
#available(iOS 11, *)
{
navigationController
?
.
navigationBar
.
prefersLargeTitles
=
true
navigationItem
.
searchController
=
searchController
navigationItem
.
hidesSearchBarWhenScrolling
=
false
navigationItem
.
searchController
?
.
searchBar
.
barTintColor
=
UIColor
.
white
navigationItem
.
searchController
?
.
searchBar
.
barStyle
=
.
default
}
LocationsListLayout
.
invalidateLayout
()
settingsButton
.
accessibilityLabel
=
"Settings"
...
...
WhatsOpen/WhatsOpen/Views/FacilityDetailViewController.swift
View file @
dddbff61
...
...
@@ -27,7 +27,6 @@ class FacilityDetailViewController: UIViewController, UITableViewDelegate, UITab
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
true
)
}
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
...
...
@@ -43,6 +42,10 @@ class FacilityDetailViewController: UIViewController, UITableViewDelegate, UITab
OpenLabel
.
text
=
"CLOSED"
OpenLabel
.
backgroundColor
=
UIColor
.
red
}
if
#available(iOS 11.0, *)
{
navigationItem
.
largeTitleDisplayMode
=
.
never
}
// Do any additional setup after loading the view.
}
...
...
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