/README.md

https://github.com/mohsinalimat/TextGradation · Markdown · 106 lines · 69 code · 37 blank · 0 comment · 0 complexity · 4c5a67aa51b7208518bb73173d72dbcc MD5 · raw file

  1. # TextGradation
  2. [![Version](https://img.shields.io/cocoapods/v/TextGradation.svg?style=flat)](http://cocoapods.org/pods/Tags)
  3. [![License](https://img.shields.io/cocoapods/l/TextGradation.svg?style=flat)](http://cocoapods.org/pods/Tags)
  4. [![Platform](https://img.shields.io/cocoapods/p/TextGradation.svg?style=flat)](http://cocoapods.org/pods/Tags)
  5. [![Swift 4.2](https://img.shields.io/badge/Swift-4.2-orange.svg?style=flat)](https://developer.apple.com/swift/)
  6. ## Introduce
  7. You can add a gradient to the text of a UILabel or UIButton.
  8. <img src='./Image/1.gif' width='200px'>
  9. ## Requirements
  10. `TextGradation` written in Swift 4.2. Compatible with iOS 8.0+
  11. ## Installation
  12. TextGradation is available through [CocoaPods](https://cocoapods.org). To install
  13. it, simply add the following line to your Podfile:
  14. ```ruby
  15. pod 'TextGradation'
  16. ```
  17. ### Xib or Storyboard file
  18. GradationLabel
  19. ![image](./Image/3.png)
  20. ![image](./Image/4.png)
  21. GradationButton
  22. ![image](./Image/5.png)
  23. ![image](./Image/6.png)
  24. <br><br><br>
  25. ### Code Editor
  26. ```swift
  27. import TextGradation
  28. ```
  29. ```swift
  30. gradationLabel.gradation(
  31. .horizontal,
  32. colors: [UIColor.gray, UIColor.red, UIColor.blue, UIColor.black]
  33. )
  34. gradationButton.gradation(
  35. .horizontal,
  36. colors: [UIColor.gray, UIColor.red, UIColor.blue, UIColor.black]
  37. )
  38. ```
  39. progress
  40. ```swift
  41. gradationProgressHorizontalLabel.gradation(
  42. .horizontal,
  43. startColor: UIColor(red: 106/255, green: 183/255, blue: 216/255, alpha: 1),
  44. endColor: .black,
  45. progress: CGFloat(sender.value)
  46. )
  47. gradationProgressVerticalLabel.gradation(
  48. .vertical,
  49. startColor: UIColor(red: 106/255, green: 183/255, blue: 216/255, alpha: 1),
  50. endColor: .black,
  51. progress: CGFloat(sender.value)
  52. )
  53. gradationProgressHorizontalButton.gradation(
  54. .horizontal,
  55. startColor: UIColor(red: 106/255, green: 183/255, blue: 216/255, alpha: 1),
  56. endColor: .black,
  57. progress: CGFloat(sender.value)
  58. )
  59. gradationProgressVerticalButton.gradation(
  60. .vertical,
  61. startColor: UIColor(red: 106/255, green: 183/255, blue: 216/255, alpha: 1),
  62. endColor: .black,
  63. progress: CGFloat(sender.value)
  64. )
  65. ```
  66. ## Author
  67. pikachu987, pikachu77769@gmail.com
  68. ## License
  69. TextGradation is available under the MIT license. See the LICENSE file for more info.