[翻译] JFMinimalNotifications

简介:

JFMinimalNotifications

This is an iOS UIView for presenting a beautiful notification that is highly configurable and works for both iPhone and iPad. JFMinimalNotification is only available in ARC and targets iOS 7.0+.

这是一个iOS的view,用以呈现非常漂亮的通知信息,高度定制,可以同时用于iPhone和iPad。JFMinimalNotification只支持ARC,iOS7.0以上。

What It Looks Like: 它看起来像这样子:

See a short video of this control here: https://www.youtube.com/watch?v=jDYC-NYKl9A

你可以在这个地方观看演示视频https://www.youtube.com/watch?v=jDYC-NYKl9A

Screen Shots 截图

How To Use It: 这么用:

Basic Example

基本用法

- (void)viewDidLoad
{
    [super viewDidLoad];

    /**
     * Create the notification
 */ self.minimalNotification = [JFMinimalNotification notificationWithStyle:JFMinimalNotificationStyleDefault title:@"This is my awesome title" subTitle:@"This is my awesome sub-title"]; /**  * Set the desired font for the title and sub-title labels  * Default is System Normal  */ UIFont* titleFont = [UIFont fontWithName:@"STHeitiK-Light" size:22]; [self.minimalNotification setTitleFont:titleFont]; UIFont* subTitleFont = [UIFont fontWithName:@"STHeitiK-Light" size:16]; [self.minimalNotification setSubTitleFont:subTitleFont]; /**  * Add the notification to a view  */ [self.view addSubview:self.minimalNotification]; } /**  * Showing the notification from a button handler  */ - (IBAction)show:(id)sender { [self.minimalNotification show]; } /**  * Hiding the notification from a button handler  */ - (IBAction)dismiss:(id)sender { [self.minimalNotification dismiss]; }

Constructors / Options

构造器 / 选项

/**
 * Note: passing a dismissalDelay of 0 means the notification will NOT be automatically dismissed, you will need to 
 * dismiss the notification yourself by calling -dismiss on the notification object. If you pass a dismissalDelay 
 * value greater than 0, this will be the length of time the notification will remain visisble before being 
 * automatically dismissed.
 */ // With dismissalDelay self.minimalNotification = [JFMinimalNotification notificationWithStyle:JFMinimalNotificationStyleError title:@"This is my awesome title" subTitle:@"This is my awesome sub-title" dismissalDelay:3.0]; // Without dismissalDelay and with touchHandler self.minimalNotification = [JFMinimalNotification notificationWithStyle:JFMinimalNotificationStyleError title:@"This is my awesome title" subTitle:@"This is my awesome sub-title" dismissalDelay:0.0 touchHandler:^{ [self.minimalNotification dismiss]; }];
// Available Styles
typedef NS_ENUM(NSInteger, JFMinimalNotificationStytle) {
    JFMinimalNotificationStyleDefault,
    JFMinimalNotificationStyleError,
    JFMinimalNotificationStyleSuccess,
    JFMinimalNotificationStyleInfo,
    JFMinimalNotificationStyleWarning
};

Please see the example project include in this repo for an example of how to use this notification.

你可以参考示例项目来看看怎么使用这个通知的控件。

Delegate Methods: 代理方法

- (void)willShowNotification:(JFMinimalNotification*)notification;
- (void)didShowNotification:(JFMinimalNotification*)notification;
- (void)willDisimissNotification:(JFMinimalNotification*)notification;
- (void)didDismissNotification:(JFMinimalNotification*)notification;

Installation: 安装

Cocoapods Cocoapods安装

pod 'JFMinimalNotifications', '~> 0.0.2'

Directly include source into your projects

直接将源码拖到你的项目当中即可

  • Simply copy the source files from the "JFMinimalNotification" folder into your project. 你只需要简单的将JFMinimalNotification文件夹拖到你的项目当中
  • In your application's project app target settings, find the "Build Phases" section and open the "Link Binary With Libraries" block and click the "+" button and select the "CoreGraphics.framework". 在你的工程项目当中,找到Build Phases区,打开Link Binary With Libraries,点击+按钮,然后选择CoreGraphics.framework框架

 

