Font Awesome Swift
1.0.0

フォローしてください:@vaberer
私は★が好きです。 ★この非常に便利なライブラリを忘れないでください。
UISegmentedControl & UITabbarItem & UISlider & UIStepper & UITextFieldサポートを追加しました!iOS用の素晴らしい迅速なライブラリ。もう画像アイコンはありません。 Font Awesome Swiftライブラリを使用するのは非常に使いやすいです。すべてのアイコンとその名前を表示するか、Fontawesomeにアクセスするデモアプリを見てください。

Cocoapodsは、Cocoaプロジェクトの依存マネージャーです。
Cocoapods 0.36は、Swiftおよび埋め込みフレームワークのサポートを追加します。次のコマンドでインストールできます。
$ gem install cocoapods cocoapodsを使用してFont Awesome SwiftをXcodeプロジェクトに統合するには、 Podfileで指定してください。
source 'https://github.com/CocoaPods/Specs.git'
platform :ios , '8.0'
use_frameworks!
pod 'Font-Awesome-Swift' , '~> 1.7.2'次に、次のコマンドを実行します。
$ pod installこのライブラリを使用したい場合は、迅速なファイルにインポートすることを忘れないでください。
import Font_Awesome_Swift Branches swift-2.2 、 swift-2.3 、またはswift-3を確認してください
FAIcon.swiftとFontAwesome.ttfファイルをプロジェクトにコピーしますFontAwesome.ttfインポートするには、「プロジェクト」>「ターゲット」>「コピーバンドルリソース」を確認する非常に簡単な方法アイコンを追加する方法。

積み重ねられた画像については、積み重ねられたアイコンを参照してください
UIImage . init ( icon : . FATwitter , size : CGSize ( width : 35 , height : 35 ) )
// Change colors
UIImage . init ( icon : . FATwitter , size : CGSize ( width : 35 , height : 35 ) , textColor : . red , backgroundColor : . black )
// Stacked Images With Bigger Background
UIImage . init ( bgIcon : . FASquareO , bgTextColor : . white , topIcon : . FATwitter , topTextColor : . white , bgLarge : true )
UIImage . init ( bgIcon : . FACircle , bgTextColor : . black , topIcon : . FAFlag , topTextColor : . white , bgLarge : true )
// Stacked Images With Smaller Background
UIImage . init ( bgIcon : . FACamera , bgTextColor : . black , topIcon : . FABan , topTextColor : . red , bgLarge : false )
// Stacked Images With Bigger Background and Custom Size
UIImage . init ( bgIcon : . FASquare , bgTextColor : . black , topIcon : . FATerminal , topTextColor : . white , bgLarge : true , size : CGSize ( width : 50 , height : 50 ) ) imageView . setFAIconWithName ( icon : . FATwitter , textColor : . blue , backgroundColor : . gray )
imageView . setFAIconWithName ( icon : . FATwitter , textColor : . blue )
labelName . FAIcon = . FAGithub
labelName . setFAIcon ( icon : . FAGithub , iconSize : 35 )
labelName . setFAText ( prefixText : " follow me on " , icon : . FATwitter , postfixText : " . Thanks! " , size : 25 )
// Bigger icon:
labelName . setFAText ( prefixText : " follow me on " , icon : . FATwitter , postfixText : " . Thanks! " , size : 25 , iconSize : 30 )
labelName . setFAColor ( . red )
buttonName . setFAIcon ( icon : . FAGithub , forState : . normal )
// Set icon size
buttonName . setFAIcon ( icon : . FAGithub , iconSize : 35 , forState : . normal )
buttonName . setFAText ( prefixText : " follow me on " , icon : . FATwitter , postfixText : " . Thanks! " , size : 25 , forState : . normal )
// Bigger icon
buttonName . setFAText ( prefixText : " follow me on " , icon : . FATwitter , postfixText : " . Thanks! " , size : 25 , forState : . normal , iconSize : 30 )
// Change color:
buttonName . setFATitleColor ( color : . red , forState : . normal ) )
// Standard font size
barName . FAIcon = . FAGithub
// Custom font size
barName . setFAIcon ( icon : . FAGithub , iconSize : 35 )
barName . setFAText ( prefixText : " follow me on " , icon : . FATwitter , postfixText : " . Thanks! " , size : 25 )
barName . tintColor = . red // Right View Icon
textfield . setRightViewFAIcon ( icon : . FASearch , rightViewMode : . always , textColor : . red , backgroundColor : . clear , size : nil )
// Left View Icon
textfield . setLeftViewFAIcon ( icon : . FAPlus , leftViewMode : . always , textColor : . red , backgroundColor : . clear , size : nil ) segmentedControl . setFAIcon ( icon : . FATwitter , forSegmentAtIndex : 0 )
stepper . setFABackgroundImage ( icon : . FAGithub , forState : . normal )
stepper . setFAIncrementImage ( icon : . FABellO , forState : . normal )
stepper . setFADecrementImage ( icon : . FABellSlashO , forState : . normal )
tabBarController ? . tabBar . items ? . first ? . setFAIcon ( . FATwitter )
// Options to change selected and unselected color
tabBarItem . setFAIcon ( icon : . FATwitter , size : nil , textColor : . red , backgroundColor : . black , selectedTextColor : . yellow , selectedBackgroundColor : . white )
// Options to change selected and unselected color with specific size
tabBarItem . setFAIcon ( icon : . FATwitter , size : CGSize ( width : 35 , height : 35 ) , textColor : . red , backgroundColor : . black , selectedTextColor : . yellow , selectedBackgroundColor : . white )
// Change minimum or maximum value image
slider . setFAMinimumValueImage ( icon : . FABellSlashO )
slider . setFAMaximumValueImage ( icon : . FABellO )
// change minimum or maximum value image with a specific size
slider . setFAMinimumValueImage ( icon : . FABellSlashO , customSize : CGSize ( width : 35 , height : 35 ) )
slider . setFAMaximumValueImage ( icon : . FABellO , customSize : CGSize ( width : 35 , height : 35 ) )
// Change navigation title
FATitle = . FATwitter
Patrik Vaberer、[email protected]
Font Awesome Swiftは、MITライセンスの下で入手できます。詳細については、ライセンスファイルを参照してください。