MultiColorBlock library is used to recognize the priority of daily task with simple color code.
- Custom colors
- Custom view size
- Protocol Delegate support
Here's what it looks like:
MultiColorBlock is available through CocoaPods
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To integrate MultiColorBlock into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'MultiColorBlock'
end
Then, run the following command:
$ pod install
Alternatively to give it a test run, run the command:
$ pod try MultiColorBlock
- iOS 9.0+
- Xcode 9.0.0 +
To get started, this is a simple usage sample of using the integrated view controller.
import MultiColorBlock
@IBAction func colorBtnTapped(_ sender: UIButton) {
//Display color block view on tap button
let blockView = self.view.showColorBlockView(onTap: sender, with: 100)
blockView.delegate = self
//To set custom color
blockView.setCustomColor(to: .down, color: .green)
blockView.setCustomColor(to: .right, color: .blue)
blockView.setCustomColor(to: .up, color: .yellow)
blockView.setCustomColor(to: .left, color: .red)
}
Protocol Delegate methods:
func colorBlockDidSelect(color: UIColor) {
print("color: \(color)")
}
func colorBlockDidClose() {
print("close")
}
For more usage examples check the Example folder.
nfasate, nfasate@github.com
MultiColorBlock is available under the MIT license. See the LICENSE file for more info.