Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huybuidac/SwiftUIFontIcon
The easiest way to implement font icons in your SwiftUI project.
https://github.com/huybuidac/SwiftUIFontIcon
font fontawesome fonticons ionicons material-icons swiftui
Last synced: about 1 month ago
JSON representation
The easiest way to implement font icons in your SwiftUI project.
- Host: GitHub
- URL: https://github.com/huybuidac/SwiftUIFontIcon
- Owner: huybuidac
- License: mit
- Created: 2020-08-25T17:53:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-04T02:39:40.000Z (over 4 years ago)
- Last Synced: 2024-10-02T07:32:30.967Z (2 months ago)
- Topics: font, fontawesome, fonticons, ionicons, material-icons, swiftui
- Language: Swift
- Homepage: https://github.com/huybuidac/SwiftUIFontIcon
- Size: 550 KB
- Stars: 126
- Watchers: 4
- Forks: 10
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-swiftui - huybuidac/SwiftUIFontIcon - Font icon for SwiftUI (Material icon, Ionicons, Font Awesome 5 Free) (Samples)
- fucking-awesome-swift - SwiftUI-FontIcon - Font icons for SwiftUI: font awesome, ionicons, material icons. (Libs / Fonts)
- awesome-swift - SwiftUI-FontIcon - The easiest way to implement font icons in your SwiftUI project. ` 📝 10 months ago ` (Fonts [🔝](#readme))
- awesome-swift - SwiftUI-FontIcon - Font icons for SwiftUI: font awesome, ionicons, material icons. (Libs / Fonts)
- awesome-swiftui - FontIcon: Bring Material, Font Awesome 5, Ionicons font icons into SwiftUI
README
## SwiftUIFontIcon
The easiest way to implement font icons in your SwiftUI project.
## Usage
The library is super super easy to use, just something like this :)
### Text
```swift
import SwiftUIFontIcon// ...
FontIcon.text(.materialIcon(code: .access_alarm))
FontIcon.text(.materialIcon(code: .access_alarm), fontsize: 30)
```![Test Image 3](/resources/demo_code.png)
### Button
```swift
FontIcon.button(.ionicon(code: .md_add_circle), action: {})
FontIcon.button(.materialIcon(code: .settings), action: {}, padding: 8)
.background(RoundedRectangle(cornerRadius: 4).foregroundColor(.blue))
```## Installation
### Cocoapods (Xcode 11 & Xcode 12)
[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects.
You can install it with the following command:
```bash
$ gem install cocoapods
```To integrate SwiftUIFontIcon into your Xcode project using CocoaPods, specify it in your `Podfile`:
```ruby
use_frameworks!pod 'SwiftUIFontIcon'
```### SPM (Xcode 12 only)
The preferred way of installing SwiftUIFontIcon is via the [Swift Package Manager](https://swift.org/package-manager/).
>Xcode 12 integrates with libSwiftPM to provide support for iOS, watchOS, and tvOS platforms.
1. In Xcode, open your project and navigate to **File** → **Swift Packages** → **Add Package Dependency...**
2. Paste the repository URL (`https://github.com/huybuidac/SwiftUIFontIcon`) and click **Next**.
3. For **Rules**, select **Branch** (with branch set to `master`).
4. Click **Finish**.
5. Open the Project settings, add **SwiftUI.framework** to the **Linked Frameworks and Libraries**, set **Status** to **Optional**.## Sample
To run the example project of SPM, using **xcode 12 beta**
To run the example project of Cocoapods, using **xcode 11 || 12 beta**
## Supported fonts
Currently, SwiftUIFontIcon supports:
- Material icon
- Ionicons
- Font Awesome 5 Free