NSFormatter 子类集合 FormatterKit

码农软件 · 软件分类 · 其他(Others) · 2019-07-18 18:13:46

软件介绍

FormatterKit 收集了一系列精心设计的 NSFormatter 子类,例如信息单元,距离和相对时间间隔。每一个 formatter 从他们各自领域的复杂商业逻辑中抽离出来,所以你可以专注用于你的应用程序。

示例代码:

TTTTimeIntervalFormatter *timeIntervalFormatter = [[TTTTimeIntervalFormatter alloc] init];
[timeIntervalFormatter stringForTimeInterval:0]; // "just now"
[timeIntervalFormatter stringForTimeInterval:-100]; // "1 minute ago"
[timeIntervalFormatter stringForTimeInterval:-8000]; // "2 hours ago"

// Turn idiomatic deictic expressions on / off
[timeIntervalFormatter stringForTimeInterval:-100000]; // "1 day ago"
[timeIntervalFormatter setUsesIdiomaticDeicticExpressions:YES];
[timeIntervalFormatter stringForTimeInterval:-100000]; // "yesterday"

// Customize the present tense deictic expression for
[timeIntervalFormatter setPresentDeicticExpression:@"seconds ago"];
[timeIntervalFormatter stringForTimeInterval:0]; // "seconds ago"

// Expand the time interval for present tense
[timeIntervalFormatter stringForTimeInterval:-3]; // "3 seconds ago"
[timeIntervalFormatter setPresentTimeIntervalMargin:10];
[timeIntervalFormatter stringForTimeInterval:-3]; // "seconds ago"

本文地址:https://codercto.com/soft/d/10421.html

信息架构

信息架构

[美] 路易斯·罗森菲尔德、[美] 彼得·莫尔维莱、[美] 豪尔赫·阿朗戈 / 樊旺斌、师蓉 / 电子工业出版社 / 2016-5-1 / 128.00元

本书的前三个版本都是信息架构领域的开山著作。其中描述了信息组织的普遍和永恒原则,这一原则也适用于不断增长的移动世界。在第4版中,作者运用大量最新的插图和例子为这些原则提供了当前实践中的情境,验证了那些与技术和供应商无关的工具,以及那些经受住时间考验的技术。一起来看看 《信息架构》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试