Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #210 from CruCentralCoast/Camden/BugFix
Browse files Browse the repository at this point in the history
Issue #201 and #202. Hide FB button and added city to location
  • Loading branch information
tydahlwave authored Oct 9, 2018
2 parents 9c344b9 + 04103df commit 34f0bed
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "universal",
"color" : {
"color-space" : "srgb",
"components" : {
"red" : "59",
"alpha" : "1.000",
"blue" : "183",
"green" : "89"
}
}
}
]
}
12 changes: 11 additions & 1 deletion CruCentralCoast/Events/EventDetailsVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class EventDetailsVC: UIViewController {
@IBOutlet weak var descriptionLabel: UILabel!
@IBOutlet weak var closeButton: UIButton!
@IBOutlet weak var locationButton: UIButton!
@IBOutlet weak var facebookButton: CruButton!

@IBOutlet weak var topConstraint: NSLayoutConstraint!

Expand All @@ -30,10 +31,12 @@ class EventDetailsVC: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()

let locationButtonTitle = "\(self.event?.location?.street ?? "TBD") , \(self.event?.location?.city ?? "TBD")"

self.titleLabel.text = self.event?.title
self.dateLabel.text = self.event?.startDate.toString(dateStyle: .medium, timeStyle: .none).uppercased()
self.descriptionLabel.text = self.event?.summary
self.locationButton.setTitle(self.event?.location?.street, for: .normal)
self.locationButton.setTitle(locationButtonTitle, for: .normal)
self.currentImageLink = self.event?.imageLink
if let imageLink = self.event?.imageLink {
ImageManager.instance.fetch(imageLink) { [weak self] image in
Expand All @@ -44,6 +47,11 @@ class EventDetailsVC: UIViewController {
}
}
}

// remove facebook Button if the url is empty or nil
if ((self.event?.facebookUrl) == "" || self.event?.facebookUrl == nil) {
self.facebookButton.isHidden = true
}
}

@IBAction func dismissDetail(_ sender: Any) {
Expand Down Expand Up @@ -94,6 +102,8 @@ class EventDetailsVC: UIViewController {

let vc = SFSafariViewController(url: url, configuration: config)
self.present(vc, animated: true)
} else {
self.presentAlert(title: "No Event", message: "No facebook event available")
}
}

Expand Down
1 change: 1 addition & 0 deletions CruCentralCoast/Events/Events.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
<outlet property="closeButton" destination="OXe-05-0Hx" id="82Z-W6-hKo"/>
<outlet property="dateLabel" destination="Odd-9O-O3u" id="tKu-c6-WSm"/>
<outlet property="descriptionLabel" destination="3lv-CQ-HAd" id="HL2-Vy-gvP"/>
<outlet property="facebookButton" destination="IJy-Si-BSE" id="n8y-tE-dRz"/>
<outlet property="imageView" destination="UYN-ct-CuI" id="BB6-ny-EKf"/>
<outlet property="locationButton" destination="7k4-Tz-JY1" id="OX7-IW-7yv"/>
<outlet property="titleLabel" destination="LkD-pk-Jlf" id="Jih-Ss-FeQ"/>
Expand Down

0 comments on commit 34f0bed

Please sign in to comment.