         }
     }
     
+    private var inside_constraints: [NSLayoutConstraint] = []
+    private var outside_constraints: [NSLayoutConstraint] = []
+    
     public override init(frame: CGRect) {
         contentView = UIView()
         super.init(frame: frame)
         
+        self.addSubview(contentView)
         self.addSubview(pageControl)
-        self.addSubview(contentView)
         
         pageControl.translatesAutoresizingMaskIntoConstraints = false
         contentView.translatesAutoresizingMaskIntoConstraints = false
         
-        NSLayoutConstraint.activateConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[content][page]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["content": contentView, "page": pageControl]))
+        if pageControlInside {
+            inside_constraints = NSLayoutConstraint.constraintsWithVisualFormat("V:|[content]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["content": contentView])
+            inside_constraints.append(NSLayoutConstraint(item: pageControl, attribute: .Bottom, relatedBy: .Equal, toItem: contentView, attribute: .Bottom, multiplier: 1, constant: 0))
+            NSLayoutConstraint.activateConstraints(inside_constraints)
+        } else {
+            outside_constraints = NSLayoutConstraint.constraintsWithVisualFormat("V:|[content][page]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["content": contentView, "page": pageControl])
+            NSLayoutConstraint.activateConstraints(outside_constraints)
+        }
         NSLayoutConstraint.activateConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[content]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["content": contentView]))
         NSLayoutConstraint.activateConstraints([NSLayoutConstraint(item: pageControl, attribute: .CenterX, relatedBy: .Equal, toItem: self, attribute: .CenterX, multiplier: 1, constant: 0)])
         

    public weak var delegate: SDItemSelectorDelegate?
    
    private var _cache: [UIView?] = []
    
    @IBInspectable public var pageIndicatorTintColor: UIColor? {
        get {

        pageControl.translatesAutoresizingMaskIntoConstraints = false
        contentView.translatesAutoresizingMaskIntoConstraints = false
        
        if pageControlInside {
            inside_constraints = NSLayoutConstraint.constraintsWithVisualFormat("V:|[content]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["content": contentView])
            inside_constraints.append(NSLayoutConstraint(item: pageControl, attribute: .Bottom, relatedBy: .Equal, toItem: contentView, attribute: .Bottom, multiplier: 1, constant: 0))
            NSLayoutConstraint.activateConstraints(inside_constraints)
        } else {
            outside_constraints = NSLayoutConstraint.constraintsWithVisualFormat("V:|[content][page]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["content": contentView, "page": pageControl])
            NSLayoutConstraint.activateConstraints(outside_constraints)
        }
        NSLayoutConstraint.activateConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[content]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["content": contentView]))
        NSLayoutConstraint.activateConstraints([NSLayoutConstraint(item: pageControl, attribute: .CenterX, relatedBy: .Equal, toItem: self, attribute: .CenterX, multiplier: 1, constant: 0)])
        
