Skip to content

Demo application to show basic usage of Appwrite Swift SDK

Notifications You must be signed in to change notification settings

armino-dev/appwrite-swift-sdk-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

appwrite-swift-sdk-demo

Sample usage of Appwrite Swift SDK.

First add AppwriteSwiftSDK dependency in Package.swift:

    .package(name: "AppwriteSwiftSDK", url: "https://github.com/armino-dev/appwrite-swift-sdk.git", from: "0.6.4"),
    ],

Then in your main.swift:

import Foundation
import AppwriteSwiftSDK

var client: Client = Client()

client    
    .setProject(value: "your_project_id_here")
    .setEndpoint(endpoint: "http://localhost/v1")
    .setKey(value: "your_api_key_here")
    .setMode(value: "admin")

let users: Users = Users(client: client);


var result: [Any] = users.listUsers()


let r1: [String: Any] = result[0] as! [String : Any]
print("Records: ", r1["sum"] as Any)

let r2 = r1["users"] as! Array<Any>

for r3 in r2 {
    let r4: [String: Any] = r3 as! [String: Any]
    for (k, v) in r4 {
        print("\(k) = \(v)")
    }
}

About

Demo application to show basic usage of Appwrite Swift SDK

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages