Feed
public class Feed : CustomStringConvertible
A superclass for feeds: FlatFeed, AggregatedFeed and NotificationFeed.
-
A feed id.
Declaration
Swift
public let feedId: FeedId -
A separated callback queue from
client.callbackQueuefor completion requests.Declaration
Swift
public var callbackQueue: DispatchQueue -
Returns a feedId description of the feed.
Declaration
Swift
public var description: String { get }
-
Add a new activity.
Declaration
Swift
@discardableResult public func add<T>(_ activity: T, completion: @escaping ActivityCompletion<T>) -> Cancellable where T : ActivityProtocolParameters
activityan activity to add.
completiona completion block with the activity that was added.
Return Value
an object to cancel the request.
-
Remove an activity by the activityId.
Declaration
Swift
@discardableResult public func remove(activityId: String, completion: @escaping RemovedCompletion) -> CancellableParameters
activityIdan activityId to remove.
completiona completion block with removed activityId.
Return Value
an object to cancel the request.
-
Remove an activity by the foreignId.
Declaration
Swift
@discardableResult public func remove(foreignId: String, completion: @escaping RemovedCompletion) -> CancellableParameters
foreignIdan foreignId to remove.
completiona completion block with removed activityId.
Return Value
an object to cancel the request.
-
Follow a target feed.
Declaration
Swift
@discardableResult public func follow(toTarget target: FeedId, activityCopyLimit: Int = 100, completion: @escaping StatusCodeCompletion) -> CancellableParameters
targetthe target feed this feed should follow, e.g. user:44.
activityCopyLimithow many activities should be copied from the target feed, max 1000, default 100.
Return Value
an object to cancel the request.
-
Unfollow a target feed.
Note
Unfollow target’s activities are purged from the feed unless thekeepHistoryparameter is provided.Declaration
Swift
@discardableResult public func unfollow(fromTarget target: FeedId, keepHistory: Bool = false, completion: @escaping StatusCodeCompletion) -> CancellableParameters
targetthe target feed, e.g. user:44.
keepHistorywhen provided the activities from target feed will not be kept in the feed.
Return Value
an object to cancel the request.
-
Returns a paginated list of followers.
Note
the number of followers that can be retrieved is limited to 1000.Declaration
Swift
@discardableResult public func followers(offset: Int = 0, limit: Int = 25, completion: @escaping FollowersCompletion) -> CancellableParameters
offsetnumber of followers to skip before returning results, max 400.
limitamount of results per request, max 500, default 25.
completiona result with
Follower‘s or an error.Return Value
an object to cancel the request.
-
Returns a paginated list of the feeds which are followed by the feed.
Note
the number of followers that can be retrieved is limited to 1000.Declaration
Swift
@discardableResult public func following(filter: FeedIds = [], offset: Int = 0, limit: Int = 25, completion: @escaping FollowersCompletion) -> CancellableParameters
filterlist of feeds to filter results on.
offsetnumber of followers to skip before returning results, max 400.
limitamount of results per request, max 500, default 25.
completiona result with
Follower‘s or an error.Return Value
an object to cancel the request.
-
Subscribe for the updates of the given activity type of
ActivityProtocol.Declaration
Swift
public func subscribe<T: ActivityProtocol>(typeOf type: T.Type, decoder: JSONDecoder = .default, subscription: @escaping Subscription<T>) -> SubscribedChannelParameters
typean
ActivityProtocolof activities.decodera custom decoder for the given activity type.
subscriptiona subscription block with changes. It will retrun a
ResultwithSubscriptionResponseorDecodingError.Return Value
a
SubscribedChannelkeep the subscription util it will be deinit. Store the object in a variable for the getting updates and then set it to nil to unsubscribe.
View on GitHub
Feed Class Reference