2
这是一个后续行动这样一个问题:保持与flatMap指数在斯威夫特
flatMap and `Ambiguous reference to member` error
有我使用下面的代码的Record
秒的数组转换成的Person
秒的数组:
let records = // load file from bundle
let persons = records.flatMap(Person.init)
由于此转换可能需要一些时间来处理大文件,因此我希望监视一个索引以将其输入到进度指示器中。
这是可能与这flatMap
建设?我想到的一种可能是在init函数中发送一个通知,但我认为从flatMap
内计算记录也是可能的?
令人惊叹,多么简单和优雅! – Koen
欢迎来到斯威夫特! :p – Alexander