Latest 1.1.6
Homepage https://github.com/GetStream/stream-swift
License BSD-3
Platforms ios 9.0
Authors

Stream Swift Client

Build Status
Language: Swift 4.2
CocoaPods compatible
Carthage compatible
Swift Package Manager compatible

stream-swift is a Swift client for Stream.

You can sign up for a Stream account at https://getstream.io/get_started.

API Docs

API Examples

Installation

CocoaPods

For Stream, use the following entry in your Podfile:

pod 'GetStream', '~> 1.0'

Then run pod install.

In any file you’d like to use Stream in, don’t forget to import the framework with import GetStream.

Swift Package Manager

To integrate using Apple’s Swift package manager, add the following as a dependency to your Package.swift:

.package(url: "https://github.com/GetStream/stream-swift.git", .upToNextMajor(from: "1.0.0"))

Carthage

Make the following entry in your Cartfile:

github "GetStream/stream-swift"

Then run carthage update.

Quick start

// Setup a shared Stream client.
Client.config = .init(apiKey: "<#ApiKey#>", appId: "<#AppId#>", token: "<#Token#>")

// Create Chris's user feed.
let chrisFeed = Client.shared.flatFeed(feedSlug: "user", userId: "chris")

// Create an Activity. You can make own Activity class or struct with custom properties.
let activity = Activity(actor: "chris", verb: "add", object: "picture:10", foreignId: "picture:10")

chrisFeed.add(activity) { result in
    // A result of the adding of the activity.
    print(result)
}

// Create a following relationship between Jack's "timeline" feed and Chris' "user" feed:
let jackFeed = Client.shared.flatFeed(feedSlug: "timeline", userId: "jack")

jackFeed.follow(toTarget: chrisFeed.feedId, activityCopyLimit: 1) { result in
    print(result)
}

// Read Jack's timeline and Chris' post appears in the feed:
jackFeed.get(typeOf: Activity.self, pagination: .limit(10)) { result in
    let response = try! result.get()
    print(response.results)
}

// Remove an activity by referencing it's foreignId
chrisFeed.remove(foreignId: "picture:10") { result in
    print(result)
}

More API examples here

Credits & Contributors

Project is maintained by Alexey Bukhtin.

We continue to welcome pull requests from community members.

Copyright and License Information

Copyright (c) 2016-2018 Stream.io Inc, and individual contributors. All rights reserved.

See the file "LICENSE" for information on the history of this software, terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.

Latest podspec

{
    "name": "GetStream",
    "version": "1.1.6",
    "summary": "Swift Client - Build Activity Feeds & Streams with GetStream.io https://getstream.io",
    "homepage": "https://github.com/GetStream/stream-swift",
    "license": {
        "type": "BSD-3",
        "file": "LICENSE"
    },
    "authors": {
        "Alexey Bukhtin": "[email protected]"
    },
    "social_media_url": "https://getstream.io",
    "swift_version": "4.2",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/GetStream/stream-swift.git",
        "tag": "1.1.6"
    },
    "default_subspecs": [
        "Core",
        "Faye"
    ],
    "subspecs": [
        {
            "name": "Core",
            "source_files": "Sources/Core/**/*",
            "frameworks": "Foundation",
            "dependencies": {
                "Moya": [
                    "~> 12.0"
                ],
                "Result": [
                    "~> 4.1"
                ],
                "Swime": [
                    "~> 3.0"
                ]
            }
        },
        {
            "name": "Faye",
            "source_files": "Sources/Faye/*",
            "dependencies": {
                "GetStream/Core": [],
                "Faye": []
            }
        }
    ]
}

Pin It on Pinterest

Share This