Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions MaterialDesignSymbol.podspec

This file was deleted.

89 changes: 48 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,79 @@
#### MaterialDesignSymbol
# MaterialDesignSymbol

Icon font library for Swift. Currently supports GoogleMaterialDesignIcons. ObjectiveC version is [here](https://github.com/tichise/MaterialDesignSymbolObjC).
Icon font library for Swift. Currently supports Google Material Design Icons.

#### Image
## Requirements

![image](https://user-images.githubusercontent.com/43707/89850548-8edb5300-dbc5-11ea-8cab-2b3be7faf06f.png)
- iOS 16.0+
- watchOS 9.0+
- Swift 5.0+

#### Licence
font used in this project
## Installation

Author of the font used in this project: Google
Link: https://github.com/google/material-design-icons
### Swift Package Manager

Creative Commons Attribution 4.0 International (CC BY 4.0)
Add via Xcode: File > Add Package Dependencies...

#### Examples Swift
```
https://github.com/tichise/MaterialDesignSymbol.git
```

##### UIKit / UIImage
## Usage

```html
### UIImage

```swift
import MaterialDesignSymbol

let symbol = MaterialDesignSymbol(text:MaterialDesignIcon.list48px, size:25)
symbol.addAttribute(attributeName: NSAttributedStringKey.foregroundColor, value: UIColor.red)
let iconImage = symbol.image(size: CGSize(width:25, height:25))
let symbol = MaterialDesignSymbol(icon: .home48px, size: 30)
let iconImage = symbol.image()
```

or
With color:

```swift
let symbol = MaterialDesignSymbol(icon: .home48px, size: 30)
symbol.addAttribute(foregroundColor: .red)
let iconImage = symbol.image()
```
import MaterialDesignSymbol

let iconImage = MaterialDesignSymbol(icon: .viewHeadline48px, size: 30).image()
With custom size:

```swift
let symbol = MaterialDesignSymbol(icon: .home48px, size: 25)
let iconImage = symbol.image(size: CGSize(width: 50, height: 50))
```

##### UIKit / UILabel
### UILabel

```html
```swift
import MaterialDesignSymbol

titleLabel.font = MaterialDesignFont.fontOfSize(20)
titleLabel.text = MaterialDesignIcon.list48px
titleLabel.font = MaterialDesignFont.shared.fontOfSize(20)
titleLabel.text = MaterialDesignIconEnum.home48px.rawValue
```

#### Examples ObjectiveC

Support for Objective C has ended with version 2.3.2.
If you want to call from Objective C, please use ver 2.3.2 or earlier.
### SwiftUI

##### Image
```html
@import MaterialDesignSymbol;
```swift
import SwiftUI
import MaterialDesignSymbol


MaterialDesignSymbol *symbol = [[MaterialDesignSymbol alloc] initWithText:[MaterialDesignIcon home48px] size:30];
[symbol addAttributeWithAttributeName:NSForegroundColorAttributeName value:[UIColor blackColor]];
sampleImageView.image = [symbol imageWithSize:CGSizeMake(30, 30)];
struct ContentView: View {
var body: some View {
Image(uiImage: MaterialDesignSymbol(icon: .home48px, size: 30).image())
}
}
```

##### Text
## License

```html
@import MaterialDesignSymbol;
### Font License

sampleLabel.font = [MaterialDesignFont fontOfSize:20];
sampleLabel.text = [MaterialDesignIcon clear48px];
```
Author: Google
Link: https://github.com/google/material-design-icons
License: Apache License 2.0

### Library License

#### Installation (CocoaPods)
`pod MaterialDesignSymbol`
MIT License
Loading