All Projects → xmartlabs → Ecno

xmartlabs / Ecno

Licence: mit
Ecno is a task state manager built on top of UserDefaults in pure Swift 4.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Ecno

Nickel
Micro tasks manager written in pure Python
Stars: ✭ 18 (-80.43%)
Mutual labels:  tasks, todolist, task-manager
Vim Bujo
A minimalist task manager for vim.
Stars: ✭ 136 (+47.83%)
Mutual labels:  todolist, task-manager
Javascript Todo List Tutorial
✅ A step-by-step complete beginner example/tutorial for building a Todo List App (TodoMVC) from scratch in JavaScript following Test Driven Development (TDD) best practice. 🌱
Stars: ✭ 212 (+130.43%)
Mutual labels:  todolist, tutorial
Todolist flutter
🎓Flutter TodoList tutorial
Stars: ✭ 225 (+144.57%)
Mutual labels:  todolist, tutorial
Markor
Text editor - Notes & ToDo (for Android) - Markdown, todo.txt, plaintext, math, ..
Stars: ✭ 1,394 (+1415.22%)
Mutual labels:  tasks, todolist
taskontable
Taskontable is To-Do List & Time keeper on Spreadsheet.
Stars: ✭ 14 (-84.78%)
Mutual labels:  todolist, task-manager
Geek Life
The Todo List / Task Manager for Geeks in command line
Stars: ✭ 212 (+130.43%)
Mutual labels:  todolist, task-manager
Qtodotxt2
Rewrite of GUI code of QTodoTxt using qml.
Stars: ✭ 136 (+47.83%)
Mutual labels:  tasks, todolist
WeekToDoWeb
WeekToDo is a free minimalist weekly planner app focused on privacy. Schedule your tasks and projects with to do lists and a calendar. Available for Windows, Mac, Linux or online.
Stars: ✭ 48 (-47.83%)
Mutual labels:  tasks, task-manager
Task
No description or website provided.
Stars: ✭ 14 (-84.78%)
Mutual labels:  tasks, task-manager
Qtodotxt
Cross Platform todo.txt GUI
Stars: ✭ 358 (+289.13%)
Mutual labels:  tasks, todolist
H2o Tutorials
Tutorials and training material for the H2O Machine Learning Platform
Stars: ✭ 1,305 (+1318.48%)
Mutual labels:  tutorial
Core
D Language online tour (https://tour.dlang.org/) and online editor (https://run.dlang.io/)
Stars: ✭ 89 (-3.26%)
Mutual labels:  tutorial
End To End Sequence Labeling Via Bi Directional Lstm Cnns Crf Tutorial
Tutorial for End-to-end Sequence Labeling via Bi-directional LSTM-CNNs-CRF
Stars: ✭ 87 (-5.43%)
Mutual labels:  tutorial
Frame
New-tab extension for Chrome and Firefox
Stars: ✭ 89 (-3.26%)
Mutual labels:  task-manager
Mapreduce
MapReduce by examples
Stars: ✭ 91 (-1.09%)
Mutual labels:  tutorial
Articulate Common Lisp.github.io
docs/specs for a tutorial site for a Common Lisp environment
Stars: ✭ 90 (-2.17%)
Mutual labels:  tutorial
Godot Demos
Godot demos and tutorials
Stars: ✭ 88 (-4.35%)
Mutual labels:  tutorial
K3s Gitlab
k3s + Gitlab install notes
Stars: ✭ 89 (-3.26%)
Mutual labels:  tutorial
Sp Dev Fx Webparts
SharePoint Framework web part, Teams tab, personal app, app page samples
Stars: ✭ 1,289 (+1301.09%)
Mutual labels:  tutorial

Build status Platform iOS Swift 5 compatible Carthage compatible CocoaPods compatible License: MIT

By Xmartlabs SRL.

Introduction

Ecno was inspired by Once Android library. It's a task state manager built on top of UserDefaults in pure Swift 4. This abstraction allows you to mark 'tasks' as done, 'to-do' and check for those states.

Ecno is ideal for:

  • Show tutorials once within the application.
  • Perform certain task periodically.
  • Trigger a task based on a user action.

Usage

First you need to initialize it:

Ecno.initialize()

Note: you should initialize it when your app gets launched.

Then, you can check whether a task was done by:

if !Ecno.beenDone("task") {
  //...
  Ecno.markDone("task")
}

Also, you can check for specific requirements about a certain task:

if Ecno.beenDone("task", scope: .appSession, numberOfTimes: .moreThan(3)) {
  // do stuff
}

or

if Ecno.beenDone("task", scope: .since(20.minutes), numberOfTimes: .lessThan(3)) {
  // do stuff
}

Additionally, you can program a 'to do' task by:

Ecno.toDo("show banner", scope: .until(3.hours), info: ["name": "bannerName"])

and then query if you need to do that task:

if Ecno.needToDo("show banner") {
  let info = Ecno.infoForToDo("show banner") // ["name": "bannerName"]
  // ...
}

Task

Any type conforming to the Task protocol. Since it would be the most common case, the String type already conforms to Task.

public protocol Task {

    var tag: String { get }

}

Scope

Scopes represents periods of time within the application.

  • .appInstall
    This period represents all times for the application.
  • .appVersion
    Period starting when the current version of the app was installed.
  • .appSession
    Period starting when the application was launched.
  • .since(TimeInterval)
    Period starting since TimeInterval time ago from now. For instance, .since(2.days)
  • .until(TimeInterval)
    Period valid until TimeInterval from now. For instance, .until(3.hours). This should be useful to set a 'to do' task that expires.

Functions

  • func toDo(_ task: Task, scope: Scope? = nil, info: [AnyHashable: Any]? = nil)
    Marks a task as 'to do' within a given scope, if it has already been marked as to do or been done within that scope then it will not be marked. If the scope is nil, then it will be marked as to do anyways.
  • func needToDo(_ task: Task) -> Bool
    Checks if a task is currently marked as 'to do'.
  • func infoForToDo(_ task: Task) -> [AnyHashable: Any]?
    Gets the info associated with a 'to do' task. (only if you provided it in the toDo(...) function)
  • func lastDone(_ task: Task) -> Date?
    Last done timestamp for a given task.
  • func beenDone(_ task: Task, scope: Scope = .appInstall, numberOfTimes: CountChecker = .moreThan(0)) -> Bool
    Checks if a task has been done with the given requirements.
  • func markDone(_ task: Task)
    Marks a task as done.

Requirements

  • iOS 8.0+
  • Swift 4.0+
  • Xcode 9.0+

Getting involved

  • If you want to contribute please feel free to submit pull requests.
  • If you have a feature request please open an issue.
  • If you found a bug or need help please check older issues

Before contribute check the CONTRIBUTING file for more info.

If you use Ecno in your app We would love to hear about it! Drop us a line on twitter.

Examples

Follow these 3 steps to run Example project:

  • Clone Ecno repository
  • Open Ecno workspace and run the Example project.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects.

To install Ecno, simply add the following line to your Podfile:

pod 'Ecno', '~> 3.0'

Carthage

Carthage is a simple, decentralized dependency manager for Cocoa.

To install Ecno, simply add the following line to your Cartfile:

github "xmartlabs/Ecno" ~> 3.0

Author

Change Log

This can be found in the CHANGELOG.md file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].