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
二維碼下載:
