Use a playground to layout iOS views without storyboards.
- Create a workspace in a directory.
- Create an application project in the directory.
- Add the project to the workspace.
- Create an application framework in the directory.
- Add the framework to the workspace.
- Create a playground in the directory.
- Add the playground to the workspace.
- Build the application framework.
- Import the framework into the playground.
- Add
github "SnapKit/SnapKit"
in theCartfile
for the framework. carthage update
- Follow the steps of Adding frameworks to unit tests or a framework.
- The "Copy Files" build phase is also needed.
- Create a public UIView in the framework.
- Write a code for layout.
- Build the framework.
- Execute the playground.
- Application projects cannot be used in a playground.
- Application frameworks need to have "Copy Files" build phase for Carthage frameworks.