https://github.com/meyusufdemirci/sweetlike
A beautiful like button written in Swift.
https://github.com/meyusufdemirci/sweetlike
button heart instagram ios like sweet swift
Last synced: 5 months ago
JSON representation
A beautiful like button written in Swift.
- Host: GitHub
- URL: https://github.com/meyusufdemirci/sweetlike
- Owner: meyusufdemirci
- License: mit
- Created: 2019-07-29T17:51:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-16T09:00:49.000Z (almost 5 years ago)
- Last Synced: 2025-04-23T15:14:30.929Z (5 months ago)
- Topics: button, heart, instagram, ios, like, sweet, swift
- Language: Swift
- Homepage:
- Size: 138 KB
- Stars: 14
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SweetLike
[](https://travis-ci.com/demirciy/SweetLike)
[](https://cocoapods.org/pods/SweetLike)
[](https://cocoapods.org/pods/SweetLike)
[](https://cocoapods.org/pods/SweetLike)# Demo

## Requirements
- iOS 10.0+
- Xcode 11.0+
- Swift 5.0+## Installation
SweetLike is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'SweetLike'
```## Usage
Create,
on storyboard:
```ruby
@IBOutlet weak var sweetLikeButton: SweetLike!
```or programmatically:
```ruby
let sweetLikeButton = SweetLike()
```To get like and unlike actions,
with completion:
```ruby
sweetLikeButton.likeAction = {}
sweetLikeButton.unlikeAction = {}
```with delegate(SweetLikeDelegate):
```ruby
func likeAction() {}
func unlikeAction() {}
```There are a few properties you may change:
| Property | Description | Type | Default Value |
|:--------------------------------|:----------------------------------------------------------|:--------|:--------------------|
| IBInspectable likedImage | The image that shows when liked | UIImage | named: likedAsset |
| IBInspectable unlikedImage | The image that shows when unliked| UIImage| named: unlikedAsset |
| IBInspectable likedColor | The color of the default liked image | UIColor | UIColor(red: 201/255, green: 97/255, blue: 80/255, alpha: 1) |
| IBInspectable unlikedColor | The color of the default unliked image | UIColor | UIColor(red: 201/255, green: 97/255, blue: 80/255, alpha: 1) |
| likeActionAnimationDuration | The duration of like animation | Double | 0.6 |
| unlikeActionAnimationDuration | The duration of unlike animation | Double | 0.15 |
| isAnimationEnabled | The boolean that states the animating enabled or disabled | Bool | true |## Author
Yusuf Demirci, demirciy94@gmail.com
## License
SweetLike is available under the MIT license. See the LICENSE file for more info.