Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions AAMFeedback.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Pod::Spec.new do |s|
s.name = 'AAMFeedback'
s.version = '0.0.1'
s.platform = :ios, '5.0'
s.license = { :type => 'Modified BSD' }
s.homepage = 'https://github.com/fladdict/AAMFeedback'
s.summary = 'Library that you can add User feedback form in you app on the fly. :-)'
s.author = 'Takayuki Fukatsu'
s.source = { :git => 'https://github.com/fladdict/AAMFeedback.git' }
s.source_files = 'AAMFeedback/AAMFeedback/*.{h,m}'
s.resource = 'AAMFeedback/AAMFeedback.bundle'
s.requires_arc = false
s.frameworks = 'UIKit', 'MessageUI', 'CoreGraphics'
end
6 changes: 4 additions & 2 deletions AAMFeedback/AAMFeedback/AAMFeedbackTopicsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#import "AAMFeedbackTopicsViewController.h"

#define LocalizedString(stringKey) \
[[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"AAMFeedback" ofType:@"bundle"]] localizedStringForKey:stringKey value:stringKey table:nil]

@interface AAMFeedbackTopicsViewController(private)
- (void)_setSelectedIndex:(int)theIndex;
Expand All @@ -26,7 +28,7 @@ @implementation AAMFeedbackTopicsViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = NSLocalizedString(@"AAMFeedbackTopicsTitle", nil);
self.title = LocalizedString(@"AAMFeedbackTopicsTitle");
}

- (void)viewDidUnload
Expand Down Expand Up @@ -83,7 +85,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.textLabel.text = NSLocalizedString([[self _topics]objectAtIndex:indexPath.row],nil);
cell.textLabel.text = LocalizedString([[self _topics]objectAtIndex:indexPath.row]);

return cell;
}
Expand Down
17 changes: 10 additions & 7 deletions AAMFeedback/AAMFeedback/AAMFeedbackViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#include <sys/types.h>
#include <sys/sysctl.h>

#define LocalizedString(stringKey) \
[[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"AAMFeedback" ofType:@"bundle"]] localizedStringForKey:stringKey value:stringKey table:nil]

@interface AAMFeedbackViewController(private)
- (NSString *) _platform;
- (NSString *) _platformString;
Expand Down Expand Up @@ -88,10 +91,10 @@ - (void)dealloc {
- (void)loadView
{
[super loadView];
self.title = NSLocalizedString(@"AAMFeedbackTitle", nil);
self.title = LocalizedString(@"AAMFeedbackTitle");
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelDidPress:)]autorelease];

self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]initWithTitle:NSLocalizedString(@"AAMFeedbackButtonMail", nil) style:UIBarButtonItemStyleDone target:self action:@selector(nextDidPress:)]autorelease];
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]initWithTitle:LocalizedString(@"AAMFeedbackButtonMail") style:UIBarButtonItemStyleDone target:self action:@selector(nextDidPress:)]autorelease];
}

- (void)viewDidLoad
Expand Down Expand Up @@ -165,10 +168,10 @@ - (NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteg
{
switch (section) {
case 0:
return NSLocalizedString(@"AAMFeedbackTableHeaderTopics", nil);
return LocalizedString(@"AAMFeedbackTableHeaderTopics");
break;
case 1:
return NSLocalizedString(@"AAMFeedbackTableHeaderBasicInfo", nil);
return LocalizedString(@"AAMFeedbackTableHeaderBasicInfo");
break;
default:
break;
Expand Down Expand Up @@ -205,7 +208,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

_descriptionPlaceHolder = [[[UITextField alloc]initWithFrame:CGRectMake(16, 8, 300, 20)]autorelease];
_descriptionPlaceHolder.font = [UIFont systemFontOfSize:16];
_descriptionPlaceHolder.placeholder = NSLocalizedString(@"AAMFeedbackDescriptionPlaceholder", nil);
_descriptionPlaceHolder.placeholder = LocalizedString(@"AAMFeedbackDescriptionPlaceholder");
_descriptionPlaceHolder.userInteractionEnabled = NO;
[cell.contentView addSubview:_descriptionPlaceHolder];

Expand All @@ -220,8 +223,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
switch (indexPath.row) {
case 0:

cell.textLabel.text = NSLocalizedString(@"AAMFeedbackTopicsTitle", nil);
cell.detailTextLabel.text = NSLocalizedString([self _selectedTopic],nil);
cell.textLabel.text = LocalizedString(@"AAMFeedbackTopicsTitle");
cell.detailTextLabel.text = LocalizedString([self _selectedTopic]);
break;
case 1:
default:
Expand Down