[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6952":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},6952,"DOFavoriteButton","okmr-d\u002FDOFavoriteButton","okmr-d","Cute Animated Button written in Swift.","",null,"Swift",3585,290,56,22,0,59.39,"MIT License",false,"master",true,[],"2026-06-12 04:00:31","# DOFavoriteButton\n[![Carthage compatible](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCarthage-compatible-4BC51D.svg?style=flat)](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage)\n[![Version](https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fv\u002FDOFavoriteButton.svg?style=flat)](http:\u002F\u002Fcocoapods.org\u002Fpods\u002FDOFavoriteButton)\n[![Platform](https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fp\u002FDOFavoriteButton.svg?style=flat)](http:\u002F\u002Fcocoapods.org\u002Fpods\u002FDOFavoriteButton)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fl\u002FDOFavoriteButton.svg?style=flat)](https:\u002F\u002Fgithub.com\u002Fokmr-d\u002FDOFavoriteButton\u002Fblob\u002Fmaster\u002FLICENSE)\n\nCute Animated Button written in Swift.\nIt could be just right for favorite buttons!\n![Demo](https:\u002F\u002Fraw.githubusercontent.com\u002Fokmr-d\u002Fokmr-d.github.io\u002Fmaster\u002Fimg\u002FDOFavoriteButton\u002Fdemo.gif)\n\n## Requirements\n* iOS 7.0+\n* Swift 1.2\n\n## Installation\n#### Carthage\nAdd the following line to your `Cartfile`:\n```\ngithub \"okmr-d\u002FDOFavoriteButton\"\n```\n\n#### CocoaPods\nAdd the following line to your `Podfile`:\n```\npod 'DOFavoriteButton'\n```\n\n#### Manual\nJust drag DOFavoriteButton.swift to your project.\n\n## How to use\n#### 1. Add a flat icon image\n![Flat Icon Image](https:\u002F\u002Fraw.githubusercontent.com\u002Fokmr-d\u002Fokmr-d.github.io\u002Fmaster\u002Fimg\u002FDOFavoriteButton\u002FflatIconImage.png)\n\n#### 2. Create a button\n##### ・By coding\n```swift\nlet button = DOFavoriteButton(frame: CGRectMake(0, 0, 44, 44), image: UIImage(named: \"star.png\"))\nself.view.addSubview(button)\n```\n\n##### ・By using Storyboard or XIB\n1. Add Button object and set Custom Class `DOFavoriteButton`  \n![via Storyboard](https:\u002F\u002Fraw.githubusercontent.com\u002Fokmr-d\u002Fokmr-d.github.io\u002Fmaster\u002Fimg\u002FDOFavoriteButton\u002Fstoryboard.png)\n\n2. Connect Outlet  \n![connect outlet](https:\u002F\u002Fraw.githubusercontent.com\u002Fokmr-d\u002Fokmr-d.github.io\u002Fmaster\u002Fimg\u002FDOFavoriteButton\u002Fconnect.png)\n\n#### 3. Add tapped function\n```swift\nbutton.addTarget(self, action: Selector(\"tapped:\"), forControlEvents: .TouchUpInside)\n```\n```swift\nfunc tapped(sender: DOFavoriteButton) {\n    if sender.selected {\n        \u002F\u002F deselect\n        sender.deselect()\n    } else {\n        \u002F\u002F select with animation\n        sender.select()\n    }\n}\n```\n\n## Customize\nYou can change button color & animation duration:\n```swift\nbutton.imageColorOff = UIColor.brownColor()\nbutton.imageColorOn = UIColor.redColor()\nbutton.circleColor = UIColor.greenColor()\nbutton.lineColor = UIColor.blueColor()\nbutton.duration = 3.0 \u002F\u002F default: 1.0\n```\nResult:  \n![Customize](https:\u002F\u002Fraw.githubusercontent.com\u002Fokmr-d\u002Fokmr-d.github.io\u002Fmaster\u002Fimg\u002FDOFavoriteButton\u002FchangeColor.gif)\n\n## DEMO\nThere is a demo project added to this repository, so you can see how it works.\n\n## Credit\u002FInspiration\nDOFavoriteButton was inspired by [Twitter's iOS App](https:\u002F\u002Fitunes.apple.com\u002Fus\u002Fapp\u002Ftwitter\u002Fid333903271).\n\n## License\nThis software is released under the MIT License.\n","DOFavoriteButton 是一个用 Swift 编写的可爱动画按钮库。其核心功能包括支持自定义图标、颜色以及动画时长，适用于 iOS 7.0 及以上版本，并且兼容 Swift 1.2。该按钮特别适合用于收藏或点赞等场景，提供流畅的选中与取消选带动画效果。通过 Carthage 或 CocoaPods 可以方便地集成到项目中，也支持手动拖拽文件的方式。此外，它还提供了详细的使用指南和示例项目，便于开发者快速上手并根据需求进行定制。",2,"2026-06-11 03:09:50","top_language"]