Skip to content

Commit c87a71a

Browse files
committed
šŸ“– Added information about new names in Swift and new method for getting child wrappers
1 parent 5cac0d7 commit c87a71a

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

ā€ŽREADME.mdā€Ž

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ if let wrapperToRemove = directoryWrapper.withPath("hello.txt") {
197197
### Getting child wrappers
198198
> **_Notice:_** Directory wrappers only.
199199
200-
To get wrappers from a directory wrapper call `-fileWrapperWithPath`, this will also traverse all children based on supplied path.
200+
To get a wrapper from a directory wrapper call `-fileWrapperWithPath`, this will also traverse all children based on supplied path.
201201
```objective-c
202202
LSFileWrapper* directoryWrapper;
203203

@@ -208,7 +208,21 @@ LSFileWrapper* wrapper = [directoryWrapper fileWrapperWithPath: @"hello.txt"];
208208
```swift
209209
let directoryWrapper: LSFileWrapper
210210
211-
let wrapper = directoryWrapper.withPath("hello.txt")
211+
let wrapper = directoryWrapper.wrapper(with: "hello.txt")
212+
```
213+
214+
To get all first-degree child wrappers from a directory wrapper call `-fileWrappersInPath`, this will also traverse all children based on supplied path.
215+
```objective-c
216+
LSFileWrapper* directoryWrapper;
217+
218+
NSArray<LSFileWrapper*> *wrappers = [directoryWrapper fileWrappersInPath: @"/"];
219+
```
220+
221+
*Swift:*
222+
```swift
223+
let directoryWrapper: LSFileWrapper
224+
225+
let wrappers = directoryWrapper.wrappers(in: "/")
212226
```
213227
## āš–ļø License
214228
LSFileWrapper is distributed under the [MIT license](LICENSE).

0 commit comments

Comments
Ā (0)