Difference between revisions of "OBWelcomeController"

From iPhone Development Wiki
Jump to: navigation, search
m (Minor grammar fix - parallelism)
(Inline button tray)
Line 15: Line 15:
 
[exampleWelcomeController addBulletedListItemWithTitle:@"Item 2" description:@"It can be as long as you want - the view will auto-resize, and even center the icon for the item!" image:[UIImage systemImageNamed:@"plus.app"];
 
[exampleWelcomeController addBulletedListItemWithTitle:@"Item 2" description:@"It can be as long as you want - the view will auto-resize, and even center the icon for the item!" image:[UIImage systemImageNamed:@"plus.app"];
 
[exampleWelcomeController addBulletedListItemWithTitle:@"Item 3" description:@"Look at you, making fancy views. If only Apple would make this framework public." image:[UIImage systemImageNamed:@"app.badge"];
 
[exampleWelcomeController addBulletedListItemWithTitle:@"Item 3" description:@"Look at you, making fancy views. If only Apple would make this framework public." image:[UIImage systemImageNamed:@"app.badge"];
 +
</source>
 +
 +
==Managing the button tray==
 +
===Inlining the button tray===
 +
By default, the button tray has a blur effect behind it if the bulleted list goes past where the button tray would normally be. If you would rather have the button tray placed below the list, so that the user must scroll to see the button, just set:
 +
<source lang="objc">
 +
exampleWelcomeController._shouldInlineButtonTray = YES;
 
</source>
 
</source>
  

Revision as of 23:14, 29 June 2020

OBWelcomeController is a view controller subclass in OnBoardingKit.framework.

Creating an instance

OBWelcomeController *exampleWelcomeController = [[OBWelcomeController alloc] initWithTitle:@"Example Title" detailText:@"Example Details" icon:[UIImage systemImageNamed:@"circle" contentLayout:2];

A few notes

- contentLayout:2 seems to be the only way to go. Other options appear to crash.

- You can use any regular UIImage. The system image is used here as an example.

Adding items to the controller

[exampleWelcomeController addBulletedListItemWithTitle:@"Item 1" description:@"A nice-looking, responsive description." image:[UIImage systemImageNamed:@"app"];
[exampleWelcomeController addBulletedListItemWithTitle:@"Item 2" description:@"It can be as long as you want - the view will auto-resize, and even center the icon for the item!" image:[UIImage systemImageNamed:@"plus.app"];
[exampleWelcomeController addBulletedListItemWithTitle:@"Item 3" description:@"Look at you, making fancy views. If only Apple would make this framework public." image:[UIImage systemImageNamed:@"app.badge"];

Managing the button tray

Inlining the button tray

By default, the button tray has a blur effect behind it if the bulleted list goes past where the button tray would normally be. If you would rather have the button tray placed below the list, so that the user must scroll to see the button, just set:

exampleWelcomeController._shouldInlineButtonTray = YES;

Pushing the controller

[aViewController presentViewController:exampleWelcomeController animated:YES completion:nil];