Skip to content

Commit 819ef78

Browse files
committed
update readme
1 parent bb53016 commit 819ef78

File tree

2 files changed

+103
-10
lines changed

2 files changed

+103
-10
lines changed

README.md

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,60 @@
1+
[简体中文](README_CN.md)
2+
13
# ReerKit
24
ReerKit is a collection of native Swift extensions that provide convenient methods, syntactic sugar, and performance improvements for various native data types, UIKit, and Cocoa classes for iOS, macOS, tvOS, watchOS, and Linux platforms.
3-
Some of the source code is gathered from various sources on the internet for utility classes or extension methods, with some code optimization and bug fixes. The remaining content is developed by myself. All system type extensions in the framework have the `re` infix added to avoid ambiguity issues when calling the same name extension, such as `"SGVsbG\n8gV29ybGQh".re.base64Decoded`, `"123".re.md5String`.
5+
All system type extensions in the framework have the `re` infix added to avoid ambiguity issues when calling the same name extension, such as
6+
```swift
7+
SGVsbG\n8gV29ybGQh".re.base64Decoded
48
5-
[简体中文](README_CN.md)
9+
"123".re.md5String
10+
11+
view.re.addSwiftUIView(Color.red)
12+
```
13+
14+
There are also a of other convenient features available.
15+
```swift
16+
// Access dictionary contents using dot notation implemented by dynamic member lookup
17+
let dict: [String: Any] = ...
18+
dict.dml.user_name.re.string <=> dict["user_name"] as? String
19+
20+
// Weak reference container, automatically removes elements when they are destroyed.
21+
WeakSet, WeakMap
22+
23+
// Set grayscale mode for UIView
24+
view.re.isGrayModeEnabled = true
25+
26+
// Data Structure Encapsulation
27+
BinaryTree, Tree, LinkedList, Queue, BoundedQueue, Stack, OrderedSet, OrderDictionary
28+
29+
// Lock Encapsulation
30+
MutexLock, ReadWriteLock, Synchronizing, UnfaireLock
31+
32+
// PropertyWrappers
33+
Clamped, Locked, Rounded, RWLocked, Trimmed
34+
35+
// Other Utility
36+
RSA, AES, CountdownTimer, Debouncer, Throttler, DeinitObserver, KeyboardManager, Keychain, Reachability, NanoID, MulticastDelegate
37+
38+
// Additionally, it provides a large number of extension methods and vars for frameworks such as the standard library, UIKit, and Foundation.
39+
String+REExtensions
40+
UIView+REExtensions
41+
Array+REExtensions
42+
Date+REExtensions
43+
...
44+
```
645
746
## Requirements
8-
iOS 12.0+ / tvOS 12.0+ / watchOS 4.0+ / macOS 10.13+ / visionOS 1.0+ / Ubuntu 14.04+
47+
iOS 12.0+
48+
macOS 10.13+
49+
tvOS 12.0+
50+
watchOS 4.0+
51+
visionOS 1.0+
52+
Ubuntu 14.04+
953
Swift 5.9+
10-
XCode 15.2+
54+
XCode 15.4+
55+
56+
## Usage
57+
[Documents build by DocC](https://swiftpackageindex.com/reers/ReerKit/1.1.1/documentation/reerkit)
1158
1259
## Installation
1360
@@ -56,5 +103,4 @@ let package = Package(
56103
<summary>Manual</summary>
57104
</br>
58105
<p>Add the <a href="https://github.com/reers/ReerKit/tree/main/Sources">ReerKit</a> folder to your Xcode project to use all extensions or specific extensions.</p>
59-
</details>
60-
106+
</details>

README_CN.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,58 @@
11
# ReerKit
2-
ReerKit 是许多个原生 Swift 扩展的集合,为 iOS、macOS、tvOS、watchOS 和 Linux 提供了适用于各种原生数据类型、UIKit 和 Cocoa 类的便捷方法、语法糖和性能改进。
3-
部分源代码是从互联网各处整理到的一些工具类或扩展方法, 并对其进行了一定的优化和 bug 修复. 剩下的内容由本人自己开发完成. 框架中所有的系统类型 extension 都添加了 `re` 中缀, 避免了同名扩展调用时的歧义问题, 如 `"SGVsbG\n8gV29ybGQh".re.base64Decoded`, `"123".re.md5String`.
2+
ReerKit 是许多个原生 Swift 扩展的集合,为 iOS、macOS、tvOS、watchOS, visionOS 和 Linux 提供了适用于各种原生数据类型、UIKit 和 Cocoa 类的便捷方法、语法糖和性能改进。
3+
框架中所有的系统类型 extension 都添加了 `re` 中缀, 避免了同名扩展调用时的歧义问题, 如
4+
```swift
5+
SGVsbG\n8gV29ybGQh".re.base64Decoded
6+
7+
"123".re.md5String
8+
9+
view.re.addSwiftUIView(Color.red)
10+
```
11+
12+
框架中还包含许多其他丰富便捷的功能
13+
```swift
14+
// 用 dynamic member lookup 实现通过点语法访问字典内容
15+
let dict: [String: Any] = ...
16+
dict.dml.user_name.re.string <=> dict["user_name"] as? String
17+
18+
// 弱引用容器, 元素销毁时自动移出容器
19+
WeakSet, WeakMap
20+
21+
// 设置 UIView 灰度模式
22+
view.re.isGrayModeEnabled = true
23+
24+
// 数据结构封装
25+
BinaryTree, Tree, LinkedList, Queue, BoundedQueue, Stack, OrderedSet, OrderDictionary
26+
27+
// 各种锁的封装
28+
MutexLock, ReadWriteLock, Synchronizing, UnfaireLock
29+
30+
// 属性包装器 PropertyWrappers
31+
Clamped, Locked, Rounded, RWLocked, Trimmed
32+
33+
// 其他工具类
34+
RSA, AES, CountdownTimer, Debouncer, Throttler, DeinitObserver, KeyboardManager, Keychain, Reachability, NanoID, MulticastDelegate
35+
36+
// 还有为标准库, UIKit, Foudation 等框架提供了大量扩展方法和属性
37+
String+REExtensions
38+
UIView+REExtensions
39+
Array+REExtensions
40+
Date+REExtensions
41+
....
42+
```
443
544
## 要求
6-
iOS 12.0+ / tvOS 12.0+ / watchOS 4.0+ / macOS 10.13+ / visionOS 1.0+ / Ubuntu 14.04+
45+
iOS 12.0+
46+
macOS 10.13+
47+
tvOS 12.0+
48+
watchOS 4.0+
49+
visionOS 1.0+
50+
Ubuntu 14.04+
751
Swift 5.9+
8-
XCode 15.2+
52+
XCode 15.4+
53+
54+
## 使用文档
55+
[DocC 生成的文档](https://swiftpackageindex.com/reers/ReerKit/1.1.1/documentation/reerkit)
956
1057
## 安装
1158

0 commit comments

Comments
 (0)