I'm a bit of a newb here. So given the code shown below, I have a UITextView called scheduleView which changes from day to day - I'm using the variable "day" which represents the day of the year (This is meant to display a school's daily rotation/schedule - which are all stored in strings which I didn't include below). But let's say that I wanted to scroll through this text view - as in, sliding/pulling the textview right or left to see schedules for the days to come or previous days. I'm guessing that somehow I would have to use an action which adds or subtracts 1 from "day" each time it is performed. My question is: what kind of action would I use to do this?
Code:
NSDate *today = [[NSDate alloc] init];
NSCalendar *cal = [NSCalendar currentCalendar];
NSUInteger day = [cal ordinalityOfUnit:NSDayCalendarUnit
inUnit:NSYearCalendarUnit
forDate:today];
if (day == 341) {
scheduleView.text = R2;
}
else if (day == 339){
scheduleView.text = LS;
}
else if (day == 342) {
scheduleView.text = B1;
}
else if (day == 343) {
scheduleView.text = B2;
}
else if (day == 345) {
scheduleView.text = R1;
}
else if (day == 346) {
scheduleView.text = R2;
}
else if (day == 347) {
scheduleView.text = R3;
}
else if (day == 348) {
scheduleView.text = R1;
}
else if (day == 349) {
scheduleView.text = MS;
}
else {
scheduleView.text = @"No School Today!";
}
}