SVG image assets supported in Xcode 12

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

内容简介:In Xcode 12, Apple finally added support for SVG image assets. Under the hood, it should work the same way as PDF format that serve us for all these years. Despite no obvious techincal benefit, this change bring a lot of side benefits.Finally, we can use t

In Xcode 12, Apple finally added support for SVG image assets. Under the hood, it should work the same way as PDF format that serve us for all these years. Despite no obvious techincal benefit, this change bring a lot of side benefits.

Finally, we can use the same vector format that has been used across designer spaces. Do you remembered the first time you told a designer you want PDF format for your image assets? Nothing wrong with PDF format, but it is just not a format that most people use to represent vector image.

Less work for designers

Your designers doesn't have to export and maintain an extra format for iOS anymore.

Remove the need of designers or converting tools

Most vector stock out there only support SVG. In the past you might need to beg a designer or find a tool to do a convertion, but this would be no longer a case.

Most of the time, SVG are smaller than PDF. So, your codebase would be smaller.

You can treat it the same way as PDF format. Drag the file into your Assets Catalog and change the Scales value to Single Scale .

SVG image assets supported in Xcode 12
Adding SVG to Asset Catalogs
SVG image assets supported in Xcode 12
Xcode 12 Release Notes
Added support for Scalable Vector Graphic (SVG) image assets. These preserve their vector representation with deployment targets of macOS 10.15 or later, iOS 13 or later, and iPadOS 13 or later. (18389814)

You might misguid by the release note that the SVG support is only for macOS 10.15 or later, iOS 13 or later, and iPadOS 13 or later. In reallity the SVG support all the way back.

The SVG support all the way back.

If you read carefully, the function that required those deployment target is Vector data preservation . So, if you don't need to dynamically scale your image in runtime, you can safely convert all your image assets to SVG.

If your assets don't use this Preserve Vector Data , you can use SVG format without any restriction.

SVG image assets supported in Xcode 12
Non preserve vector data asset

SVG Support is a welcoming change that you might have missed during WWDC 2020. This small change bring a lot of hidden benefit to the platform and the best thing is you can start adopting it right away (withof course).


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

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

计算理论导引

计算理论导引

[美]Michael Sipser / 唐常杰、陈鹏、向勇、刘齐宏 / 机械工业出版社 / 2006-7 / 36.00元

本书是计算理论领域的经典著作,被国外多所大学选用为教材。本书以注重思路、深入引导为特色,系统地介绍计算理论的三大主要内容:自动机与语言、可计算性理论和计算复杂性理论。同时,对可计算性和计算复杂性理论中的某些高级内容作了重点讲解。全书通过启发性的问题、精彩的结果和待解决问题来引导读者挑战此领域中的高层次问题。新版的一大亮点是增加了更多习题、教辅资料和部分习题解答,更加有利于教学。 全书叙述由浅......一起来看看 《计算理论导引》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

SHA 加密
SHA 加密

SHA 加密工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具