Swiftpack.co -  nam-dh/KipalogAPI as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
nam-dh/KipalogAPI
Swift wrapper for Kipalog API (http://kipalog.com)
.package(url: "https://github.com/nam-dh/KipalogAPI.git", from: "1.0.1")

Kipalog API

Swift wrapper for Kipalog API (http://kipalog.com)

Original documentation see at: https://github.com/Kipalog/Kipalog-API-Doc

Build Status

Installation:

Swift Package Manager

Adding it to your Package.swift:

import PackageDescription

let package = Package(
    name: "YourProject",
    dependencies: [
        .package(url: "https://github.com/nam-dh/KipalogAPI.git",
                 from: "1.0.1")
    ],
    targets: [
        .target(name: "YourProject",
                dependencies: ["KipalogAPI"],
                path: "Sources")    
)
$ swift build

Usage:

IMPORTANT: Configure your API access token

KipalogAPI.shared.accessToken = 'token-obtained-from-kipalog'

Get post list (hot posts, latest posts, posts by tag)

KipalogAPI.shared.getPostList(type: .hot) { (result) in
}

There are 3 list types:

public enum PostListType {
  case hot
  case latest
  case tag(String)
}

Publish a new post

let newPost = KLLocalPost(title: "Hello World", action: .publish, content: "markdown text", tags: ["TIL","Markdown"], type: .markdown)
KipalogAPI.shared.post(newPost) { (error) in
}

Draft a new post

let newPost = KLLocalPost(title: "Hello World", action: .draft, content: "markdown text", tags: ["TIL","Markdown"], type: .markdown)
KipalogAPI.shared.post(newPost) { (error) in
}

Preview a post

let newPost = KLLocalPost(title: "Hello World", content: "plain", tags: ["TIL","Markdown"], type: .markdown)
KipalogAPI.shared.preview(newPost) { (post) in
}

GitHub

link
Stars: 8
Last commit: 3 years ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API