     }
     
     public func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
-        let cell: CollectionViewCell = collectionView.dequeueReusableCell(forIndexPath: indexPath)
+        let cell: Cell = collectionView.dequeueReusableCell(forIndexPath: indexPath)
         
         let position = positionForIndexPath(indexPath)
         
-        let title = delegate?.numPad(self, titleForButtonAtPosition: position)
-        cell.button.setTitle(title, forState: .Normal)
-        
-        let titleColor = delegate?.numPad(self, titleColorForButtonAtPosition: position)
-        cell.button.setTitleColor(titleColor, forState: .Normal)
-        cell.button.tintColor = titleColor
-        
-        let font = delegate?.numPad(self, fontForButtonAtPosition: position)
-        cell.button.titleLabel?.font = font
-        
-        let image = delegate?.numPad(self, imageForButtonAtPosition: position)
-        cell.button.setImage(image, forState: .Normal)
-        
-        let backgroundColor = delegate?.numPad(self, backgroundColorForButtonAtPosition: position)
-        let backgroundColorImage = backgroundColor?.toImage()
-        cell.button.setBackgroundImage(backgroundColorImage, forState: .Normal)
-        
-        let backgroundHighlightedColor = delegate?.numPad(self, backgroundHighlightedColorForButtonAtPosition: position)
-        let backgroundHighlightedColorImage = backgroundHighlightedColor?.toImage()
-        cell.button.setBackgroundImage(backgroundHighlightedColorImage, forState: .Highlighted)
-        cell.button.setBackgroundImage(backgroundHighlightedColorImage, forState: .Selected)
+        cell.button = dataSource?.numPad(self, buttonForPosition: position)
+        
+        cell.delegate = self
         
         return cell
     }
     
 }
 
-// MARK: - UICollectionViewDelegate
-extension NumPad: UICollectionViewDelegate {
+// MARK: - CellDelegate
+extension NumPad: CellDelegate {
+    
+    func cell(cell: Cell, buttonTapped button: UIButton) {
+        guard let indexPath = collectionView.indexPathForCell(cell) else { return }
+        let position = positionForIndexPath(indexPath)
+        delegate?.numPad(self, buttonTappedAtPosition: position)
+    }
     
 }
 

    }
}

extension UICollectionView {
    
    func register<T: UICollectionViewCell where T: ReusableView>(_: T.Type) {


import UIKit

// MARK: - Position
public struct Position {
    let row: Int
    let column: Int
}

// MARK: - NumPadDataSource
public protocol NumPadDataSource: class {
    func numberOfRowsInNumberPad(numPad: NumPad) -> Int
    func numPad(numPad: NumPad, numberOfColumnsInRow row: Int) -> Int
    func numPad(numPad: NumPad, buttonForPosition position: Position) -> UIButton
}

// MARK: - NumPadDelegate
public protocol NumPadDelegate: class {
    func numPad(numPad: NumPad, buttonTappedAtPosition position: Position)
}

extension NumPadDelegate {
    func numPad(numPad: NumPad, buttonTappedAtPosition position: Position) {}
}

// MARK: - NumPad
public class NumPad: UIView {

    let collectionView = UICollectionView()
    
    weak public var dataSource: NumPadDataSource?
    weak public var delegate: NumPadDelegate?
    
    required public init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
