This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) { | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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---------------------") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // MapSampleViewController.swift | |
| // verytmp | |
| // | |
| // Created by Don Mag on 5/11/17. | |
| // Copyright © 2017 DonMag. All rights reserved. | |
| // | |
| import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |