Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding support for all versions of OS 2.X

  • Loading branch information...
commit 8f92f1bd92fd247f718b545dded03baea00ad21c 1 parent 784f518
@keegan3d keegan3d authored
View
2  InAppSettings/Cells/InAppSettingsTableCell.m
@@ -93,7 +93,7 @@ - (void)setValue:(id)newValue{
- (id)initWithSetting:(InAppSetting *)inputSetting reuseIdentifier:(NSString *)reuseIdentifier{
//the docs say UITableViewCellStyleValue1 is used for settings,
//but it doesn't look 100% the same so we will just draw our own UILabels
- #if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_2_2
+ #if InAppSettingUseNewCells
self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
#else
self = [super initWithFrame:CGRectZero reuseIdentifier:reuseIdentifier];
View
3  InAppSettings/InAppSettingConstants.h
@@ -15,3 +15,6 @@
#define InAppSettingFontSize 17.0f
#define InAppSettingBoldFont [UIFont boldSystemFontOfSize:InAppSettingFontSize]
#define InAppSettingNormalFont [UIFont systemFontOfSize:InAppSettingFontSize]
+
+//test what cell init code should be used
+#define InAppSettingUseNewCells __IPHONE_3_0 && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_0
View
8 InAppSettings/PSMultiValueSpecifierTable.m
@@ -65,7 +65,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil){
- #if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_2_2
+ #if InAppSettingUseNewCells
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
#else
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
@@ -74,14 +74,14 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
NSString *cellTitle = NSLocalizedString([[self.setting valueForKey:@"Titles"] objectAtIndex:indexPath.row], nil);
id cellValue = [[self.setting valueForKey:@"Values"] objectAtIndex:indexPath.row];
- #if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_2_2
+ #if InAppSettingUseNewCells
cell.textLabel.text = cellTitle;
#else
cell.text = cellTitle;
#endif
if([cellValue isEqual:[self getValue]]){
cell.accessoryType = UITableViewCellAccessoryCheckmark;
- #if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_2_2
+ #if InAppSettingUseNewCells
cell.textLabel.textColor = InAppSettingBlue;
#else
cell.textColor = InAppSettingBlue;
@@ -89,7 +89,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
}
else{
cell.accessoryType = UITableViewCellAccessoryNone;
- #if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_2_2
+ #if InAppSettingUseNewCells
cell.textLabel.textColor = [UIColor blackColor];
#else
cell.textColor = [UIColor blackColor];
View
4 InAppSettingsTestApp/InAppSettingsTestApp.xcodeproj/project.pbxproj 100755 → 100644
@@ -315,7 +315,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
RUN_CLANG_STATIC_ANALYZER = YES;
- SDKROOT = iphoneos2.2.1;
+ SDKROOT = iphoneos2.0;
};
name = Debug;
};
@@ -343,7 +343,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
RUN_CLANG_STATIC_ANALYZER = YES;
- SDKROOT = iphoneos2.2.1;
+ SDKROOT = iphoneos2.0;
};
name = Release;
};
View
2  LICENSE
@@ -1,6 +1,6 @@
The MIT License
-Copyright InScopeApps{+} 2009.
+Copyright David Keegan 2009-2010
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
26 README
@@ -1,4 +1,6 @@
-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.
+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.
+
+InAppSettings works under any version of the iPhone or iPod Touch OS.
InAppSettingsTestApp is a simple application for testing that InAppSettings is working correctly.
@@ -9,5 +11,25 @@ David Keegan
With contributions from:
Shayne Sweeney
+Hendrik Kueck
+
+InAppSettingsTestApp icons by Joseph Wain - http://glyphish.com/
+
+
+How to Add InAppSettings to Your App
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1. Drag InAppSettings into your project in Xcode.
+2. InAppSettings is just a view controller called InAppSettingsViewController, you can use it just like you would any other view controller.
+
+For example:
+- (IBAction)showSettings{
+ InAppSettingsViewController *settings = [[InAppSettingsViewController alloc] init];
+ [self.navigationController pushViewController:settings animated:YES];
+ [settings release];
+}
+
+Or InAppSettings can be called from a nib by changing the class type of a UIViewController to InAppSettingsViewController.
+
+InAppSettingsTestApp implements InAppSettings both ways.
-Icons by Joseph Wain - http://glyphish.com/
+Please note that in order for subviews of InAppSettings to work InAppSettingsViewController must be added to a navigation controller.
Please sign in to comment.
Something went wrong with that request. Please try again.