Skip to content

Commit fc0459b

Browse files
authored
Merge pull request #503 from funnel20/SampleApp_docu
Added section `sample app`
2 parents f1497ca + ee738a7 commit fc0459b

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ IASK not only replicates the feature set of system settings but supports a large
1919

2020
- [How does it work?](#how-does-it-work)
2121
- [How to include it?](#how-to-include-it)
22+
- [Sample application](#sample-application)
2223
- [App Integration](#app-integration)
2324
- [Goodies](#goodies)
2425
- [Custom inApp plists](#custom-inapp-plists)
@@ -77,6 +78,18 @@ Add to your `Cartfile`:
7778

7879
github "futuretap/InAppSettingsKit" "master"
7980

81+
82+
# Sample application
83+
84+
InAppSettingsKit contains an Xcode sample application, that demonstrates all of it's extensive features. Both for a push and modal view controller.
85+
To run the sample application:
86+
87+
1. From the project root folder, open `InAppSettingsKit.xcworkspace` in Xcode.
88+
2. Change the scheme to `Sample App` (Product > Scheme > Sample App).
89+
3. Select a destination, like an iPhone Simulator.
90+
4. To build and run the application, choose Product > Run, or click the Run button in the Xcode toolbar.
91+
92+
8093
# App Integration
8194

8295
In order to start using IASK add `Settings.bundle` to your project (`File` -> `Add File` -> `Settings bundle`) and edit `Root.plist` with your settings (see Apple's documentation on the [Schema File Root Content](https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/UserDefaults/Preferences/Preferences.html)). Read on to get insight into more advanced uses.
@@ -147,7 +160,7 @@ IASKAppSettingsViewController *appSettingsViewController = [[IASKAppSettingsView
147160
- Set the delegate comforming to `IASKAppSettingsViewControllerDelegate`.
148161
- Implement the delegate method `-settingsViewControllerDidEnd:` and dismiss the view controller.
149162
150-
The sample application shows how to wire everything up.
163+
The [sample application](#sample-application) shows how to wire everything up.
151164
152165
**Additional changes**
153166
@@ -182,7 +195,7 @@ If the app includes a usage key for various privacy features such as camera or l
182195
183196
If you don't want to show Privacy cells, set the property `neverShowPrivacySettings` to `YES`.
184197
185-
The sample app defines `NSMicrophoneUsageDescription` to let the cell appear. Note that the settings page doesn't show any privacy settings yet because the app doesn't actually access the microphone. Privacy settings only show up in the Settings app after first use of the privacy-protected API.
198+
The [sample application](#sample-application) defines `NSMicrophoneUsageDescription` to let the cell appear. Note that the settings page doesn't show any privacy settings yet because the app doesn't actually access the microphone. Privacy settings only show up in the Settings app after first use of the privacy-protected API.
186199
187200
188201
## Open URL
@@ -207,7 +220,7 @@ InAppSettingsKit adds a `IASKButtonSpecifier` element that allows to call a cust
207220
208221
- (void)settingsViewController:(IASKAppSettingsViewController*)sender buttonTappedForSpecifier:(IASKSpecifier*)specifier;
209222
210-
The sender is always an instance of `IASKAppSettingsViewController`, a `UIViewController` subclass. So you can access its view property (might be handy to display an action sheet) or push another view controller. Another nifty feature is that the title of IASK buttons can be overriden by the (localizable) value from `NSUserDefaults` (or any other settings store - see below). This comes in handy for toggle buttons (e.g. Login/Logout). See the sample app for details.
223+
The sender is always an instance of `IASKAppSettingsViewController`, a `UIViewController` subclass. So you can access its view property (might be handy to display an action sheet) or push another view controller. Another nifty feature is that the title of IASK buttons can be overriden by the (localizable) value from `NSUserDefaults` (or any other settings store - see below). This comes in handy for toggle buttons (e.g. Login/Logout). See the [sample application](#sample-application) for details.
211224
212225
By default, Buttons are aligned centered except if an image is specified (default: left-aligned). The default alignment may be overridden.
213226
@@ -298,7 +311,7 @@ For footer customization, three methods from the `IASKSettingsDelegate` protocol
298311
## Extending Child Panes
299312
300313
### Custom ViewControllers
301-
For child pane elements (`PSChildPaneSpecifier`), Apple requires a `file` key that specifies the child plist. InAppSettingsKit allow to alternatively specify `IASKViewControllerClass` and `IASKViewControllerSelector`. In this case, the child pane is displayed by instantiating a UIViewController subclass of the specified class and initializing it using the init method specified in the `IASKViewControllerSelector`. The selector must have two arguments: an `NSString` argument for the file name in the Settings bundle and the `IASKSpecifier`. The custom view controller is then pushed onto the navigation stack. See the sample app for more details.
314+
For child pane elements (`PSChildPaneSpecifier`), Apple requires a `file` key that specifies the child plist. InAppSettingsKit allow to alternatively specify `IASKViewControllerClass` and `IASKViewControllerSelector`. In this case, the child pane is displayed by instantiating a UIViewController subclass of the specified class and initializing it using the init method specified in the `IASKViewControllerSelector`. The selector must have two arguments: an `NSString` argument for the file name in the Settings bundle and the `IASKSpecifier`. The custom view controller is then pushed onto the navigation stack. See the [sample application](#sample-application) for more details.
302315
303316
### Using Custom ViewControllers from StoryBoard
304317
Alternatively specify `IASKViewControllerStoryBoardId` to initiate a viewcontroller from [main storyboard](https://developer.apple.com/library/ios/documentation/general/conceptual/Devpedia-CocoaApp/Storyboard.html/).
@@ -357,7 +370,7 @@ MultiValue lists (`PSMultiValueSpecifier`) and radio groups (`PSRadioGroupSpecif
357370
- (NSArray*)settingsViewController:(IASKAppSettingsViewController*)sender valuesForSpecifier:(IASKSpecifier*)specifier;
358371
- (NSArray<NSString*>*)settingsViewController:(IASKAppSettingsViewController*)sender titlesForSpecifier:(IASKSpecifier*)specifier;
359372
360-
The sample app returns a list of all country codes as values and the localized country names as titles.
373+
The [sample application](#sample-application) returns a list of all country codes as values and the localized country names as titles.
361374
362375
MultiValue lists can be sorted alphabetically by adding a `true` Boolean `DisplaySortedByTitle` key in the Plist.
363376
MultiValue list entries can be given an image. Specify images via the `IconNames` attribute (next to Values/Titles/ShortTitles etc.).
@@ -382,7 +395,7 @@ or the non-animated version:
382395
383396
@property (nonatomic, strong) NSSet *hiddenKeys;
384397
385-
See the sample app for more details. Including a `PSGroupSpecifier` key in the `hiddenKeys` hides the complete section.
398+
See the [sample application](#sample-application) for more details. Including a `PSGroupSpecifier` key in the `hiddenKeys` hides the complete section.
386399
387400
388401
## Register default values

0 commit comments

Comments
 (0)