https://github.com/jinjunhan/hjextensions
https://github.com/jinjunhan/hjextensions
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/jinjunhan/hjextensions
- Owner: JinjunHan
- License: mit
- Created: 2021-06-24T07:53:37.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-24T09:22:05.000Z (almost 5 years ago)
- Last Synced: 2024-03-15T04:46:58.384Z (over 2 years ago)
- Language: Swift
- Size: 12.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HJExtensions
## Installation
### CocoaPods
```
pod 'HJExtensions', '~> 1.0'
```
## Usage
初始化一个类,并执行某些操作
```
lazy view1 = UIView.hj.make { make in
// doing something with make
}
```
对已初始化的对象执行操作
```
lazy view1 = UIView(frame: .zero).hj.setup { make in
// doing something with make
}
```
一些UIView的链式调用操作,如添加到视图并布局,这样就避免忘记addSubview
```
view1.hj.add(to: view).snp.makeConstraints { }
```