//
//  PieSliceModel.swift
//  PieCharts
//
//  Created by Ivan Schuetz on 30/12/2016.
//  Copyright © 2016 Ivan Schuetz. All rights reserved.
//

import UIKit

public class PieSliceModel: CustomDebugStringConvertible {
    
    public let value: Double
    public let color: UIColor
    public let obj: Any? /// optional object to pass around e.g. to the layer's text generators

    public init(value: Double, color: UIColor, obj: Any? = nil) {
        self.value = value
        self.color = color
        self.obj = obj
    }
    
    public var debugDescription: String {
        return "{value: \(value), obj: \(String(describing: obj))}"
    }
}

//
//  PieSliceModel.swift
//  PieCharts
//
//  Created by Ivan Schuetz on 30/12/2016.
//  Copyright © 2016 Ivan Schuetz. All rights reserved.
//

import UIKit

public class PieSliceModel: CustomDebugStringConvertible {
    
    public let value: Double
    public let color: UIColor
    
    public init(value: Double, color: UIColor) {
        self.value = value
        self.color = color
    }
    
    public var debugDescription: String {
        return "{value: \(value)}"
    }
}

--- 
+++ 
@@ -12,13 +12,15 @@
     
     public let value: Double
     public let color: UIColor
-    
-    public init(value: Double, color: UIColor) {
+    public let obj: Any? /// optional object to pass around e.g. to the layer's text generators
+
+    public init(value: Double, color: UIColor, obj: Any? = nil) {
         self.value = value
         self.color = color
+        self.obj = obj
     }
     
     public var debugDescription: String {
-        return "{value: \(value)}"
+        return "{value: \(value), obj: \(String(describing: obj))}"
     }
 }
Allow to pass objects around with slice model
