siegesmund / SwiftDDP

A Meteor client, written in Swift
MIT License
145 stars 60 forks source link

How to get Collection in a list ? #1

Closed Sadmansamee closed 8 years ago

Sadmansamee commented 8 years ago

How to get collection returned as Array after subscription ? or how to get subscription returned value? I tried with Meteor.collection("collectionName") after proper subscription I did not get any value , it gives me nil.

siegesmund commented 8 years ago

Hi, @Sadmansamee -

  1. Create an array.
  2. To get a table in a list, subclass AbstractCollection and override the following methods:
    • documentWasAdded(collection:id:fields:)
    • documentWasChanged(collection:id:fields:cleared)
    • documentWasRemoved(collection:id)
  3. In each of the subclassed methods add, update or remove your document.
Sadmansamee commented 8 years ago

cool.. thanks... and your new example demonstrate the procedure I think.. looking forward to it,