Skip to content

Commit 8f92f1b

Browse files
committed
Adding support for all versions of OS 2.X
1 parent 784f518 commit 8f92f1b

File tree

6 files changed

+35
-10
lines changed

6 files changed

+35
-10
lines changed

InAppSettings/Cells/InAppSettingsTableCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ - (void)setValue:(id)newValue{
9393
- (id)initWithSetting:(InAppSetting *)inputSetting reuseIdentifier:(NSString *)reuseIdentifier{
9494
//the docs say UITableViewCellStyleValue1 is used for settings,
9595
//but it doesn't look 100% the same so we will just draw our own UILabels
96-
#if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_2_2
96+
#if InAppSettingUseNewCells
9797
self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
9898
#else
9999
self = [super initWithFrame:CGRectZero reuseIdentifier:reuseIdentifier];

InAppSettings/InAppSettingConstants.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@
1515
#define InAppSettingFontSize 17.0f
1616
#define InAppSettingBoldFont [UIFont boldSystemFontOfSize:InAppSettingFontSize]
1717
#define InAppSettingNormalFont [UIFont systemFontOfSize:InAppSettingFontSize]
18+
19+
//test what cell init code should be used
20+
#define InAppSettingUseNewCells __IPHONE_3_0 && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_0

InAppSettings/PSMultiValueSpecifierTable.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
6565

6666
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
6767
if (cell == nil){
68-
#if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_2_2
68+
#if InAppSettingUseNewCells
6969
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
7070
#else
7171
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
@@ -74,22 +74,22 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
7474

7575
NSString *cellTitle = NSLocalizedString([[self.setting valueForKey:@"Titles"] objectAtIndex:indexPath.row], nil);
7676
id cellValue = [[self.setting valueForKey:@"Values"] objectAtIndex:indexPath.row];
77-
#if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_2_2
77+
#if InAppSettingUseNewCells
7878
cell.textLabel.text = cellTitle;
7979
#else
8080
cell.text = cellTitle;
8181
#endif
8282
if([cellValue isEqual:[self getValue]]){
8383
cell.accessoryType = UITableViewCellAccessoryCheckmark;
84-
#if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_2_2
84+
#if InAppSettingUseNewCells
8585
cell.textLabel.textColor = InAppSettingBlue;
8686
#else
8787
cell.textColor = InAppSettingBlue;
8888
#endif
8989
}
9090
else{
9191
cell.accessoryType = UITableViewCellAccessoryNone;
92-
#if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_2_2
92+
#if InAppSettingUseNewCells
9393
cell.textLabel.textColor = [UIColor blackColor];
9494
#else
9595
cell.textColor = [UIColor blackColor];

InAppSettingsTestApp/InAppSettingsTestApp.xcodeproj/project.pbxproj

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
GCC_WARN_UNUSED_VARIABLE = YES;
316316
PREBINDING = NO;
317317
RUN_CLANG_STATIC_ANALYZER = YES;
318-
SDKROOT = iphoneos2.2.1;
318+
SDKROOT = iphoneos2.0;
319319
};
320320
name = Debug;
321321
};
@@ -343,7 +343,7 @@
343343
GCC_WARN_UNUSED_VARIABLE = YES;
344344
PREBINDING = NO;
345345
RUN_CLANG_STATIC_ANALYZER = YES;
346-
SDKROOT = iphoneos2.2.1;
346+
SDKROOT = iphoneos2.0;
347347
};
348348
name = Release;
349349
};

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright InScopeApps{+} 2009.
3+
Copyright David Keegan 2009-2010
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
InAppSettings provides a view controller that will read your applications Setting.bundle, allowing you to have the same preferences in your application and in the system settings.
1+
InAppSettings provides a view controller that displays the application's Settings.bundle as it appears in the iPhone settings. Allowing the same preferences in app and in the iPhone settings.
2+
3+
InAppSettings works under any version of the iPhone or iPod Touch OS.
24

35
InAppSettingsTestApp is a simple application for testing that InAppSettings is working correctly.
46

@@ -9,5 +11,25 @@ David Keegan
911

1012
With contributions from:
1113
Shayne Sweeney
14+
Hendrik Kueck
15+
16+
InAppSettingsTestApp icons by Joseph Wain - http://glyphish.com/
17+
18+
19+
How to Add InAppSettings to Your App
20+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21+
1. Drag InAppSettings into your project in Xcode.
22+
2. InAppSettings is just a view controller called InAppSettingsViewController, you can use it just like you would any other view controller.
23+
24+
For example:
25+
- (IBAction)showSettings{
26+
InAppSettingsViewController *settings = [[InAppSettingsViewController alloc] init];
27+
[self.navigationController pushViewController:settings animated:YES];
28+
[settings release];
29+
}
30+
31+
Or InAppSettings can be called from a nib by changing the class type of a UIViewController to InAppSettingsViewController.
32+
33+
InAppSettingsTestApp implements InAppSettings both ways.
1234

13-
Icons by Joseph Wain - http://glyphish.com/
35+
Please note that in order for subviews of InAppSettings to work InAppSettingsViewController must be added to a navigation controller.

0 commit comments

Comments
 (0)