textileio / ios-textile

[DEPRECATED] iOS bindings for https://github.com/textileio/go-textile
MIT License
10 stars 6 forks source link

Type information for ThreadList / Thread is missing #47

Open Gozala opened 5 years ago

Gozala commented 5 years ago

I'm not exactly sure how exactly swift is inferring types of things but it does not seem to have trouble inferring ThreadList here:

https://github.com/textileio/ios-textile/blob/f1c265a187012e2bee3568ac6ca4424014e6fe95/Textile/Classes/ThreadsApi.m#L40

Specifically it does seem to treat itemsArray as array of Any:

threads.itemsArray.forEach({ thread -> Void in
    print("Thread: \(thread.id)") // Value of type 'Any' has no member 'id'
})
asutula commented 5 years ago

Keeping a overview of these issues in #39

asutula commented 5 years ago

This explains it https://stackoverflow.com/questions/38011610/swift-doesnt-pickup-nsmutablearray-type-annotation-from-framework

Will definitely look for a workaround