project_files/HedgewarsMobile/Classes/CampaignsViewController.m
author antonc27 <antonc27@mail.ru>
Sun, 21 Feb 2016 22:21:59 +0100
changeset 11564 2b9e189df3d6
child 11565 664d3592a66b
permissions -rw-r--r--
- Campaign for iOS: Stub for list of campaigns
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11564
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     1
/*
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     2
 * Hedgewars-iOS, a Hedgewars port for iOS devices
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     3
 * Copyright (c) 2015-2016 Anton Malmygin <antonc27@mail.ru>
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     4
 *
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     8
 *
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    12
 * GNU General Public License for more details.
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    13
 *
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    17
 */
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    18
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    19
#import "CampaignsViewController.h"
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    20
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    21
@interface CampaignsViewController ()
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    22
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    23
@end
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    24
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    25
@implementation CampaignsViewController
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    26
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    27
- (void)viewDidLoad {
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    28
    [super viewDidLoad];
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    29
    
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    30
    UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismiss)];
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    31
    self.navigationItem.leftBarButtonItem = doneButton;
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    32
    [doneButton release];
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    33
}
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    34
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    35
- (void)dismiss {
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    36
    [self.navigationController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    37
}
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    38
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    39
- (void)didReceiveMemoryWarning {
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    40
    [super didReceiveMemoryWarning];
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    41
    // Dispose of any resources that can be recreated.
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    42
}
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    43
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    44
#pragma mark - Table view data source
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    45
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    46
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    47
#warning Incomplete implementation, return the number of sections
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    48
    return 0;
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    49
}
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    50
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    51
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    52
#warning Incomplete implementation, return the number of rows
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    53
    return 0;
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    54
}
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    55
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    56
/*
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    57
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    58
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    59
    
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    60
    // Configure the cell...
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    61
    
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    62
    return cell;
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    63
}
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    64
*/
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    65
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    66
/*
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    67
// Override to support conditional editing of the table view.
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    68
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    69
    // Return NO if you do not want the specified item to be editable.
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    70
    return YES;
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    71
}
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    72
*/
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    73
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    74
/*
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    75
// Override to support editing the table view.
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    76
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    77
    if (editingStyle == UITableViewCellEditingStyleDelete) {
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    78
        // Delete the row from the data source
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    79
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    80
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    81
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    82
    }   
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    83
}
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    84
*/
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    85
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    86
/*
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    87
// Override to support rearranging the table view.
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    88
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    89
}
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    90
*/
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    91
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    92
/*
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    93
// Override to support conditional rearranging of the table view.
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    94
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    95
    // Return NO if you do not want the item to be re-orderable.
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    96
    return YES;
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    97
}
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    98
*/
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    99
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   100
/*
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   101
#pragma mark - Table view delegate
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   102
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   103
// In a xib-based application, navigation from a table can be handled in -tableView:didSelectRowAtIndexPath:
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   104
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   105
    // Navigation logic may go here, for example:
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   106
    // Create the next view controller.
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   107
    <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:<#@"Nib name"#> bundle:nil];
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   108
    
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   109
    // Pass the selected object to the new view controller.
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   110
    
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   111
    // Push the view controller.
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   112
    [self.navigationController pushViewController:detailViewController animated:YES];
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   113
}
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   114
*/
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   115
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   116
/*
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   117
#pragma mark - Navigation
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   118
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   119
// In a storyboard-based application, you will often want to do a little preparation before navigation
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   120
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   121
    // Get the new view controller using [segue destinationViewController].
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   122
    // Pass the selected object to the new view controller.
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   123
}
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   124
*/
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   125
2b9e189df3d6 - Campaign for iOS: Stub for list of campaigns
antonc27 <antonc27@mail.ru>
parents:
diff changeset
   126
@end