     case Alert
 }
 
+private class BPAlertView : UIAlertView {
+    // Keep a strong reference to the delegate to ensure the BPCompatibleAlertController doesn't get destroyed by ARC on iOS 7
+    // Once the alert button has been clicked and BPCompatibleAlertController is finished with this alert view, BPCompatibleAlertController
+    //  can clear the delegateReference and ARC can clean up
+    var delegateReference: BPCompatibleAlertController?
+    
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+    }
+
+    required init(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+    
+    init(title: String?, message: String?, delegate: BPCompatibleAlertController, cancelButtonTitle: String?) {
+        delegateReference = delegate
+        super.init(title: title, message: message, delegate: delegate, cancelButtonTitle: cancelButtonTitle)
+    }
+}
+
 @objc(BPCompatibleAlertController)
 public class BPCompatibleAlertController : NSObject, UIAlertViewDelegate {
     let title: String?

        // Clean up any other objects that may be containining references to self and prevent self from being deallocated
        actions.removeAll(keepCapacity: false)
        textFieldConfigurations.removeAll(keepCapacity: false)
        //alertView.delegate = nil
        alertController = nil
        
        resourcesHaveBeenReleased = true
    }
    

                index++
            }
            
            alertView = BPAlertView(title: title, message: message, delegate: self, cancelButtonTitle: cancelAction?.title)
            
            sanityCheckTextFields()
            
