Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
548 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// CharacterCell.h | ||
// Lodestone | ||
// | ||
// Created by Florian Strauss on 04.07.13. | ||
// Copyright (c) 2013 Orlyapps Janzen & Strauß GbR. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface CharacterCell : UITableViewCell | ||
|
||
@property (weak, nonatomic) IBOutlet UILabel *nameLabel; | ||
@property (weak, nonatomic) IBOutlet UILabel *serverLabel; | ||
@property (weak, nonatomic) IBOutlet UIImageView *thumbnailImage; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// CharacterCell.m | ||
// Lodestone | ||
// | ||
// Created by Florian Strauss on 04.07.13. | ||
// Copyright (c) 2013 Orlyapps Janzen & Strauß GbR. All rights reserved. | ||
// | ||
|
||
#import "CharacterCell.h" | ||
|
||
@implementation CharacterCell | ||
|
||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// SearchViewController.h | ||
// Lodestone | ||
// | ||
// Created by Florian Strauss on 04.07.13. | ||
// Copyright (c) 2013 Orlyapps Janzen & Strauß GbR. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface SearchViewController : UITableViewController <UISearchBarDelegate> | ||
|
||
@property (weak, nonatomic) IBOutlet UISearchBar *searchBar; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// | ||
// SearchViewController.m | ||
// Lodestone | ||
// | ||
// Created by Florian Strauss on 04.07.13. | ||
// Copyright (c) 2013 Orlyapps Janzen & Strauß GbR. All rights reserved. | ||
// | ||
|
||
#import "SearchViewController.h" | ||
#import "DetailViewController.h" | ||
|
||
#import "CharacterCell.h" | ||
#import "FFLodestone.h" | ||
|
||
@interface SearchViewController () | ||
|
||
@property (strong, nonatomic) NSArray *characters; | ||
@property (strong, nonatomic) AFHTTPRequestOperation *operation; | ||
|
||
|
||
@end | ||
|
||
@implementation SearchViewController | ||
|
||
|
||
- (void)viewDidLoad | ||
{ | ||
[super viewDidLoad]; | ||
|
||
self.characters = [NSArray array]; | ||
|
||
self.clearsSelectionOnViewWillAppear = NO; | ||
|
||
} | ||
|
||
#pragma mark - Table view data source | ||
|
||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | ||
{ | ||
|
||
return 1; | ||
} | ||
|
||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | ||
{ | ||
|
||
return [self.characters count]; | ||
} | ||
|
||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | ||
{ | ||
static NSString *CellIdentifier = @"CharacterCell"; | ||
CharacterCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; | ||
|
||
FFCharacter *character = [self.characters objectAtIndex:indexPath.row]; | ||
|
||
cell.nameLabel.text = character.name; | ||
cell.serverLabel.text = character.server; | ||
[cell.thumbnailImage setImageWithURL:character.thumbnail | ||
placeholderImage:nil]; | ||
|
||
return cell; | ||
} | ||
|
||
|
||
|
||
#pragma mark - Navigation | ||
|
||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | ||
NSIndexPath *path = [self.tableView indexPathForSelectedRow]; | ||
FFCharacter *character = [self.characters objectAtIndex:path.row]; | ||
|
||
[segue.destinationViewController setCharacter:character]; | ||
} | ||
|
||
|
||
#pragma mark - UISearchBar delegate | ||
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { | ||
|
||
// Stop old operation | ||
if(self.operation != nil) { | ||
[self.operation cancel]; | ||
} | ||
self.operation = [[FFLodestone sharedInstance] searchCharacterWithName:searchText worldName:nil classjob:nil completionHandler:^(NSArray *characters, NSError *error) { | ||
self.characters = characters; | ||
[self.tableView reloadData]; | ||
}]; | ||
} | ||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// SidePanelViewController.h | ||
// Lodestone | ||
// | ||
// Created by Florian Strauss on 04.07.13. | ||
// Copyright (c) 2013 Orlyapps Janzen & Strauß GbR. All rights reserved. | ||
// | ||
|
||
#import "JASidePanelController.h" | ||
|
||
@interface SidePanelViewController : JASidePanelController | ||
|
||
@end |
Oops, something went wrong.