@@ -35,23 +35,25 @@ struct Event: CustomDebugStringConvertible {
3535 var title : String
3636 var location : String
3737 var description : String
38+ var uuid : String
3839
39- init ( day: Int , section: Int , time: Date , title: String , location: String , description: String ) {
40+ init ( day: Int , section: Int , time: Date , title: String , location: String , description: String , uuid : String ) {
4041 self . day = day
4142 self . section = section
4243 self . time = time
4344 self . title = title
4445 self . location = location
4546 self . description = description
47+ self . uuid = uuid
4648 }
4749
4850 init ( ) {
49- self . init ( day: 0 , section: 0 , time: Date ( ) , title: " " , location: " " , description: " " )
51+ self . init ( day: 0 , section: 0 , time: Date ( ) , title: " " , location: " " , description: " " , uuid : " " )
5052 }
5153
5254 // Using "debugDescription" instead of "description" because of name conflict with my "description" property.
5355 var debugDescription : String {
54- return " \( day) , \( section) , \( timeString) , \( title) , \( location) , \( self . description) "
56+ return " \( day) , \( section) , \( timeString) , \( title) , \( location) , \( self . description) , \( self . uuid ) "
5557 }
5658}
5759
@@ -247,10 +249,10 @@ class ScheduleParser {
247249 case 1 : currentEvent. time = stringToDate ( cellText) ?? Date ( )
248250 case 2 : currentEvent. title = cellText
249251 case 3 : currentEvent. location = cellText
250- case 4 :
251- currentEvent. description = cellText
252+ case 4 : currentEvent . description = cellText
253+ case 5 : currentEvent. uuid = cellText
252254
253- // Once we reach the fourth case, we know we're at the end of the data for a cell.
255+ // Once we reach the fifth case, we know we're at the end of the data for a cell.
254256 // This means that now we can reset the event!
255257 self . events. append ( currentEvent)
256258 currentEvent = Event ( )
@@ -267,7 +269,6 @@ class ScheduleParser {
267269 // Otherwise, keep them in the same section.
268270 }
269271 }
270-
271272 default : break
272273 }
273274
0 commit comments