• Stars
    star
    233
  • Rank 171,576 (Top 4 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 13 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

InAppSettings is an open source iPhone and iPod touch framework for displaying an in app version of the settings from the Settings.bundle.

There has been a lot of debate over whether an app's settings should be in the app or in the Settings app. InAppSettings is an open source framework determined to remedy this situation once and for all by easily allowing developers to have the same settings in the Settings app in in their app. InAppSettings uses the same Settings.bundle so there is no duplication of files or work. Simply add InAppSettings to the app's project and call it's view controler from code or Interface Builder and you're done! The InAppSettings wiki contains a full guide, including example code, for adding InAppSettings to an iPhone or iPod touch app.

By: David Keegan

With contributions from:

  • Shayne Sweeney
  • Hendrik Kueck
  • Peter Greis
  • Kurt Arnlund

Features

  • 100% re-implementation of the look and functionality of the Settings app.
  • Easily add InAppSettings to any navigation controller from code or Interface Builder, InAppSettings can also be displayed as a modal view.
  • Support for all versions of the iPhone and iPod Touch OS, 2.0+.
  • Support for settings language localization.
  • InAppSettings contains a class method for initializing all the user defaults in the Settings.bundle.
  • InAppSettings adds additional functionality to the Settings.bundle by adding optional values for in app titles and opening urls.
  • Sample project that demonstrates how to use InAppSettings from code, Interface Builder and a modal view.

License

InAppSettings was developed by David Keegan and is distributed under the MIT license so it can be used in free or commercial apps. See the LICENSE file for more information.

How to add InAppSettings to Your App

Drag InAppSettings into your project in Xcode. Make sure the dialog looks like this, then press 'Add'.

If you will be using InAppSettings in multiple projects, and I hope you do:), add InAppSettings to your source trees in the Xcode preferences. If you do this the 'add' settings should look like this, then press 'Add'.

InAppSettingsViewController

The InAppSettingsViewController is a subclass of the UIViewController that displays the settings from the Settings.bundle. It can be used from code and Interface Builder.

Using InAppSettingsViewController From Code

#import "InAppSettings.h"

- (IBAction)showSettings{
    InAppSettingsViewController *settings = [[InAppSettingsViewController alloc] init];
    [self.navigationController pushViewController:settings animated:YES];
    [settings release];
}

Using InAppSettingsViewController From Interface Builder

To use InAppSettingsViewController in Interface Builder, change the class type of any UIViewController to InAppSettingsViewController.

To work correctly the InAppSettingsViewController must be added to an existing UINavigationController.

InAppSettingsTestApp demonstrates how to use InAppSettingsViewController from code and Interface Builder.

InAppSettingsModalViewController

The InAppSettingsModalViewController is a subclass of UIViewController that creates its own UINavigationController. It is designed to be used as a modal view and is created with a 'Done' button that will dismiss the view.

How to use InAppSettingsModalViewController from code

#import "InAppSettings.h"

- (IBAction)presentSettings{
    InAppSettingsModalViewController *settings = [[InAppSettingsModalViewController alloc] init];
    [self presentModalViewController:settings animated:YES];
    [settings release];
}

The InAppSettingsModalViewController should not be used from Interface Builder.

InAppSettingsTestApp demonstrates how to use InAppSettingsModalViewController as a modal view.

[InAppSettings registerDefaults]

The user defaults from the Settings.bundle are not initialized on startup, and are only initialized when viewed in the Settings App. InAppSettings has a registerDefaults class method that can be called to initialize all of the user defaults from the Settings.bundle.

How to use [InAppSettings registerDefaults] from code

The InAppSettings registerDefaults method should be called from the AppDelegate's initialize method.

#import "InAppSettings.h"

+ (void)initialize{
    if([self class] == [AppDelegate class]){
        [InAppSettings registerDefaults];
    }
}

The name of the 'AppDelegate' will need to change to the name of the app's AppDelegate class.

Custom settings specifier keys

InAppTitle

InAppTitle is an optional settings specifier key that can be added to any settings specifier. If present this title will be used in InAppSettings.

<dict>
    <key>Type</key>
    <string>PSGroupSpecifier</string>
    <key>Title</key>
    <string>Change the theme of the app</string>
    <key>InAppTitle</key>
    <string>Change the theme of the app, these changes will take effect the next time the app is launched</string>
</dict>

The Settings app will display: "Change the theme of the app", but InAppSettings will display: "Change the theme of the app, these changes will take effect the next time the app is launched".

InAppURL

InAppTitle is an optional settings specifier key that can be added to PSTitleValueSpecifier. If present a disclosure indicator will be added to the cell, and the specified url will be opened when the cell is tapped.

<dict>
    <key>Type</key>
    <string>PSTitleValueSpecifier</string>
    <key>Title</key>
    <string>Created by:</string>
    <key>Key</key>
    <string>testUrl</string>
    <key>DefaultValue</key>
    <string>kgn {+}</string>
    <key>InAppURL</key>
    <string>http://www.kgn.com</string>
</dict>

To open a webpage the url MUST startwith "http://".

InAppSettingsTestApp

The InAppSettingsTestApp is a Xcode project for testing InAppSettings. It also demonstrates all the ways to use the InAppSettings view controllers and class methods.

