SessionKit

1.0.3

Digipolitan/session-kit

What's New

1.0.3

2018-12-19T14:28:43Z

add setter with subscript

SessionKit

Swift Version Build Status CocoaPods Compatible Carthage Compatible Swift Package Manager Compatible Platform Twitter

Session access for swift apps

Installation

CocoaPods

To install SessionKit with CocoaPods, add the following lines to your Podfile.

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

pod 'SessionKit'

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate SessionKit into your Xcode project using Carthage, specify it in your Cartfile:

github 'Digipolitan/session-kit ~> 1.0

Run carthage update to build the framework and drag the built SessionKit.framework into your Xcode project.

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

Once you have your Swift package set up, adding SessionKit as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/Digipolitan/session-kit.git", from: "1.0.0")
]

The Basics

First you must start your session

let session = Session.start()

Then after that you can add variables to session.

session?.userInfo["token"] = "ndfzfoerhnce32rkeznf"

to retrieve your session data you need to use the restore method

if let session = Session.restore() {
    printf(session["token"]) // display: ndfzfoerhnce32rkeznf
}

When the session is finished you can remove it using the destroy method

if let session = Session.restore() {
    session.destroy()
}

Contributing

See CONTRIBUTING.md for more details!

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to contact@digipolitan.com.

License

SessionKit is licensed under the BSD 3-Clause license.

Description

  • Swift Tools 4.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Tue Oct 22 2024 03:30:33 GMT-0900 (Hawaii-Aleutian Daylight Time)