Tutorial details

Random Text Colour Generator | App Code for Sale | Preview

Random Text Colour Generator | iOS Tutorial

How to create a random text colour generator

Overview PAGE TOP

Reference: http://www.geekylemon.com/WEBPROTECT-xcoderandomtextcolour.htm

In this tutorial i will be showing you how to create a random text colour generator


  • 1 Label
  • 1 Round Rect button

Creating random text colours will change the look and feel of an app dramatically and at random the user will not know whats coming next, Also used in games where a user would have to state the text colour to earn points

ViewController.h PAGE TOP

@interface ViewController : UIViewController {
IBOutlet UILabel *label;

ViewController. PAGE TOP

@implementation ViewController
-(IBAction)RandomColour {
int textcolour = rand() %5;
switch (textcolour) {
case 0:
label.textColor = [UIColor redColor];
case 1:
label.textColor = [UIColor blueColor];
case 2:
label.textColor = [UIColor greenColor];
case 3:
label.textColor = [UIColor orangeColor];
case 4:
label.textColor = [UIColor yellowColor];

Reference PAGE TOP


0 Comments Leave a comment

Please login in order to leave a comment.

Newest first

to your Chupamobile Account.

The Easiest way to Launch your next App or Game.

Join Chupamobile and get instant access to thousands of ready made App and Game Templates.

Creating an account means you’re okay with Chupamobile’s Terms of Service and Privacy Policy.