mirror of
				https://github.com/SoPat712/YTLitePlus.git
				synced 2025-10-30 20:34:04 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			86 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			Objective-C
		
	
	
	
	
	
			
		
		
	
	
			86 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			Objective-C
		
	
	
	
	
	
| //
 | |
| //  FLEXAlert.h
 | |
| //  FLEX
 | |
| //
 | |
| //  Created by Tanner Bennett on 8/20/19.
 | |
| //  Copyright © 2020 FLEX Team. All rights reserved.
 | |
| //
 | |
| 
 | |
| #import <UIKit/UIKit.h>
 | |
| 
 | |
| NS_ASSUME_NONNULL_BEGIN
 | |
| 
 | |
| @class FLEXAlert, FLEXAlertAction;
 | |
| 
 | |
| typedef void (^FLEXAlertReveal)(void);
 | |
| typedef void (^FLEXAlertBuilder)(FLEXAlert *make);
 | |
| typedef FLEXAlert * _Nonnull (^FLEXAlertStringProperty)(NSString * _Nullable);
 | |
| typedef FLEXAlert * _Nonnull (^FLEXAlertStringArg)(NSString * _Nullable);
 | |
| typedef FLEXAlert * _Nonnull (^FLEXAlertTextField)(void(^configurationHandler)(UITextField *textField));
 | |
| typedef FLEXAlertAction * _Nonnull (^FLEXAlertAddAction)(NSString *title);
 | |
| typedef FLEXAlertAction * _Nonnull (^FLEXAlertActionStringProperty)(NSString * _Nullable);
 | |
| typedef FLEXAlertAction * _Nonnull (^FLEXAlertActionProperty)(void);
 | |
| typedef FLEXAlertAction * _Nonnull (^FLEXAlertActionBOOLProperty)(BOOL);
 | |
| typedef FLEXAlertAction * _Nonnull (^FLEXAlertActionHandler)(void(^handler)(NSArray<NSString *> *strings));
 | |
| 
 | |
| @interface FLEXAlert : NSObject
 | |
| 
 | |
| /// Shows a simple alert with one button which says "Dismiss"
 | |
| + (void)showAlert:(NSString * _Nullable)title message:(NSString * _Nullable)message from:(UIViewController *)viewController;
 | |
| 
 | |
| /// Construct and display an alert
 | |
| + (void)makeAlert:(FLEXAlertBuilder)block showFrom:(UIViewController *)viewController;
 | |
| /// Construct and display an action sheet-style alert
 | |
| + (void)makeSheet:(FLEXAlertBuilder)block
 | |
|          showFrom:(UIViewController *)viewController
 | |
|            source:(id)viewOrBarItem;
 | |
| 
 | |
| /// Construct an alert
 | |
| + (UIAlertController *)makeAlert:(FLEXAlertBuilder)block;
 | |
| /// Construct an action sheet-style alert
 | |
| + (UIAlertController *)makeSheet:(FLEXAlertBuilder)block;
 | |
| 
 | |
| /// Set the alert's title.
 | |
| ///
 | |
| /// Call in succession to append strings to the title.
 | |
| @property (nonatomic, readonly) FLEXAlertStringProperty title;
 | |
| /// Set the alert's message.
 | |
| ///
 | |
| /// Call in succession to append strings to the message.
 | |
| @property (nonatomic, readonly) FLEXAlertStringProperty message;
 | |
| /// Add a button with a given title with the default style and no action.
 | |
| @property (nonatomic, readonly) FLEXAlertAddAction button;
 | |
| /// Add a text field with the given (optional) placeholder text.
 | |
| @property (nonatomic, readonly) FLEXAlertStringArg textField;
 | |
| /// Add and configure the given text field.
 | |
| ///
 | |
| /// Use this if you need to more than set the placeholder, such as
 | |
| /// supply a delegate, make it secure entry, or change other attributes.
 | |
| @property (nonatomic, readonly) FLEXAlertTextField configuredTextField;
 | |
| 
 | |
| @end
 | |
| 
 | |
| @interface FLEXAlertAction : NSObject
 | |
| 
 | |
| /// Set the action's title.
 | |
| ///
 | |
| /// Call in succession to append strings to the title.
 | |
| @property (nonatomic, readonly) FLEXAlertActionStringProperty title;
 | |
| /// Make the action destructive. It appears with red text.
 | |
| @property (nonatomic, readonly) FLEXAlertActionProperty destructiveStyle;
 | |
| /// Make the action cancel-style. It appears with a bolder font.
 | |
| @property (nonatomic, readonly) FLEXAlertActionProperty cancelStyle;
 | |
| /// Enable or disable the action. Enabled by default.
 | |
| @property (nonatomic, readonly) FLEXAlertActionBOOLProperty enabled;
 | |
| /// Give the button an action. The action takes an array of text field strings.
 | |
| @property (nonatomic, readonly) FLEXAlertActionHandler handler;
 | |
| /// Access the underlying UIAlertAction, should you need to change it while
 | |
| /// the encompassing alert is being displayed. For example, you may want to
 | |
| /// enable or disable a button based on the input of some text fields in the alert.
 | |
| /// Do not call this more than once per instance.
 | |
| @property (nonatomic, readonly) UIAlertAction *action;
 | |
| 
 | |
| @end
 | |
| 
 | |
| NS_ASSUME_NONNULL_END
 | 
