Jailbroken? Get it on Cydia
Swift 3, XCode 8.0+
Clone,
cd Nyan-Tunes
,pod install
Build & Run.
The app needs a vk.com account to log in. You can get one for free at
https://vk.com/join
The app also provides and option to continue offline, in which case only the downloaded tracks are accessible.
Lists tracks saved to the user's vk.com profile.
Streams the track if not already downloaded, else plays from local storage.
Starts downloading the audio track to local storage and enables the download progress indicators. Also replaces itself with the 'Cancel' button to cancel an in-progress download.
Shows the 'Remove' action button, tapping which removes the song from the user's vk profile, and refreshes the table.
Lists the downloaded tracks.
Plays the track from local storage.
Shows the 'Delete' action button, tapping which removes the song from the device, and refreshed the table.
Allows searching for and adding tracks to the user's profile.
Shows the 'Add to profile' action button, tapping which adds the song to the user's vk profile.
Located at the bottom throughout, it allows playback control, and shows the currently playing track.
Toggles the audio playback.
Current track info
The currently playing item is shown on the iOS Lockscreen and in the Control Center. Playback control works from the lockscreen and the Control Center. The current progress and total duration of the song is also shown.
##The code
The code uses vk's open source iOS SDK, available at https://github.com/VKCOM/vk-ios-sdk
The
MiniPlayerView
,Download Manager
,Audio Manager
,VKClient
, andAudioTableViewCell
are all classes written either from scratch, or by extending other native classes to provide shared instances, custom properties, and custom functions, that make things more centralized and easier to handle.