Skip to content

Commit 104f861

Browse files
committed
update for Swift 1.2, Xcode 6.3
1 parent a63f3da commit 104f861

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

bk2ch14p643ducking/ch27p912ducking/Player.swift

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

22

3-
import UIKIt
3+
import UIKit
44
import AVFoundation
55
import MediaPlayer
66

@@ -13,7 +13,7 @@ class Player : NSObject, AVAudioPlayerDelegate {
1313
var forever = false
1414
weak var delegate : PlayerDelegate?
1515

16-
func playFileAtPath(path:NSString) {
16+
func playFileAtPath(path:String) {
1717
self.player?.delegate = nil
1818
self.player?.stop()
1919
let fileURL = NSURL(fileURLWithPath: path)

bk2ch14p643ducking/ch27p912ducking/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ViewController: UIViewController, PlayerDelegate {
1919
@IBAction func doButton (sender:AnyObject!) {
2020
self.player.delegate = self
2121
let path = NSBundle.mainBundle().pathForResource("test", ofType: "aif")!
22-
if (sender as UIButton).currentTitle == "Forever" {
22+
if (sender as! UIButton).currentTitle == "Forever" {
2323
// for remote control to work, our audio session policy must be Playback
2424
AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, withOptions: nil, error: nil)
2525
self.player.forever = true

bk2ch14p653backgroundPlayerAndInterrupter/backgroundPlayer/backgroundPlayer/Player.swift

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

22

3-
import UIKIt
3+
import UIKit
44
import AVFoundation
55
import MediaPlayer
66

@@ -46,7 +46,7 @@ class Player : NSObject, AVAudioPlayerDelegate {
4646
})
4747
}
4848

49-
func playFileAtPath(path:NSString) {
49+
func playFileAtPath(path:String) {
5050
self.player?.delegate = nil
5151
self.player?.stop()
5252
let fileURL = NSURL(fileURLWithPath: path)

bk2ch14p653backgroundPlayerAndInterrupter/interrupter/interrupter/Player2.swift

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

22

3-
import UIKIt
3+
import UIKit
44
import AVFoundation
55
import MediaPlayer
66

@@ -15,7 +15,7 @@ class Player : NSObject, AVAudioPlayerDelegate {
1515
var observer : NSObjectProtocol!
1616
var observer2 : NSObjectProtocol!
1717

18-
func playFileAtPath(path:NSString) {
18+
func playFileAtPath(path:String) {
1919
self.player?.delegate = nil
2020
self.player?.stop()
2121
let fileURL = NSURL(fileURLWithPath: path)

bk2ch14p655AVAudioEngineTest/AVAudioEngineTest/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class ViewController: UIViewController {
167167
(buffer : AVAudioPCMBuffer!, time : AVAudioTime!) in
168168
let dataptrptr = buffer.floatChannelData
169169
let dataptr = dataptrptr.memory
170-
let datum = dataptr[buffer.frameLength-1]
170+
let datum = dataptr[Int(buffer.frameLength) - 1]
171171
if done && fabs(datum) < 0.000001 {
172172
println("stopping")
173173
self.engine.stop()

0 commit comments

Comments
 (0)