Playground is a utility that lets you inspect and modify layout properties while your app is running. Enable Playground with a gesture, update your layout and print changes to the console. When running your app in the Simulator, there’s support for using the keyboard to modify layout properties.
Example project: Playground Demo
Copy all the files in the Playground source folder to your project. If you’re using ARC, remember to add the -fno-objc-arc
flag to the added files.
To integrate Playground into your app:
self.window = [[PGWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
You can enable/disable Playground with a two finger long press gesture or define your own by setting the activateGestureRecognizer property.
Move view | ← → ↑ ↓ |
Decrease width | a |
Increase width | d |
Decrease height | s |
Increase height | w |
Move left in view hierarchy | j |
Move right in view hierarchy | l |
Move up in view hierarchy | i |
Move down in view hierarchy | k |
Display properties in console | p |
Apache License, Version 2.0
by Scott Tran
Twitter: @scott_tran