To run the example project, clone the repo, and run pod install
from the Example directory first.
Minimum iOS 8, Swift 3
SSHoneyCombView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SSHoneyCombView'
Make sure to: use_frameworks!
1- add SSHoneyCombView.framework to “Linked Frameworks and Libraries” under Target->General, and build
storyboard: 2- drag and drop a UIView and change both “Class” and “Module” to SSHoneyCombView
3- resize your SSHoneyCombView and add constraints to use Autoresizing
4- create an outlet in your ViewController (Ex. ssHoneyCombView)
in ViewController:
5-
import SSHoneyCombView
6- create and array of SSHoneyCombObject
var honeycombObjectsArray: [SSHoneyCombObject] = []
create and append SSHoneyCombObject to honeycombObjectsArray Ex.
for i in 0...99 {
let honeycombObject = SSHoneyCombObject()
honeycombObject.name = "Honey Object \(i)"
self.honeycombObjectsArray.append(honeycombObject)
}
and assign this array to self.ssHoneyCombView.honeyCombObjects
self.ssHoneyCombView.honeyCombObjects = self.honeycombObjectsArray
7- optional you can set numberOfItemsInRow
self.honeyCombView.numberOfItemsInRow = 7
//NOTE: numberOfItemsInRow can’t be less than 2
8- conform to SSHoneyCombViewDelegate
9- set delegate
self.ssHoneyCombView.delegate = self
10-
func SSHoneyComb(_ SSHoneyComb: SSHoneyCombView, didSelect item: SSHoneyCombObject) {
print(item.name)
}
Finally you can add variables to HoneyCombObject class to fit your needs basic HoneyCombObject has “name” property only
for more details, please refer to Example Project
Sameh Salama
https://eg.linkedin.com/in/sameh-salama-98389174
SSHoneyCombView is available under the MIT license. See the LICENSE file for more info.