Images

For buttons
1. Go to assets.xcassets
2. Click on the + sign at the bottom left of the screen.
3. Select new image set. 
4. Double click to rename the new image set.
5. 1x, 2x and 3x shows the resolution.
6. Open up the folder containing the image and drag and drop it into the 1x square.
7. Drag and drop a button into the storyboard. Assign its background image as the image you have included above. Background image - you still get to write text to the button.

Adding an entire image folder into the project.
Drag and drop the entire folder into the main folder.
Check copy items if needed.

Shortcut:
Drag and drop all the images into assets.xcassets. 
Name the images before you drag and drop.

Add image via image view:
1. Go to object library and drop in an image view.
2. Add constraints.
3. After adding the image to the project folder or the assets folder, set the image for the image view.
4. Play around with the mode.
5. If you choose clip to bounds, it will crop itself so that it will fit into the constraints given.

Comments

Popular posts from this blog

Setting up a playground

Go to another page