Skip to content

MatthewMerritt/MMTodo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MMTodo

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

MMTodo is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MMTodo'

Usage iOS

  1. In ViewController File, include MMTodo
import MMTodo
  1. In ViewController Class, add these
// Get an instance of the MMTodoModel
public var todoModel = MMTodoModel.shared
  1. In ViewController.ViewDidLoad function, initialize MMTodo
// Setup the ping and MySQL Information
todoModel.settings.pingHost = "ping Host"
todoModel.settings.mySqlHost = "MySQL Host"
todoModel.settings.mySqlUsername = "MySQL Username"
todoModel.settings.mySqlPassword = "MySQL Password"
todoModel.settings.project = "Project"

or use the MMTodoSettingsViewController to set all these and save the to UserDefaults

// Start the listener for MySQL connection changes
self.todoModel.listen()
  1. Add Storyboard-iOS.storyboard to Target -> MMTodo -> Build Phases -> Copy Bundle Resources

  2. Now MMTodo will be available when you shake your device.

Usage macOS

  1. In ViewController File, include MMTodo
import MMTodo
  1. In ViewController Class, add these
// Get an Instance of the MMTodoModel, MMTodoMenu and MMTodoWindowController
let todoModel = MMTodoModel.shared
var todoMenu: MMTodoMenu!
var todoWindowController: MMTodoWindowController?
  1. In ViewController.ViewDidLoad function, initialize MMTodo
// Create Menu and place it on the Help Menu
todoMenu = MMTodoMenu(from: self, wth: #selector(self.todoMenuAction(_:)))

// Setup the ping and MySQL Information
todoModel.settings.pingHost = "ping Host"
todoModel.settings.mySqlHost = "MySQL Host"
todoModel.settings.mySqlUsername = "MySQL Username"
todoModel.settings.mySqlPassword = "MySQL Password"
todoModel.settings.project = "Project"

// Start the listener for MySQL connection changes
self.todoModel.listen()
  1. Add the menu functions to your ViewController Class
// Menu Actions
@objc func todoMenuAction(_ sender: NSMenuItem) {
    if todoWindowController == nil {
        todoMenu.todoMenuItem.state = .on
        todoWindowController = MMTodoWindowController()
        todoWindowController?.showWindow(sender)
    } else {
        todoMenu.todoMenuItem.state = .off
        todoWindowController?.close()
        todoWindowController = nil
    }
}
  1. Add MMTodoWindowController.xib, Bar.png and Save.pdf to Target -> MMTodo -> Build Phases -> Copy Bundle Resources

  2. Now MMTodo will be available by Command-Shift-T or in your Help Menu.

Requirements

  • Xcode 9
  • Swift 4.0+

Dependencies

  • MMTodo uses MySqlSwiftNative for MySQL connectivity.

    Currently MMTodo is using a manual install since there isn't a working Swift 4 Branch.

Todo

  • Add Todo Title edit in macOS

Author

MatthewMerritt

License

MMTodo is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages