Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
Fix manual calendar updating (#187)
Browse files Browse the repository at this point in the history
- remove current calendar items from the manager before appending the new ones
- directly update calendar view when we get new data
  • Loading branch information
mammuth authored and nerdsupremacist committed Oct 20, 2017
1 parent 5f2aa24 commit 0b098ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions TUM Campus App/CalendarManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class CalendarManager: Manager {
}

func getFromXML(_ value: String, handler: ([DataElement]) -> ()) {
CalendarManager.calendarItems.removeAll()
let data = SWXMLHash.parse(value)
let events = data["events"]["event"].all
for event in events {
Expand Down
2 changes: 1 addition & 1 deletion TUM Campus App/CalendarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class CalendarViewController: UIViewController, DetailView {
}

func updateCalendar(_ sender: AnyObject?) {
print("updateCalendar clicked")
navigationItem.rightBarButtonItems = [stopRefreshBarButton, todayBarButton]
delegate?.dataManager().updateCalendar(self)
}
Expand Down Expand Up @@ -157,6 +156,7 @@ extension CalendarViewController: TumDataReceiver {
}
let now = Date()
updateTitle(now)
dayPlannerView.reloadAllEvents()
navigationItem.rightBarButtonItems = [refreshBarButton, todayBarButton]
}
}
Expand Down

0 comments on commit 0b098ee

Please sign in to comment.