FTIndicator
一个包含本地通知、进度 HUD、Toast 的轻量级 UI 包,具有 模糊效果
、优雅的 API
和 主题支持
,灵感来自 Apple 的进度 HUD、通知和 Android 的 Toast。
三合一
- 如果你想使用这三种指示器,请使用
FTIndicator
。 - 同时,
FTNotificationIndicator
、FTProgressIndicator
和FTToastIndicator
也能单独工作。根据需要使用它们。
FTIndicator
FTNotificationIndicator
FTProgressIndicator
FTToastIndicator
屏幕截图
横幅
风格 | 浅色 | 暗色 |
---|---|---|
通知 | ![]() |
![]() |
进度 | ![]() |
![]() |
吐司提示 | ![]() |
![]() |
横屏
风格 | 浅色 | 暗色 |
---|---|---|
通知 | ![]() |
![]() |
进度 | ![]() |
![]() |
吐司提示 | ![]() |
![]() |
安装
手动
- 克隆此仓库。
- 简单地将 '/FTIndicator' 文件夹拖入您的项目。
- 导入 'FTIndicator.h'
CocoaPods
FTIndicator
通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile
1.2.2 版本的语法错误修复:语法错误已修复。可能会引起项目错误,请谨慎更新。
1.2.0 版本的主要修复:当应用启动时不显示进度 HUD
FTNotificationIndicator
、FTProgressIndicator
和 FTToastIndicator
podfile 在 v1.1.5 版本后停止更新。如果您想单独使用它们,应在您的 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];
Toast
- 显示带图片的通知
[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
LICENSE
FTIndicator
遵循MIT许可证。有关更多信息,请参阅LICENSE文件。