Skip to content

Commit a60482a

Browse files
authored
Merge pull request #3 from jurvis/structured
Fix data loading, update event model with new track ids, and storyboard loading identifiers
2 parents ac67492 + 8376b4b commit a60482a

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

FOSSAsia/ApiClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ typealias ApiRequestCompletionHandler = (Data?, Error?) -> Void
1212

1313
struct ApiClient {
1414

15-
static let url = "https://raw.githubusercontent.com/fossasia/2016.fossasia.org/gh-pages/schedule/"
15+
static let url = "https://raw.githubusercontent.com/fossasia/open-event-scraper/master/out/"
1616

1717
let eventInfo: EventInfo
1818

FOSSAsia/Event.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ import Foundation
1010

1111
struct Event {
1212
enum Track: Int, CustomStringConvertible {
13-
case techKids1 = 1
14-
case techKids2, openTechIOT, openTech, webTech, exhibition, hardwareIOT, python, databases, bigOpenData, devOps, privSec, isc, scienceHackDay, linux, design
13+
case openTechIOT = 1
14+
case openTech, techKids1, techKids2, techKids3, hardwareIOT, devOps, webTech, python, bigOpenData, databases, isc, privSec, scienceHackDay, linux, design, exhibition, social
1515
var description: String {
1616
switch self {
1717
case .techKids1: return "Tech Kids I"
1818
case .techKids2: return "Tech Kids II"
19+
case .techKids3: return "Tech Kids III"
1920
case .openTechIOT: return "OpenTech and IOT"
2021
case .openTech: return "OpenTech Workshops"
2122
case .webTech: return "WebTech"
@@ -30,20 +31,21 @@ struct Event {
3031
case .scienceHackDay: return "Science Hack Day"
3132
case .linux: return "Linux and MiniDebConf"
3233
case .design: return "Design, VR, 3D"
34+
case .social: return "Social Event"
3335
}
3436
}
3537

3638
func getTrackColor() -> UIColor {
3739
switch self {
38-
case .techKids1, .techKids2:
40+
case .techKids1, .techKids2, .techKids3:
3941
return UIColor(hexString: "8E8E93")!
4042
case .openTechIOT:
4143
return UIColor(hexString: "FF4D4D")!
4244
case .openTech:
4345
return UIColor(hexString: "FF8E4C")!
4446
case .webTech:
4547
return UIColor(hexString: "FFCF4C")!
46-
case .exhibition:
48+
case .exhibition, .social:
4749
return UIColor(hexString: "EAFF4C")!
4850
case .hardwareIOT:
4951
return UIColor(hexString: "B8FF4C")!

FOSSAsia/FavoritesScheduleViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class FavoritesScheduleViewController: EventsBaseViewController, SwipeToFavorite
1717

1818
struct StoryboardConstants {
1919
static let storyboardName = "ScheduleVC"
20-
static let viewControllerId = String(describing: FavoritesScheduleViewController())
20+
static let viewControllerId = String(describing: FavoritesScheduleViewController.self)
2121
}
2222

2323
override func viewDidLoad() {

FOSSAsia/ScheduleViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ScheduleViewController: EventsBaseViewController, SwipeToFavoriteCellPrese
1515
// Constants for Storyboard/VC
1616
struct StoryboardConstants {
1717
static let storyboardName = "ScheduleVC"
18-
static let viewControllerId = String(describing: ScheduleViewController())
18+
static let viewControllerId = String(describing: ScheduleViewController.self)
1919
}
2020

2121
lazy var filteredEvents: [EventViewModel] = self.allEvents

FOSSAsia/ScheduleViewModelDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ extension ScheduleViewController {
2525
let updateString = "Last updated: " + (now as NSDate).formattedDate(withFormat: "dd MMMM yyyy, HH:mm:ss", locale: Locale.autoupdatingCurrent)
2626
self.refreshControl.attributedTitle = NSAttributedString(string: updateString)
2727
if self.refreshControl.isRefreshing {
28-
OperationQueue.main.addOperation({ [unowned self] () -> Void in
28+
DispatchQueue.main.async {
2929
self.refreshControl.endRefreshing()
30-
})
30+
}
3131
}
3232
}
3333
}

0 commit comments

Comments
 (0)