Drawing in iOS with SwiftUI [FREE]

栏目: IT技术 · 发布时间: 5年前

Drawing with SwiftUI

Introduction

2:20 Free

In this course, find out how to draw using SwiftUI, create some custom controls and create an app in which you can create a simple mind map with sketches.

Shapes

6:51

Start off by going over simple colors and shapes and understand how to add them to your views. Use modifiers to clip views to your chosen shape.

Colors

6:20

Learn about Gradients, how to create your own named colors, and what dark mode means for your colors.

Explore SwiftUI paths, and the many ways of outlining with a stroke. Learn how to create complex custom shapes made up of paths and transformations.

Challenge time! In this episode, practice creating your own custom shape. Let's dive in!

Create a list of shapes to select from, then learn how to exploit type erasure and create enums with associated values.

Learn about GeometryReader and how to use it for laying out views. Create a scrolling grid list of custom shapes.

Create data storage for the mind map cells using an environment object, and draw example cells from the model.

Gestures

10:45

Learn how to create gestures to select a mind map cell, drag it, and add a new cell by double-tapping the background.

Conclusion

0:49

Review where you are with your SwiftUI drawing, and look forward to how we'll enhance our skills by drawing custom controls.

Custom Controls

In this section, you'll learn how to make custom controls by creating a simple slider and a complex flyout menu with multiple options.

Create a custom slider with a gradient background, and learn how to send inputs to controls and receive outputs.

Later, you'll create a sketch pad, so here you'll create a reusable color picker to allow the selection of different drawing colors.

SF Symbols are fantastic Apple-designed vector icons. But did you know you can create your own SF Symbols? Open up your vector editor and have a go!

Learn about rotation and scale effects by creating a circular flyout menu and placing your icons around the edge of a circle.

Install the menu into the app and add custom actions to it. You'll be able to delete cells and also use your shapes grid to choose the shape of each cell.

In this episode, learn how easy it is to create a simple drawing pad using drag gestures and SwiftUI paths.

To practice installing an existing custom control, install the color picker into the drawing pad and hook it up to the drawing color.

Conclusion

1:09

Review custom controls and look ahead to the next part, where you'll combine UIKit views with SwiftUI views.

Support SwiftUI with Core Graphics

In this part you'll draw images, use Core Graphics with UIKit and merge these views seamlessly with your existing SwiftUI app.

Understand how the SwiftUI paradigm differs from UIKit. Learn how a view is rendered, and discover Core Animation layers and Core Graphics contexts.

Examine the View Hierarchy Debugger in Xcode. Then create a Core Graphics context, draw into it and extract an image.

Upgrade your SwiftUI drawing pad to UIKit. Examine the app architecture and understand how to insert UIKit views in a SwiftUI app.

Learn how to use Pencil for custom drawing and draw smooth lines with thickness dependent on pressure.

Understand the extra features that drawing with Pencil gives you. Use the tilt of the pencil to change from drawing to shading.

Now that you've created a UIKit drawing pad, add it as a custom option to the flyout menu and show it as a modal view.

In your final challenge, extract the sketch from the drawing pad into an image, create a thumbnail and display it on a mind map cell.

Go low-level into Core Graphics and examine individual pixels. Learn how to retrieve the pixel color and switch the drawing color to this color.

Conclusion

1:34

Congrats on finishing the course! Review what you've learned, and find out where to go from here.


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

OKR工作法

OKR工作法

克里斯蒂娜•沃特克 (Christina Wodtke) / 明道团队 / 中信出版社 / 2017-9-1 / CNY 42.00

《OKR工作法》讲述了一种风靡硅谷科技企业的全新工作模式。 如何激励不同的团队一起工作,全力以赴去实现一个有挑战性的目标? 硅谷的两个年轻人汉娜和杰克,像很多人一样,在萌生了一个创意后,就走上创业之路。但是,很快他们发现好的想法远远不够,必须还有一套适合的管理方法确保梦想能实现。为了让创业团队生存下来,汉娜和杰克遭受了内心的苦苦挣扎和煎熬。他们患上“新奇事物综合症”,什么都想做,导致无......一起来看看 《OKR工作法》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具