Skip to content
Swift wrapper for Kipalog API (http://kipalog.com)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
KipalogAPI.xcodeproj
Sources/KipalogAPI
Tests
.gitignore
.travis.yml
KipalogAPI.podspec
LICENSE
Package.swift
README.md

README.md

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
}
You can’t perform that action at this time.