Skip to content

Instantly share code, notes, and snippets.

You've parsed the dictation and determined the user wants to call a contact...
1. Find the Contact
2. Get the Phone Number
3. Actually make the call
--------------------
@IBAction func buttonProcess(sender: AnyObject) {
...
You've parsed the dictation and determined the user wants to call a contact...
1. Find the Contact
2. Get the Phone Number
3. Actually make the call
--------------------
func makeTheCall() {
import UIKit
import SnapKit
private let insets = UIEdgeInsets(top: 15, left: 10, bottom: 15, right: 10)
private let labelSpacing: CGFloat = 7
private let formPadding: CGFloat = 10
class ViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource,
UICollectionViewDelegateFlowLayout {
var thePeopleArray = [
[ "firstName": "mom", "phone": "242-1111"],
[ "firstName": "John", "phone": "111-1111"],
[ "firstName": "Sam", "phone": "777-7777"],
[ "lastName": "Sam", "phone": "888-8888"]
]
print("Starting array size:", thePeopleArray.count)
print()
for i in 0..<thePeopleArray.count {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
NotificationCenter.default.addObserver(self, selector: #selector(self.showNotifs(_:)), name: nil, object: nil)
return true
}
func showNotifs(_ notification: Notification) {
print("\n---------------------\nNotification received [", notification.name, "]\n", notification.userInfo?.description ?? "no desc", "\n---------------------")
}
struct PlanPoint: Equatable {
var x, y: Int
}
func == (left: PlanPoint, right: PlanPoint) -> Bool {
return left.x == right.x && left.y == right.y
}
private var points: Array<PlanPoint> = []
var startPoint = CGPoint.zero
var startCoord = CLLocationCoordinate2D(latitude: 48.8582, longitude: 2.2945)
@IBAction func didPan(_ sender: Any) {
if let recognizer = sender as? UIPanGestureRecognizer {
// translate touch to local view
let trans = recognizer.translation(in: recognizer.view)
//
// MapSampleViewController.swift
// verytmp
//
// Created by Don Mag on 5/11/17.
// Copyright © 2017 DonMag. All rights reserved.
//
import UIKit
//
// MenuBarCVViewController.swift
// verytmp
//
// Created by Don Mag on 5/12/17.
// Copyright © 2017 DonMag. All rights reserved.
//
import UIKit
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
let mbVC = MenuBarCVViewController()
mbVC.automaticallyAdjustsScrollViewInsets = false
let navController = UINavigationController()
navController.viewControllers = [mbVC]
window!.rootViewController = navController
window!.makeKeyAndVisible()