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

Commit

Permalink
update swift packages
Browse files Browse the repository at this point in the history
  • Loading branch information
tgymnich committed Dec 3, 2021
1 parent 901cd81 commit 5695a4f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"repositoryURL": "https://github.com/richardtop/CalendarKit.git",
"state": {
"branch": null,
"revision": "d47d2cc4a3a805308209ad77cf4862a836a61653",
"version": "1.0.14"
"revision": "4452265e023c772f94b82a489185aaba47222c44",
"version": "1.1.0"
}
},
{
Expand All @@ -51,17 +51,17 @@
"repositoryURL": "https://github.com/firebase/firebase-ios-sdk.git",
"state": {
"branch": null,
"revision": "2064534407804195d62f48531155ef41ddf1ce22",
"version": "8.9.0"
"revision": "08686f04881483d2bc098b2696e674c0ba135e47",
"version": "8.10.0"
}
},
{
"package": "GoogleAppMeasurement",
"repositoryURL": "https://github.com/google/GoogleAppMeasurement.git",
"state": {
"branch": null,
"revision": "1f13198b27eb2ac844953dad267bc25639128c41",
"version": "8.9.0"
"revision": "9b2f6aca5b4685c45f9f5481f19bee8e7982c538",
"version": "8.9.1"
}
},
{
Expand Down Expand Up @@ -141,8 +141,8 @@
"repositoryURL": "https://github.com/google/promises.git",
"state": {
"branch": null,
"revision": "afa9a1ace74e116848d4f743599ab83e584ff8cb",
"version": "1.2.12"
"revision": "611337c330350c9c1823ad6d671e7f936af5ee13",
"version": "2.0.0"
}
},
{
Expand Down Expand Up @@ -186,8 +186,8 @@
"repositoryURL": "https://github.com/MaxDesiatov/XMLCoder.git",
"state": {
"branch": null,
"revision": "887de88b37b2d691d67db950770e09776229cf6d",
"version": "0.13.0"
"revision": "f30119af03996939cc4f54e0bf0dda9f88a84da5",
"version": "0.13.1"
}
}
]
Expand Down
16 changes: 6 additions & 10 deletions TUM Campus App/Calendar/CalendarEventViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import CalendarKit
import UIKit

final class CalendarEventViewModel: EventDescriptor {
var startDate: Date
var endDate: Date
var dateInterval: DateInterval
var isAllDay = false
var text: String
var attributedText: NSAttributedString?
Expand Down Expand Up @@ -44,18 +43,16 @@ final class CalendarEventViewModel: EventDescriptor {
}
}

init(startDate: Date, endDate: Date, text: String, attributedText: NSAttributedString? = nil, userInfo: Any? = nil) {
self.startDate = startDate
self.endDate = endDate
init(dateInterval: DateInterval, text: String, attributedText: NSAttributedString? = nil, userInfo: Any? = nil) {
self.dateInterval = dateInterval
self.text = text
self.attributedText = attributedText
self.userInfo = userInfo
}

init?(event: CalendarEvent) {
guard let startDate = event.startDate, let endDate = event.endDate, let title = event.title else { return nil }
self.startDate = startDate
self.endDate = endDate
self.dateInterval = DateInterval(start: startDate, end: endDate)
self.text = title

let dateFormatter = DateFormatter()
Expand Down Expand Up @@ -84,13 +81,12 @@ final class CalendarEventViewModel: EventDescriptor {
}

func makeEditable() -> CalendarEventViewModel {
return CalendarEventViewModel(startDate: startDate, endDate: endDate, text: text, attributedText: attributedText, userInfo: userInfo)
return CalendarEventViewModel(dateInterval: dateInterval, text: text, attributedText: attributedText, userInfo: userInfo)
}

func commitEditing() {
guard let edited = editedEvent else {return}
edited.startDate = startDate
edited.endDate = endDate
edited.dateInterval = dateInterval
}

private func updateColors() {
Expand Down
18 changes: 5 additions & 13 deletions TUM Campus App/Calendar/CalendarWeekViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,12 @@ final class CalendarWeekViewController: DayViewController, ProfileImageSettable
}

override func dayViewDidSelectEventView(_ eventView: EventView) {
let attrTxt = eventView.descriptor?.attributedText
let s = attrTxt?.string

var event = CalendarEvent()

let events = importer.fetchedResultsController.fetchedObjects ?? []
for e in events {
if e.startDate == eventView.descriptor?.startDate {
event = e
}
}
let string = eventView.descriptor?.attributedText?.string
let events = importer.fetchedResultsController.fetchedObjects
let event = events?.first { $0.startDate == eventView.descriptor?.dateInterval.start }

if let range = s!.range(of: "LvNr=") {
let lvNr = String(s![range.upperBound...])
if let range = string?.range(of: "LvNr="), let event = event {
let lvNr = String(string![range.upperBound...])

let storyboard = UIStoryboard(name: "Main", bundle: .main)
guard let detailVC = storyboard.instantiateViewController(withIdentifier: "LectureDetailCollectionViewController") as? LectureDetailCollectionViewController else { return }
Expand Down

0 comments on commit 5695a4f

Please sign in to comment.