File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 11MIT License
22
3- Copyright (c) 2020 Maxim Krouk
3+ Copyright (c) 2021 CaptureContext
44
55Permission is hereby granted, free of charge, to any person obtaining a copy
66of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change 11# swift-capture
22
3- [ ![ SwiftPM 5.3] ( https://img.shields.io/badge/📦_spm -5.3-ED523F.svg?style=flat )] ( https://swift.org/download/ ) [ ![ @maximkrouk ] ( https://img.shields.io/badge/contact-@maximkrouk -1DA1F2.svg?style=flat&logo=twitter )] ( https://twitter.com/maximkrouk )
3+ [ ![ SwiftPM 5.3] ( https://img.shields.io/badge/📦_swiftpm -5.3-ED523F.svg?style=flat )] ( https://swift.org/download/ ) [ ![ @maximkrouk ] ( https://img.shields.io/badge/contact-@capturecontext -1DA1F2.svg?style=flat&logo=twitter )] ( https://twitter.com/capture_context )
44
55A mechanism for safe capturing & weakifying objects in Swift.
66
77## Usage Examples
88
99``` swift
10- Without weak
10+ Without Capture
1111```
1212
1313``` swift
14- With weak
14+ With Capture
1515```
1616
1717----
@@ -76,6 +76,21 @@ let object.dataSource = { [weak self] in
7676let object.dataSource = capture (or : [], in : \.data )
7777```
7878
79+ ----
80+
81+ Weak assign
82+
83+ ``` swift
84+ { [weak self ] value in
85+ self ? .value = value
86+ }
87+ ```
88+
89+ ``` swift
90+ captureAssign (to : \.value )
91+ captureAssign (to : \.value , removeDuplicates : == )
92+ ```
93+
7994## Installation
8095
8196### Basic
You can’t perform that action at this time.
0 commit comments