 
         self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|-(>=margin)-[actionGroupView]-margin-[cancelGroupView]-margin-|",
             options: .DirectionLeadingToTrailing,
-            metrics: ["margin": self.margin],
+            metrics: ["margin": self.verticalMargin],
             views: ["actionGroupView": self.actionGroupView, "cancelGroupView": self.cancelGroupView]) 
         )
     }

@IBDesignable
public class AFMActionSheetController: UIViewController {

    @IBInspectable public var controlHeight: Int   = 50 {
        didSet { self.updateUI() }
    }
    @IBInspectable public var spacing: Int         = 4  {
        didSet { self.updateUI() }
    }
    @IBInspectable public var margin: Int          = 16 {
        didSet { self.updateUI() }
    }
    @IBInspectable public var cornerRadius: Int    = 10 {
        didSet { self.updateUI() }
    }


            groupView.translatesAutoresizingMaskIntoConstraints = false
            self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-margin-[groupView]-margin-|",
                options: .DirectionLeadingToTrailing,
                metrics: ["margin": self.horizontalMargin],
                views: ["groupView": groupView]) 
            )
        }