More Repositories

1

KGNoise

Cocoa noise drawing code plus a ready to go noise view!
Objective-C
776
star
2

KGModal

KGModal is an easy drop in control that allows you to display any view in a modal popup.
Objective-C
453
star
3

Hark

An example Text to Speech App
Swift
186
star
4

BBlock

Objective-c block categories and subclasses
Objective-C
168
star
5

KGNAutoLayout

Making AutoLayout Easy
Swift
124
star
6

DBPrefsWindowController

A subclass of NSWindowController that provides an easy way to create preference windows.
Objective-C
116
star
7

KGDiscreetAlertView

An easy drop in control that allows you to display a discrete alert in any view.
Objective-C
101
star
8

KGKeyboardChangeManager

A block-based wrapper around the hairy world of iOS keyboard notifications and frames
Objective-C
93
star
9

Spectttator

Spectttator is an Objective-C framework for OSX and iOS that makes it easy to asynchronously interact with the dribbble api.
Objective-C
86
star
10

UIImage-Vector

UIImage category for dealing with vector formats like PDF and icon fonts.
Objective-C
73
star
11

KGNotePad

KGNotePad is a text view complete with lines and torn paper.
Objective-C
71
star
12

PaintCodeExample

An example iPhone app using PaintCode and BBlock
Objective-C
68
star
13

KGPixelBoundsClip

NSImage and UIImage category that provides methods to find the pixel bounds of an image and create a new image clipped to those bounds.
Objective-C
62
star
14

LinenClipView

Adds a linen pattern behind scrollviews like in Apple's Lion apps.
Objective-C
58
star
15

LaunchAtLoginHelper

A helper app to launch a main app at login under sandboxing
Objective-C
57
star
16

EyeTunes

This is a git-svn fork of the EyeTunes project with support for iTunes 10.
Objective-C
34
star
17

KGNPreferredFontManager

Helper class to registering custom fonts for UIFontTextStyle
Swift
21
star
18

JSONMagic

JSONMagic makes it easy to traverse and parse JSON in Swift.
Swift
19
star
19

UIColorCategories

Category methods UIColor
Objective-C
15
star
20

SCKeyRecorder

An Objective-C shortcut recorder for the Mac.
Objective-C
15
star
21

Coaches-Loupe

Upload shots to dribbble.com
C
14
star
22

KGJSON

A simple category around NSJSONSerialization for common JSON string operations
Objective-C
13
star
23

BBBouncePass

An Objective-C library for uploading shots to Dribbble.
Objective-C
12
star
24

KGNGradientView

KGNGradientView is a collection UIView subclasses for linear and radial gradients.
Swift
10
star
25

pygml

A python library for reading and writing gml files.
Python
9
star
26

KGLib

Cocoa library code
Objective-C
8
star
27

KGNCameraController

A camera view build on top of AVFoundation
Objective-C
7
star
28

Gister

Cocoa app for viewing gists.
Objective-C
7
star
29

KGNColor

A collection of UIColor extensions
Swift
7
star
30

BirdHouseKit

An AFNetworking based Twitter library(unfinished)
Objective-C
6
star
31

UIView-KGNAutoLayout

Auto Layout helper methods for common layout operations.
Objective-C
6
star
32

ShapecatcherKit

An Objective-CFramework for the shapecatcher.com api
Objective-C
5
star
33

ImageViewPlus

A Safari Extension that adds formatting to the image view page.
JavaScript
5
star
34

kgn_icons

Icons
Python
5
star
35

KGNThread

A collection of helpful methods that wrap GCD
Swift
4
star
36

NSData-Base64

Git repo of http://cocoawithlove.com/2009/06/base64-encoding-options-on-mac-and.html
Objective-C
4
star
37

IcnsFactory

Create Mac Icons(.icns) from Cocoa
Objective-C
3
star
38

TimeDisplay

A python package for displaying time deltas and runtimes as nice readable strings.
Python
3
star
39

cssutils

git clone
Python
3
star
40

CocoaVerbalExpression

Objective-C
2
star
41

buildly

Continuous build system for iOS apps
Python
2
star
42

sketchpreset

Useful sketch preset files
2
star
43

QLWebloc

This is a failed attempt to display the content of a webpage in quicklook from a .webloc file.
C
2
star
44

KGNUserInterface

A collection of the core user interface resources.
Swift
2
star
45

XCodeSnippets

CodeSnippets for Xcode + a python script to generate a readme so you can see what's in em
Python
2
star
46

pyglang

A python package for translating text with the 'Google AJAX Language API'
Python
2
star
47

KeeganScriptPack

A collection of mel scripts I wrote a while back.
2
star
48

CodingConventions

Name & Code Conventions for 1kLabs, Inc.
2
star
49

growlcoffee

Growl notifications for CoffeeScript
JavaScript
1
star
50

resume

My Resume
1
star
51

StyleGuide

The style guide for 1kLabs, Inc.
1
star
52

mdoc

GitHub markdown documentation generator for Objective-C
Python
1
star
53

PDFImageConverter

Modified code from a ipdfdev.com post
Objective-C
1
star
54

KGNSketchToolkit

Plugins for Sketch
JavaScript
1
star