Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198
OBWelcomeController: Difference between revisions - iPhone Development Wiki

OBWelcomeController: Difference between revisions

From iPhone Development Wiki
(Well, here we go! My first real documentation!)
 
m (Minor grammar fix - parallelism)
Line 17: Line 17:
</source>
</source>


==Push the controller==
==Pushing the controller==
<source lang="objc">
<source lang="objc">
[aViewController presentViewController:exampleWelcomeController animated:YES completion:nil];
[aViewController presentViewController:exampleWelcomeController animated:YES completion:nil];

Revision as of 22:49, 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"];

Pushing the controller

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