Skip to content

Instantly share code, notes, and snippets.

func didSelectDate(date:NSDate, inCell cell:DetailsTableViewCell){
if labels[selectedIndexPath!.row] == "Start"{ // Start date selected
let newStartDate = date
defaults.setObject(newStartDate, forKey: "startDT")
let duration = (defaults.objectForKey("eventDuration") as! Int) ?? 10
let doubleTimeDuration:Double = Double(duration * 60) //convert Int to Double for next calc.
// add day word always for details view.
let dateFormatterDay = NSDateFormatter()
// get for day name as full word
dateFormatterDay.dateFormat = "EEEE"
let dayNameOfEvent = dateFormatterDay.stringFromDate(startDT)
if ( (day == "Today") || (day == "Tomorrow") ) {
day = day + ", " + dayNameOfEvent
func shareCell (actionType:String, image:UIImageView) {
switch (actionType){
case "textImage":
let objectsToShare = [image]
let activityVC = UIActivityViewController(
activityItems: objectsToShare,
case "record":
flagAutoRecord = true
defaults.setObject(flagAutoRecord, forKey: "flagAutoRecord") //sets flagAutoRecord for processing
print("p339 we in here? query: \(query)")
if let tabBarController = self.window!.rootViewController as? UITabBarController {
tabBarController.selectedIndex = 2 //main Dictate screen