Skip to content

Commit 2d5887f

Browse files
committed
simplify
1 parent 22868c8 commit 2d5887f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

bk2ch12p567observingNSProgress/ch25p840customThermometer/ViewController.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11

22
import UIKit
33

4-
class ProgressingOperation : NSObject, NSProgressReporting {
4+
class ProgressingOperation {
55
let progress : NSProgress
66
init(units:Int) {
77
self.progress = NSProgress(totalUnitCount: Int64(units))
8-
super.init()
98
}
109
func start() {
1110
NSTimer.scheduledTimerWithTimeInterval(0.4, target: self, selector: "inc:", userInfo: nil, repeats: true)
1211
}
13-
func inc(t:NSTimer) {
12+
@objc func inc(t:NSTimer) {
1413
self.progress.completedUnitCount += 1
1514
if self.progress.fractionCompleted >= 1.0 {
1615
t.invalidate()

0 commit comments

Comments
 (0)