Sketch Tutorial for iOS Developers

In this Sketch tutorial for iOS developers, you’ll get a quick tour of how to use Sketch to create iOS app mockups, icons, and more! By Robert Chen.

Leave a rating/review
Save for later
Share
You are currently viewing page 4 of 4 of this article. Click here to view the first page.

Round Profile Avatars

The RWDevCon mockup has round profile pictures of each speaker. To achieve this effect, you’ll use the Mask feature, which is very similar to Subtract. But rather than cutting a hole, Mask trims the outside of a shape like the crust off of a peanut butter and jelly sandwich.

Let’s create an avatar:

  1. Expand the Greg Before Artboard in the Layer List.
  2. Inside this Artboard, create a circle big enough to cover his face.
  3. Select both the greg layer and the oval layer you just created.
  4. Make sure the mask layer (in this case, the oval) is on the bottom.
  5. Click the Mask button.
  6. Expand the newly combined greg layer and select the Mask layer.
  7. Add a Border, and use the arrow keys to adjust the position.

greg-mask

Make sure the masking layer is on the bottom. This is the opposite of Subtract, where the hole goes on top.

Image Export

You can export a single layer by clicking Make Exportable near the bottom right of the screen.

If you want to export multiple layers, there are a couple ways to do this:

  • Group: When layers are grouped together, you can export the Group as a single image.
  • Artboard: All the layers inside the Artboard are exported as a single image. The image size is based on the Artboard frame.

Before you export, check the Width and Height in the Inspector. These dimensions determine the @1x size of your image export.

Pro tip: Rather than resizing shapes using the bottom-right corner, use the Scale button. Scale ensures style properties like border width and corner radius remain proportional after resizing.

Pro tip: Rather than resizing shapes using the bottom-right corner, use the Scale button. Scale ensures style properties like border width and corner radius remain proportional after resizing.

scale

PNG

Sketch makes it easy to export images in different densities:

  1. On the bottom right, click on Make Exportable.
  2. Click the Plus button to add a @2x copy.
  3. Click the Plus button again to add a @3x copy.
  4. Click the Export button to save the PNG files to disk.

exporting

PDF

You’re probably used to creating @2x and @3x versions of every image, but Sketch is vector-based, so take advantage of that. Xcode accepts vector images in PDF format, which is like SVG but with size information.

  1. Click on Make Exportable.
  2. Keep the size at 1x.
  3. Select PDF as the Format, and click Export.

export-pdf

You can import this single PDF icon into the Asset Catalog.

  1. Within Xcode, open Images.xcassets.
  2. Create a New Image Set.
  3. In the Attributes Inspector, change Scale Factors from Multiple to Single Vector.
  4. Drop your PDF icon into the All image slot.

scale-factors

Xcode will generate the appropriate @2x and @3x PNG files for you at build time. You still end up with PNGs, so the benefit is managing fewer image files.

Where To Go From Here?

And that’s our intro to Sketch! You can download the Sketch project file here.

Sketch is powerful, with a lot of great features beyond what’s covered in this tutorial. To learn more, check out the official documentation. There are also blogs and videos for learning tips and tricks.

Finally, you can also download Sketch files that contain icon sets and vector images of iOS devices.

We hope you enjoyed this tutorial, and if you have any questions or comments, please join the discussion below!

Robert Chen

Contributors

Robert Chen

Author

Over 300 content creators. Join our team.