Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DemoProjects/NowPlayingView/NowPlayingView/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ class AppDelegate: UIResponder,
}

func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
let parameters = appRemote.authorizationParameters(from: url);
let parameters = appRemote.authorizationParameters(from: url)

if let access_token = parameters?[SPTAppRemoteAccessTokenKey] {
appRemote.connectionParameters.accessToken = access_token
self.accessToken = access_token
} else if let error_description = parameters?[SPTAppRemoteErrorDescriptionKey] {
playerViewController.showError(error_description);
playerViewController.showError(error_description)
}

return true
Expand All @@ -62,7 +62,7 @@ class AppDelegate: UIResponder,
}

func applicationDidBecomeActive(_ application: UIApplication) {
self.connect();
self.connect()
}

func connect() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ConnectionStatusIndicatorView : UIView {
displayLink?.add(to: RunLoop.main, forMode: RunLoopMode.commonModes)
} else {
displayLink?.remove(from: RunLoop.main, forMode: RunLoopMode.commonModes)
displayLink = nil;
displayLink = nil
}
}
}
Expand All @@ -29,7 +29,7 @@ class ConnectionStatusIndicatorView : UIView {

override func didMoveToSuperview() {
super.didMoveToSuperview()
self.clearsContextBeforeDrawing = true;
self.clearsContextBeforeDrawing = true
self.backgroundColor = UIColor.clear
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extension Dictionary {
let valueString = value as! String
let encodedKey = keyString.encodeStringAsUrlParameter(key as! String)
let encodedValue = valueString.encodeStringAsUrlParameter(value as! String)
let encoded = String(format: "%@=%@", encodedKey, encodedValue);
let encoded = String(format: "%@=%@", encodedKey, encodedValue)
pairs.append(encoded)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class PlaybackButtonGraphics {
width: 64, height: 64,
bitsPerComponent: 8, bytesPerRow: 8*64*4,
space: CGColorSpaceCreateDeviceRGB(),
bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue);
bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue)

let path = CGMutablePath()
for linePoints in lines {
Expand Down Expand Up @@ -62,10 +62,10 @@ class PlaybackButtonGraphics {
width: 64, height: 64,
bitsPerComponent: 8, bytesPerRow: 8*64*4,
space: CGColorSpaceCreateDeviceRGB(),
bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue);
bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue)

context?.fill(CGRect(x: 0, y: 0, width: 20, height: 64));
context?.fill(CGRect(x: 44, y: 0, width: 20, height: 64));
context?.fill(CGRect(x: 0, y: 0, width: 20, height: 64))
context?.fill(CGRect(x: 44, y: 0, width: 20, height: 64))
if let image = context?.makeImage() {
return UIImage(cgImage: image, scale: UIScreen.main.scale, orientation: .up)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ViewController: UIViewController,
self.navigationItem.rightBarButtonItem = UIBarButtonItem(customView: connectionIndicatorView)
connectionIndicatorView.frame = CGRect(origin: CGPoint(), size: CGSize(width: 20,height: 20))

playPauseButton.setTitle("", for: UIControlState.normal);
playPauseButton.setTitle("", for: UIControlState.normal)
playPauseButton.setImage(PlaybackButtonGraphics.playButtonImage(), for: UIControlState.normal)
playPauseButton.setImage(PlaybackButtonGraphics.playButtonImage(), for: UIControlState.highlighted)

Expand Down Expand Up @@ -84,7 +84,7 @@ class ViewController: UIViewController,

if (!enabled) {
albumArtImageView.image = nil
updatePlayPauseButtonState(true);
updatePlayPauseButtonState(true)
}
}

Expand All @@ -101,7 +101,7 @@ class ViewController: UIViewController,

fileprivate func updatePodcastSpeed(speed: SPTAppRemotePodcastPlaybackSpeed) {
currentPodcastSpeed = speed
podcastSpeedButton.setTitle(String(format: "%0.1fx", speed.value.floatValue), for: .normal);
podcastSpeedButton.setTitle(String(format: "%0.1fx", speed.value.floatValue), for: .normal)
}

// MARK: Player Control
Expand Down