     }
     
     public func textFieldAtIndex(index: Int) -> UITextField? {
-        if isiOS8 {
+        if uiAlertControllerAvailable {
             if alertController.textFields?.count > index {
                 if let textField: UITextField = alertController.textFields![index] as? UITextField {
                     return textField

    :param: completion The completion block to be called when done presenting.
    */
    public func presentFrom(viewController: UIViewController!, animated: Bool, completion: (() -> Void)?) {
        if isiOS8 {
            alertController = UIAlertController(title: title, message: message, preferredStyle: alertControllerStyle)
            for action in actions.values {
                

        if let handler = action.handler {
            handler(action)
        }
	
		postAlertDismissalActions()
    }
	
	/**
	If the client code has opted to set releaseResourcesWhenAlertDismissed to false, then 
	this function should be called manually at an appropriate time to free up internal resources
	and allow this object to be deallocated.
	*/
	public func releaseResources()
	{
		// Removing observers releases any references to self held by the notification handler block, allowing self to be deallocated
		stopObservingAlertActionEnabledDidChangeNotification()
		
		// 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)
		alertController = nil
		
		resourcesHaveBeenReleased = true
	}
	
	private func postAlertDismissalActions()
	{
		if (releaseResourcesWhenAlertDismissed)
		{
			releaseResources()
		}
	}
	
	private func stopObservingAlertActionEnabledDidChangeNotification()
	{
		for actionObserver in actionObservers
		{
			NSNotificationCenter.defaultCenter().removeObserver(actionObserver)
		}
		self.actionObservers.removeAll(keepCapacity: false)
	}
}