目录
相关文章
|
存储 传感器 人工智能
中小制造工厂数字化瓶颈破局:AI 流程精细化 + 工业自动化一体化落地架构实践
离散制造企业普遍存在产线自动化与管理系统数据割裂、管理颗粒粗放、人工流程成本高的痛点。本文基于产学研落地项目,介绍AI 驱动企业管理流程自动化整套技术架构,结合AI 精细化分析细化管理颗粒度能力,联动现场工业自动化设备,搭建工业自动化与企业管理流程一体化云边协同方案,给出轻量化分步落地路径与真实工厂量化收益数据,面向制造 IT、智能制造架构师提供可复用落地思路。
|
5月前
|
人工智能 自然语言处理 数据挖掘
最新版通义千问(Qwen3.8-Max-Preview)功能介绍
Qwen3.8-Max-Preview是通义千问系列推出的最新一代旗舰级大模型预览版,以**2.4万亿参数MoE混合专家架构、百万级上下文窗口、双推理模式、全栈代码能力、原生全模态、多智能体协同**为核心突破,定位“代码工程+专业办公”双核旗舰,综合能力跻身全球第一梯队。它依托阿里云百炼平台开放预览体验,支持Token Plan、Qoder、QoderWork等多渠道接入,具备持续进化特性,正式版将开源开放。相较于前代Qwen3.7-Max,该模型在复杂多轮智能体任务准确率提升35%,长文本幻觉率降低62%,全栈代码开发完整性提升40%,实现从“对话工具”到“自主执行引擎”的跨越式升级。
3219 2
|
11月前
|
安全 网络协议 前端开发
Evilginx幽灵现身美国高校:一场绕过MFA的“中间人”钓鱼风暴,给中国教育网络安全敲响警钟
2025年,一场利用Evilginx绕过多因素认证的网络攻击席卷美国多所顶尖高校,暴露全球高等教育系统在身份认证上的深层漏洞。此类“中间人”钓鱼攻击通过伪造登录页面劫持会话,窃取敏感信息,甚至导致科研数据永久损毁。其技术手段隐蔽性强,传统防御难以应对,已对中国高校敲响警钟。专家呼吁加快部署FIDO2无密码认证、强化会话绑定与DNS层防护,同时提升师生安全意识,构建从技术到人的综合防线。网络安全无国界,唯有主动防御才能守护数字信任基石。
491 3
|
7月前
|
SQL 人工智能 数据可视化
数据血缘是什么?怎么建设数据血缘?
本文直击AI落地困局:数据混乱致AI失效。提出数据血缘建设“七步法”——从目标聚焦、范围圈定、架构设计,到采集实施、知识构建、可视化应用及长效运营,强调小切口启动、业务驱动、人机协同,助力企业夯实AI根基。
|
8月前
|
人工智能 小程序 前端开发
【AI开发实战】从想法到上线,我用AI全栈开发了一款记账微信小程序
「时光账记」是一款轻量智能的微信记账小程序——AI打造,免下载即用。支持多账本协作(家庭/旅行/装修)、周期自动记账、预算实时预警、节日倒计时与自定义背景,让记账有温度、有期待、不劝退。理财,从看清每一分钱开始。(239字)
938 0
【AI开发实战】从想法到上线,我用AI全栈开发了一款记账微信小程序
|
人工智能 JSON 自然语言处理
Function AI 工作流发布:以 AI 重塑企业流程自动化
本文介绍了基于函数计算 FC 打造的全新 Function AI 工作流服务,该服务结合 AI 技术与流程自动化,实现从传统流程自动化到智能流程自动化的跨越。文章通过内容营销素材生成、内容安全审核和泛企业 VOC 挖掘三个具体场景,展示了 Function AI 工作流的设计、配置及调试过程,并对比了其与传统流程的优势。Function AI 工作流具备可视化、智能性和可扩展性,成为企业智能化转型的重要基础设施,助力企业提升效率、降低成本并增强敏捷响应能力。
1467 28
|
人工智能 弹性计算 运维
通勤路上修故障?钉钉机器人+OOS AI助手实现7×24小时运维自由
通过钉钉机器人配置阿里云OOS AI助手,您可以直接在钉钉群内发送文字指令,实现免登录、跨设备、秒级响应的阿里云运维操作。
|
安全 算法 BI
【1号防红网】盘点几个安全可靠的防红短链接服务
【1号防红网】防红短链接服务,短链接API接口
1888 0
|
Java 应用服务中间件 编译器
详解JAVA远程debug
详解JAVA远程debug
1187 0