-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCPPViewController.swift
33 lines (25 loc) · 1021 Bytes
/
CPPViewController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// CPPViewController.swift
// FirstApp
//
// Created by Emma Barme on 21/09/2015.
// Copyright (c) 2015 Emma Barme. All rights reserved.
//
import UIKit
class CPPViewController: UIViewController {
var count = 0
@IBOutlet weak var label: UILabel!
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
@IBAction func goAction() {
self.activityIndicator.startAnimating()
let qos = Int(QOS_CLASS_USER_INITIATED.value)
dispatch_async(dispatch_get_global_queue(Int(QOS_CLASS_USER_INITIATED.value), 0)) { () -> Void in
self.count = Useless_ObjCtoCPlusPlus.waitingFuncCPlusPlus(self.count)
self.count = Useless_ObjCtoCPlusPlus.doStuffCPlusPlus(self.count)
dispatch_async(dispatch_get_main_queue()) { () -> Void in
self.activityIndicator.stopAnimating()
self.label.text = "Congratulation, you have run \(self.count) C++ function(s)!"
}
}
}
}