问题
A beginner in iOS Objective C, I need to some help to create a custom tab as shown in the pic.
The custom tab will show today's plus 6 days date. Then when user click on the dates, it will call a uRL. I need some pointers if possible. All help is highly appreciated, thank you very much.
回答1:
You could use some third-party segmented controls. For Objective-C is could be this or this, then you get 6 next dates from current date, for example this code adds 1 day to current date and etc.:
NSDateComponents *dayComponent = [[NSDateComponents alloc] init];
dayComponent.day = 1;
NSCalendar *theCalendar = [NSCalendar currentCalendar];
NSDate *nextDate = [theCalendar dateByAddingComponents:dayComponent toDate:[NSDate date] options:0];
NSLog(@"nextDate: %@ ...", nextDate);
来源:https://stackoverflow.com/questions/48298252/top-custom-tabs-bar-displaying-today-and-1-week-dates