iOS 圖標(biāo)設(shè)計(jì)工具

APP名稱:圖標(biāo)設(shè)計(jì)工具

運(yùn)行環(huán)境:iOS 9 以及以上系統(tǒng)

開發(fā)工具:xcode

簡介:

一款A(yù)PP圖標(biāo)生成工具,免去切圖煩惱。內(nèi)置2000多種圖標(biāo)素材,常用切圖素材應(yīng)有盡有。

自定義圖標(biāo)顏色、大小。

豐富的emoji表情。

新增QQ表情包,支持一鍵導(dǎo)出

功能:

【支持自定義圖標(biāo)素材】

【一鍵搜索方便查找】

【emoji、特殊字符一個(gè)不少】

【表情轉(zhuǎn)圖標(biāo)、文字轉(zhuǎn)圖標(biāo)盡情玩轉(zhuǎn)】

【UI、開發(fā)人員的專屬切圖利器】

APP預(yù)覽:


核心代碼:

import UIKit

extension UIImage {


? ? funcnormalizedImage() ->UIImage{

? ? ? ? ifself.imageOrientation == UIImageOrientation.up {

? ? ? ? ? ? returnself;

? ? ? ? }else{

? ? ? ? ? ? UIGraphicsBeginImageContextWithOptions(self.size,false,self.scale);

? ? ? ? ? ? self.draw(in: CGRect.init(x:0, y:0, width:self.size.width, height:self.size.height));

? ? ? ? ? ? letnormalizedImage:(UIImage)! = UIGraphicsGetImageFromCurrentImageContext()

? ? ? ? ? ? UIGraphicsEndImageContext()

? ? ? ? ? ? returnnormalizedImage;

? ? ? ? }

? ? }


? ? staticfuncimage(identifier:String,backgroundColor:UIColor,iconColor:UIColor,fontSize:CGFloat) ->UIImage{


? ? ? ? //// Abstracted Attributes

? ? ? ? vartextContent:String! = identifier;

? ? ? ? if(textContent.hasPrefix("fa-")) {

? ? ? ? ? ? textContent = NSString.fontAwesomeStringOfIdentifier(identifier: identifier)

? ? ? ? }

? ? ? ? letfont:UIFont! = UIFont.init(name:"FontAwesome", size: fontSize)

? ? ? ? letstyle:NSMutableParagraphStyle! = NSMutableParagraphStyle.default.mutableCopy()as!NSMutableParagraphStyle

? ? ? ? style.alignment = NSTextAlignment.center;

? ? ? ? letattributes = [NSAttributedStringKey.font : font,NSAttributedStringKey.foregroundColor:iconColor,NSAttributedStringKey.backgroundColor:backgroundColor,NSAttributedStringKey.paragraphStyle:style]as[NSAttributedStringKey:Any]

? ? ? ? //// Content Edge Insets

? ? ? ? varsize:CGSize! = (textContent!as!NSString).size(withAttributes: attributes)

? ? ? ? size = CGSize(width: size.width *1.0, height: size.height *1.05)


? ? ? ? lettextRect:CGRect! = CGRect(x:0, y:0, width: size.width, height: size.height)

? ? ? ? letorign = CGPoint(x: size.width *0.05, y: size.height *0.025)



? ? ? ? UIGraphicsBeginImageContextWithOptions(size,false,0.0);


? ? ? ? //// Rectangle Drawing

? ? ? ? letpath:UIBezierPath! = UIBezierPath.init(rect: textRect)


? ? ? ? backgroundColor.setFill()

? ? ? ? path.fill()

? ? ? ? (textContent!asNSString).draw(at: orign, withAttributes: attributes)

? ? ? ? // Text Drawing

? ? ? ? //Image returns

? ? ? ? letimage = UIGraphicsGetImageFromCurrentImageContext();

? ? ? ? UIGraphicsEndImageContext();

? ? ? ? returnimage!

? ? }

? ? staticfuncimage(identifier:String,backgroundColor:UIColor,iconColor:UIColor,iconSize:CGFloat,canvasSize:CGSize) ->UIImage{


? ? ? ? //// Abstracted Attributes

? ? ? ? vartextContent:String! = identifier;

? ? ? ? if(textContent.hasPrefix("fa-")) {

? ? ? ? ? ? textContent = NSString.fontAwesomeStringOfIdentifier(identifier: identifier)

? ? ? ? }

? ? ? ? letfont:UIFont! = UIFont.init(name:"FontAwesome", size: iconSize)

? ? ? ? letstyle:NSMutableParagraphStyle! = NSMutableParagraphStyle.default.mutableCopy()as!NSMutableParagraphStyle

? ? ? ? style.alignment = NSTextAlignment.center;

? ? ? ? letattributes = [NSAttributedStringKey.font : font,NSAttributedStringKey.foregroundColor:iconColor,NSAttributedStringKey.backgroundColor:backgroundColor,NSAttributedStringKey.paragraphStyle:style]as[NSAttributedStringKey:Any]

? ? ? ? //// Content Edge Insets

? ? ? ? varsize:CGSize! = (textContent!as!NSString).size(withAttributes: attributes)


? ? ? ? lettextRect:CGRect! = CGRect(x:0, y:0, width: canvasSize.width, height: canvasSize.height)

? ? ? ? letorign = CGPoint(x: (canvasSize.width - size.width) *0.5, y: (canvasSize.height - size.height) *0.5)

//? ? ? ? let orign = CGPoint(x: (canvasSize.width - size.width) * 0, y: (canvasSize.height - size.height) * 0)


? ? ? ? UIGraphicsBeginImageContextWithOptions(canvasSize,false,0.0);


? ? ? ? //// Rectangle Drawing

? ? ? ? letpath:UIBezierPath! = UIBezierPath.init(rect: textRect)


? ? ? ? backgroundColor.setFill()

? ? ? ? path.fill()

? ? ? ? (textContent!asNSString).draw(at: orign, withAttributes: attributes)

? ? ? ? // Text Drawing

? ? ? ? //Image returns

? ? ? ? letimage = UIGraphicsGetImageFromCurrentImageContext();

? ? ? ? UIGraphicsEndImageContext();

? ? ? ? returnimage!

? ? }

}

下載地址:https://itunes.apple.com/cn/app/圖標(biāo)設(shè)計(jì)工具/id1417167589?mt=8

二維碼下載:


?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容