FTIndicator
这是一个轻量级 UI 包,包含本地通知、进度 HUD、Toast,包含模糊效果
、优雅的 API
和主题支持
,受 Apple 的进程 HUD、通知和 Android 的 Toast 启发。
3 IN 1
- 如果您想使用所有三个指示器,请使用
FTIndicator
。 - 此外,
FTNotificationIndicator
、FTProgressIndicator
和FTToastIndicator
都可以单独使用。根据需要使用它们。
FTIndicator
FTNotificationIndicator
FTProgressIndicator
FTToastIndicator
屏幕截图
纵向
样式 | 浅色 | 深色 |
---|---|---|
通知 | ![]() |
![]() |
进度 | ![]() |
![]() |
Toast | ![]() |
![]() |
风景模式
样式 | 浅色 | 深色 |
---|---|---|
通知 | ![]() |
![]() |
进度 | ![]() |
![]() |
Toast | ![]() |
![]() |
安装
手动
- 克隆此存储库。
- 只需将 '/FTIndicator' 文件夹拖入你的项目中。
- 导入 'FTIndicator.h'
CocoaPods
FTIndicator
可通过CocoaPods获取。要安装它,只需将以下行添加到你的Podfile中
1.2.2版本错误修复:语法错误已修复。可能会对您的项目造成错误,请谨慎更新。
1.2.0版本主要修复:应用启动时进度HUD不显示
FTNotificationIndicator
,FTProgressIndicator
和FTToastIndicator
在v1.1.5后不再更新Podfile。如果您想单独使用它们,请在Podfile中像下面这样使用它们作为一个子Pod
pod 'FTIndicator/FTNotificationIndicator'
pod 'FTIndicator/FTProgressIndicator'
pod 'FTIndicator/FTToastIndicator'
使用FTIndicator,三者全用
- FTIndicator,一者三用
pod 'FTIndicator'
单独使用
- FTNotificationIndicator
pod 'FTNotificationIndicator'已不可用,请使用此方法
# use as a subPod
pod 'FTIndicator/FTNotificationIndicator'
- FTProgressIndicator
已不再提供 pod "FTProgressIndicator",请使用以下内容
# use as a subPod
pod 'FTIndicator/FTProgressIndicator'
- FTToastIndicator
已不再提供 pod 'FTToastIndicator',请使用以下内容
# use as a subPod
pod 'FTIndicator/FTToastIndicator'
用法
FTIndicator
使用 通知
- 不显示图片
[FTIndicator showNotificationWithTitle:@"Here is a notification title."
message:@"Here is a notification message."];
- 显示图片
[FTIndicator showNotificationWithImage:[UIImage imageNamed:@"maps_icon"]
title:@"Here is a notification title."
message:@"Here is a notification message."];
- 显示图片,有点击处理和完成处理
[FTIndicator showNotificationWithImage:[UIImage imageNamed:@"maps_icon"]
title:@"Here is a notification title."
message:@"Here is a notification message. Try to tap and see tap handling or do nothing to see completion"
tapHandler:^{
// handle user tap
} completion:^{
// handle completion
}];
- 手动消失
[FTIndicator dismissNotification];
进度
- 显示进度
[FTIndicator showProgressWithMessage:@"Here is a progress message."];
// or disable user interactions
[FTIndicator showProgressWithMessage:@"Here is a progress message." userInteractionEnable:NO];
- 显示成功
[FTIndicator showSuccessWithMessage:@"Here is a success message."];
// or disable user interactions
[FTIndicator showSuccessWithMessage:@"Here is a success message." userInteractionEnable:NO];
- 显示信息
[FTIndicator showInfoWithMessage:@"Here is a info message."];
// or disable user interactions
[FTIndicator showInfoWithMessage:@"Here is a info message." userInteractionEnable:NO];
- 显示错误
[FTIndicator showErrorWithMessage:@"Here is a error message."];
// or disable user interactions
[FTIndicator showErrorWithMessage:@"Here is a error message." userInteractionEnable:NO];
- 手动消失
[FTIndicator dismissProgress];
消息提示
- 显示图片
[FTIndicator showToastMessage:@"Short Toast."];
- 手动消失
[FTIndicator dismissToast];
FTNotificationIndicator
、FTProgressIndicator
和 FTToastIndicator
分别使用 FTNotificationIndicator
- 显示图片
[FTNotificationIndicator showNotificationWithImage:[UIImage imageNamed:@"maps_icon"]
title:@"Here is a notification title."
message:@"Here is a notification message."];
- 不显示图片
[FTNotificationIndicator showNotificationWithTitle:@"Here is a notification title."
message:@"Here is a notification message."];
- 手动消失
[FTNotificationIndicator dismiss];
FTProgressIndicator
- 显示进度
[FTProgressIndicator showProgressWithmessage:@"Here is a progress message."];
// or disable user interactions
[FTProgressIndicator showProgressWithmessage:@"Here is a progress message." userInteractionEnable:NO];
- 显示成功
[FTProgressIndicator showSuccessWithMessage:@"Here is a success message."];
// or disable user interactions
[FTProgressIndicator showSuccessWithMessage:@"Here is a success message." userInteractionEnable:NO];
- 显示信息
[FTProgressIndicator showInfoWithMessage:@"Here is a info message."];
// or disable user interactions
[FTProgressIndicator showInfoWithMessage:@"Here is a info message." userInteractionEnable:NO];
- 显示错误
[FTProgressIndicator showErrorWithMessage:@"Here is a error message."];
// or disable user interactions
[FTProgressIndicator showErrorWithMessage:@"Here is a error message." userInteractionEnable:NO];
- 手动消失
[FTProgressIndicator dismiss];
FTToastIndicator
- 显示图片
[FTToastIndicator showToastMessage:@"Short Toast."];
- 手动消失
[FTToastIndicator dismiss];
CHANGELOG
许可证
FTIndicator
遵循MIT许可证。更多详情请见LICENSE文件。