Skip to content
leuchtetgruen edited this page May 30, 2011 · 4 revisions

Hey, this is how you use the source.

  1. Copy the files from the Classes Directory to your own project
  2. Add 'CFNetwork' as a framework to your project
  3. Import 'UIViewController+Design.h' to your ViewController-Headerfile
  4. Make your ViewController inherit from UIViewControllerWithDesignerExtensions

That's it.

Now when you run your project in simulator doubletap anywhere in the view. Then select a UI element by just tapping on it. A red border will appear. You can move and resize the view. To resize it pull the lower right part of the view.

But that's not all. Have a UI element selected and open your Terminal. Type this command:

telnet localhost 10096

Now type

down:5

You just moved the selected UI element 5 px down.

Here's a list of commands you can use from the telnet interface:

  • down: , up: , left: , right:
  • width: , height: - the number you use as an argument is an offset you add to the height/width. e.g. height:-5 will make the view 5px less high
  • bgcolor:r:g:b(:a) , textcolor:r:g:b(:a) - e.g. use textcolor:255:0:0 to make the text of the selected view red
  • alignment:(left|center|right) - textaligmnent in the view
  • text: - set the text on the view
  • font:name:size - e.g. font:Helvetica:15 leads to Helvetica in 15px
  • fontsize: - e.g. font:17 leads to a 17px font

The last command that you will find very useful is

describe

It will output Objective-C code that describes the state of the selected ui element like this:

UILabel element = [[UILabel alloc] init];
element.frame = CGRectMake(20, 59, 119, 21);
element.backgroundColor = [UIColor colorWithRed:0.000 green:  0 blue:  0 alpha:  0];
element.textColor = [UIColor colorWithRed:0.000 green:  0 blue:  0 alpha:  1];
element.textAlignment = UITextAlignmentLeft;
element.text = @"Password";
element.font = [UIFont fontWithName:@"Helvetica" size:17];

Doubletap on the view again to get out of edit mode.

That's it - have fun with the project.

Clone this wiki locally