Developer

Week View - Landscape View

The MAFLandscapeCalendarView displays appointments scheduled for one week in a panel style. Each appointment appears as a colored panel (MAFAppointmentView), which shows the appointment title and the location.

In this view, you can modify, delete, or create appointments, in the same way as in the Day Detail View. This figure shows the default look of the control:

Week View

For iPad, MAF supports another presentation mode for the week view:

iPad Week View

MAF does not have separate classes to handle iPad and iPhone idioms for the week view.

Presenting the Week View

To present the week view, initialize a <MAFLandscapeCalendarView> object and add it as a subview to any presenting ViewController. For example:
-(void)setupWeekView:(UIViewController*)vc
{

	MAFLandscapeCalendarView* view = [[MAFLandscapeCalendarView alloc] initWithFrame:CGRectMake(0, 44, 480, 207)];
        

NSTimeZone* tz = [[MAFDateFormatter instance].calendar timeZone];
        
NSDate* d1 = [[MAFDateFormatter instance] createDateFromString:@"25-06-2012 00:00" withFormat:@"dd-MM-yyyy HH:mm" andTimezone:tz];
NSDate* d2 = [[MAFDateFormatter instance] createDateFromString:@"26-06-2012 00:00" withFormat:@"dd-MM-yyyy HH:mm" andTimezone:tz];
NSDate* d3 = [[MAFDateFormatter instance] createDateFromString:@"27-06-2012 00:00" withFormat:@"dd-MM-yyyy HH:mm" andTimezone:tz];
NSDate* d4 = [[MAFDateFormatter instance] createDateFromString:@"28-06-2012 00:00" withFormat:@"dd-MM-yyyy HH:mm" andTimezone:tz];
NSDate* d5 = [[MAFDateFormatter instance] createDateFromString:@"29-06-2012 00:00" withFormat:@"dd-MM-yyyy HH:mm" andTimezone:tz];
        
        view.weekDays = [NSArray arrayWithObjects:d1,d2,d3,d4,d5, nil];
        
view.datasource = self;
view.delegate   = self;
view.tag = 42;
        
[vc.view addSubview:view];
[view release];

}