PSSpecifier: Difference between revisions

From iPhone Development Wiki
No edit summary
m (Unnecessary change inconsistent with standard)
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{occlass|library=Preferences.framework}}
'''PSSpecifier''' represents a user-facing setting or actionable item in the {{fwlink|Preferences}} framework. Specifiers are typically loaded from dictionary representations, but can be created at runtime with {{ObjcCall|PSSpecifier|preferenceSpecifierNamed:target:set:get:detail:cell:edit:|ClassMethod=1}}; they are often used in conjunction with a [[PSListController]], which contains logic for rendering them into a table.
Documented by kennytm at [http://code.google.com/p/networkpx/wiki/PreferencesSpecifierPlistFormat networkpx]


Preference specifiers have properties as documented at [[Preferences specifier plist]]. Each specifier is given a type and may contain a default value (used for display purposes only), a preferences domain, a preferences key, and selectors to invoke for various actions.


== Additions ==
== Additions ==
Line 8: Line 8:


==== Custom Height ====
==== Custom Height ====
Override - (CGFloat)preferencesTable:(UIPreferencesTable *)table heightForRow:(NSInteger)row inGroup:(NSInteger)group withProposedHeight:(CGFloat)proposedHeight; on your PSListController subclass to change the size of the cell.
 
On your PSListController subclass, to change the size of the cell override
 
<source lang="objc">
- (CGFloat)preferencesTable:(UIPreferencesTable *)table heightForRow:(NSInteger)row inGroup:(NSInteger)group withProposedHeight:(CGFloat)proposedHeight;
</source>


Call setUserInfo on the specifier to set the inner text view height:
Call setUserInfo on the specifier to set the inner text view height:
Line 15: Line 20:
[specifier setUserInfo:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:180] forKey:@"height"]];
[specifier setUserInfo:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:180] forKey:@"height"]];
</source>
</source>
{{occlass|library=Preferences.framework|navbox=1}}
[[Category:Preferences]]

Latest revision as of 02:57, 11 April 2016

PSSpecifier represents a user-facing setting or actionable item in the Preferences framework. Specifiers are typically loaded from dictionary representations, but can be created at runtime with +[PSSpecifier preferenceSpecifierNamed:target:set:get:detail:cell:edit:]; they are often used in conjunction with a PSListController, which contains logic for rendering them into a table.

Preference specifiers have properties as documented at Preferences specifier plist. Each specifier is given a type and may contain a default value (used for display purposes only), a preferences domain, a preferences key, and selectors to invoke for various actions.

Additions

PSEditTextViewCell

Custom Height

On your PSListController subclass, to change the size of the cell override

- (CGFloat)preferencesTable:(UIPreferencesTable *)table heightForRow:(NSInteger)row inGroup:(NSInteger)group withProposedHeight:(CGFloat)proposedHeight;

Call setUserInfo on the specifier to set the inner text view height:

[specifier setUserInfo:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:180] forKey:@"height"]];