To run the example project, clone the repo, and run pod install
from the Example directory first.
MMTodo is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'MMTodo'
- In ViewController File, include MMTodo
import MMTodo
- In ViewController Class, add these
// Get an instance of the MMTodoModel
public var todoModel = MMTodoModel.shared
- 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()
-
Add Storyboard-iOS.storyboard to Target -> MMTodo -> Build Phases -> Copy Bundle Resources
-
Now MMTodo will be available when you shake your device.
- In ViewController File, include MMTodo
import MMTodo
- In ViewController Class, add these
// Get an Instance of the MMTodoModel, MMTodoMenu and MMTodoWindowController
let todoModel = MMTodoModel.shared
var todoMenu: MMTodoMenu!
var todoWindowController: MMTodoWindowController?
- 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()
- 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
}
}
-
Add MMTodoWindowController.xib, Bar.png and Save.pdf to Target -> MMTodo -> Build Phases -> Copy Bundle Resources
-
Now MMTodo will be available by Command-Shift-T or in your Help Menu.
- Xcode 9
- Swift 4.0+
-
MMTodo uses MySqlSwiftNative for MySQL connectivity.
Currently MMTodo is using a manual install since there isn't a working Swift 4 Branch.
- Add Todo Title edit in macOS
MatthewMerritt
MMTodo is available under the MIT license. See the LICENSE file for more info.