Skip to content

Instantly share code, notes, and snippets.

var cvtFormat = NSDateFormatter()
cvtFormat.dateFormat = "H:mm"
var dVal = cvtFormat.dateFromString("21:30")
cvtFormat.dateFormat = "h:mm a"
var newString = cvtFormat.stringFromDate(dVal!)
//----------------------------------------------------------------------------------
// new class
// MyMKPointAnnotation.swift
// ChatMap
//
// Created by Don Mag on 2/15/17.
// Copyright © 2017 Chris. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet var MatabiauButton: UIButton!
@IBOutlet var PDFButton: UIButton!
@IBOutlet var Button360: UIButton!
@IBOutlet var VideoButton: UIButton!
override func viewDidLoad() {
Display select Contact view
Did user hit Cancel? If yes, get out
User selected a Contact - call custom "save()" function
In save() function:
Does Contact have multiple Phones?
// in cellForRowAtIndexPath
// always set to Checkmark
cell.accessoryType = UITableViewCellAccessoryCheckmark;
// if DON'T show checkmark for this row...
if (!bShowCheckmark) {
UIView* myAcc = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 24, 4)];
myAcc.backgroundColor = [UIColor whiteColor];
//
// ProfileViewController.swift
// scratchy
//
// Created by Don Mag on 3/9/17.
// Copyright © 2017 DonMag. All rights reserved.
//
import UIKit
if(foundExtra == NO)
{
if(movingStopped == NO)
{
if (!currentDrawingImage) {
NSLog(@"why is it not valid here?");
} else {
drawOn = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, currentDrawingImage.size.width/2, currentDrawingImage.size.height/2)];
drawOn.image = currentDrawingImage;
//: Playground - noun: a place where people can play
import UIKit
// peopleArray will be an Array of Dictionary objects
let thePeopleArray = [
[ "firstName": "mom mobile", "phone": "242-1111"],
[ "firstName": "mom work", "phone": "242-2222"],
[ "firstName": "mom", "lastName": "car", "phone": "242-3333"],
[ "firstName": "mom", "lastName": "home", "phone": "242-3333"],
#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonHMAC.h>
#import "ViewController.h"
@implementation ViewController
- (NSData *)dataFromHexString:(NSString *)sHex {
const char *chars = [sHex UTF8String];
@DonMag
DonMag / tmp.m
Last active March 20, 2017 14:25
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSArray *myArray = @[@"hello Array", @"goodbye Array"];
NSDictionary *myDictionary = @{
@"firstKey" : @"hello Dict",
@"secondKey" : @"goodbye Dict"
};