I need to monitor the content of the Documents folder for new content. I see that on OSX there is a File Systems Events API. What about iOS? How could I do this?
Asked
Active
Viewed 2,792 times
2
-
Duplicate http://stackoverflow.com/questions/2972563/what-is-the-optimal-way-to-monitor-changes-in-a-directory-with-a-kqueue – Björn Kaiser Jan 18 '11 at 17:01
-
Indeed. Thanks! Also: http://stackoverflow.com/questions/3181821/notification-of-changes-to-the-iphones-documents-directory – Soch S. Jan 18 '11 at 17:30
-
Possible duplicate of [What is the optimal way to monitor changes in a directory with a kqueue()?](https://stackoverflow.com/questions/2972563/what-is-the-optimal-way-to-monitor-changes-in-a-directory-with-a-kqueue) – Rivera Sep 14 '18 at 13:43
1 Answers
0
README:
FileSystemEventPublisher
A publisher that tracks changes in the file system.
Example usage:
let cancellable = DispatchSource.publish(
.all,
for: FileManager.default.temporaryDirectory
)
.receive(on: RunLoop.main)
.sink { event in
print(event)
}
//.
//.
//.
cancellable.cancel()

Kenneth Laskoski
- 115
- 2
- 7