├── iTunes Graphs ├── iTunes Graphs-Bridging-Header.h ├── Track.swift ├── AppDelegate.swift ├── ColouredCircle.swift ├── Info.plist ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── ViewController.swift ├── Chart.swift ├── DataHandling.swift └── Base.lproj │ └── Main.storyboard ├── screenshot.png ├── screenshot2.png ├── iTunes Graphs.xcodeproj ├── xcuserdata │ └── zacg.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── iTunes Graphs.xcscheme ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj └── README.md /iTunes Graphs/iTunes Graphs-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import 2 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zac-garby/iTunes-Graphs/HEAD/screenshot.png -------------------------------------------------------------------------------- /screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zac-garby/iTunes-Graphs/HEAD/screenshot2.png -------------------------------------------------------------------------------- /iTunes Graphs.xcodeproj/xcuserdata/zacg.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /iTunes Graphs.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iTunes Graphs 2 | 3 | ![](screenshot.png) 4 | 5 | iTunes Graphs is a Cocoa-based macOS app which visualises your iTunes library in a series of pie charts. 6 | Currently, it supports the following graphs: 7 | 8 | - Artists 9 | - Genres 10 | - Decades 11 | 12 | I've also made an [iOS version](https://github.com/zac-garby/music-stats). 13 | 14 | ![](screenshot2.png) 15 | 16 | There's a build in the *Releases* section on GitHub. 17 | -------------------------------------------------------------------------------- /iTunes Graphs/Track.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Track.swift 3 | // iTunes Graphs 4 | // 5 | // Created by Zac G on 05/07/2017. 6 | // Copyright © 2017 Zac G. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class Track: NSObject { 12 | var title: String 13 | var artist: String 14 | var genre: String 15 | var decade: String 16 | 17 | init(title: String, artist: String, genre: String, decade: String) { 18 | self.title = title 19 | self.artist = artist 20 | self.genre = genre 21 | self.decade = decade 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /iTunes Graphs/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // iTunes Graphs 4 | // 5 | // Created by Zac G on 04/07/2017. 6 | // Copyright © 2017 Zac G. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | func applicationDidFinishLaunching(_ aNotification: Notification) { 14 | // Insert code here to initialize your application 15 | } 16 | 17 | func applicationWillTerminate(_ aNotification: Notification) { 18 | // Insert code here to tear down your application 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /iTunes Graphs/ColouredCircle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ColouredCircle.swift 3 | // iTunes Graphs 4 | // 5 | // Created by Zac G on 04/07/2017. 6 | // Copyright © 2017 Zac G. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @IBDesignable 12 | class ColouredCircle: NSView { 13 | @IBInspectable var colour: NSColor = .black 14 | 15 | override func draw(_ dirtyRect: NSRect) { 16 | let path = NSBezierPath(ovalIn: dirtyRect) 17 | colour.setFill() 18 | path.fill() 19 | } 20 | 21 | func setColour(to colour: NSColor) { 22 | self.colour = colour 23 | needsDisplay = true 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /iTunes Graphs.xcodeproj/xcuserdata/zacg.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | iTunes Graphs.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 126DFED21F0BAAD200BBC115 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /iTunes Graphs/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | Copyright © 2017 Zac G. All rights reserved. 27 | NSMainStoryboardFile 28 | Main 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /iTunes Graphs/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /iTunes Graphs/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // iTunes Graphs 4 | // 5 | // Created by Zac G on 04/07/2017. 6 | // Copyright © 2017 Zac G. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import iTunesLibrary 11 | 12 | class ViewController: NSViewController { 13 | @IBOutlet var arrayController: NSArrayController! 14 | 15 | @IBOutlet weak var chart: Chart! 16 | @IBOutlet weak var colouredCircle: ColouredCircle! 17 | @IBOutlet weak var titleLabel: NSTextField! 18 | @IBOutlet weak var percentageLabel: NSTextField! 19 | @IBOutlet weak var table: NSTableView! 20 | 21 | var artists: [String:Int] = [:] 22 | var genres: [String:Int] = [:] 23 | var decades: [String:Int] = [:] 24 | 25 | var data: [Track] = [] 26 | 27 | var artistData: [(String, Double)] = [] 28 | var genreData: [(String, Double)] = [] 29 | var decadeData: [(String, Double)] = [] 30 | 31 | var selectedCategory: (String, NSColor)? = nil 32 | 33 | var tab = 0 34 | let maximumCategories = 10 35 | 36 | override func viewDidLoad() { 37 | chart.viewController = self 38 | 39 | table.dataSource = self 40 | table.dataSource?.tableView!(table, sortDescriptorsDidChange: []) 41 | 42 | let library: ITLibrary 43 | 44 | do { 45 | library = try ITLibrary(apiVersion: "1.0") 46 | } catch { 47 | print("Error occured!") 48 | return 49 | } 50 | 51 | let tracks = library.allMediaItems 52 | 53 | for track in tracks { 54 | if track.mediaKind == .kindSong { 55 | guard let artist = track.artist?.name else { continue } 56 | let decade = Int(Double(track.year) / 10.0).description + "0s" 57 | 58 | data.append(Track(title: track.title, artist: artist, genre: track.genre, decade: decade)) 59 | 60 | increment(key: artist, of: &artists) 61 | increment(key: track.genre, of: &genres) 62 | increment(key: decade.description, of: &decades) 63 | } 64 | } 65 | 66 | artistData = postprocess(dict: artists) 67 | genreData = postprocess(dict: genres) 68 | decadeData = postprocess(dict: decades) 69 | 70 | arrayController.content = data 71 | 72 | load(data: artistData) 73 | } 74 | 75 | @IBAction func changeTab(_ sender: NSSegmentedControl) { 76 | let data: [(String, Double)] 77 | 78 | tab = sender.selectedSegment 79 | 80 | switch sender.selectedSegment { 81 | case 0: 82 | data = Array(artistData) 83 | case 1: 84 | data = Array(genreData) 85 | case 2: 86 | data = Array(decadeData) 87 | default: 88 | data = [] 89 | } 90 | 91 | load(data: data) 92 | } 93 | 94 | func updateInfoPanel() { 95 | guard let (title, colour) = selectedCategory else { return } 96 | 97 | colouredCircle.setColour(to: colour) 98 | 99 | titleLabel.stringValue = title == "\0\0" ? "Other" : title 100 | 101 | let percent = Int(round((chart.getPercentage(of: title) ?? 0) * 100)) 102 | percentageLabel.stringValue = "\(percent)%" 103 | 104 | arrayController.content = filteredData() 105 | } 106 | 107 | func load(data: [(String, Double)]) { 108 | chart.load(data: data) 109 | } 110 | } 111 | 112 | -------------------------------------------------------------------------------- /iTunes Graphs/Chart.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PieChart.swift 3 | // iTunes Graphs 4 | // 5 | // Created by Zac G on 04/07/2017. 6 | // Copyright © 2017 Zac G. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @IBDesignable 12 | class Chart: NSView { 13 | var viewController: ViewController? = nil 14 | var data: [(String, Double)] = [("", 40), ("", 20), ("", 60), ("", 45), ("", 60), ("", 40)] 15 | var paths: [String:(NSBezierPath, NSColor)] = [:] 16 | var colours: [NSColor] = [.red, .white] 17 | 18 | override func draw(_ dirtyRect: NSRect) { 19 | drawPie() 20 | } 21 | 22 | func drawPie() { 23 | let center = NSPoint(x: bounds.width / 2, y: bounds.height / 2) 24 | let radius = min(bounds.width, bounds.height) * 0.4 25 | 26 | let anglePerUnit = 360 / getTotal() 27 | 28 | var startAngle = 30.0 29 | var colourIndex = 0 30 | 31 | paths = [:] 32 | 33 | for (key, value) in data { 34 | let angle = value * anglePerUnit 35 | 36 | let path = NSBezierPath() 37 | 38 | path.move(to: center) 39 | 40 | path.appendArc(withCenter: center, radius: radius, 41 | startAngle: CGFloat(startAngle), 42 | endAngle: CGFloat(startAngle + angle)) 43 | 44 | path.move(to: center) 45 | 46 | let colour = colours[colourIndex] 47 | 48 | colour.setFill() 49 | path.fill() 50 | 51 | startAngle += angle 52 | colourIndex = (colourIndex + 1) % colours.count 53 | 54 | paths[key] = (path, colour) 55 | } 56 | } 57 | 58 | func getTotal() -> Double { 59 | return data.reduce(0.0, { result, pair in return result + pair.1 }) 60 | } 61 | 62 | func getPercentage(of key: String) -> Double? { 63 | if let (_, amount) = data.first(where: { category in return category.0 == key }) { 64 | return amount / getTotal() 65 | } 66 | 67 | return nil 68 | } 69 | 70 | func generateColours() -> [NSColor] { 71 | let count = Double(data.count) 72 | var hue = 0.0 73 | var colours: [NSColor] = [] 74 | 75 | for (key, _) in data { 76 | if key == "\0\0" { 77 | colours.append(NSColor(calibratedHue:0.00, saturation:0.00, brightness:0.8, alpha:1.00)) 78 | } else { 79 | colours.append(NSColor(calibratedHue: CGFloat(hue), saturation: 0.65, brightness: 1.00, alpha: 1.00)) 80 | hue += 1 / count 81 | } 82 | 83 | } 84 | 85 | return colours 86 | } 87 | 88 | func load(data: [(String, Double)]) { 89 | self.data = data 90 | colours = generateColours() 91 | 92 | if viewController != nil && data.count > 0 { 93 | viewController?.selectedCategory = (data.first!.0, colours.first!) 94 | viewController?.updateInfoPanel() 95 | } 96 | 97 | needsDisplay = true 98 | } 99 | 100 | override func mouseDown(with event: NSEvent) { 101 | changeSelection(with: event) 102 | } 103 | 104 | override func mouseDragged(with event: NSEvent) { 105 | changeSelection(with: event) 106 | } 107 | 108 | private func changeSelection(with event: NSEvent) { 109 | let point = event.locationInWindow 110 | 111 | for (key, (path, colour)) in paths { 112 | if path.contains(point) { 113 | viewController?.selectedCategory = (key, colour) 114 | viewController?.updateInfoPanel() 115 | } 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /iTunes Graphs.xcodeproj/xcuserdata/zacg.xcuserdatad/xcschemes/iTunes Graphs.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /iTunes Graphs/DataHandling.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DataHandling.swift 3 | // iTunes Graphs 4 | // 5 | // Created by Zac G on 04/07/2017. 6 | // Copyright © 2017 Zac G. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | postfix operator % 12 | 13 | postfix func % (percentage: Int) -> Double { 14 | return Double(percentage) / 100 15 | } 16 | 17 | postfix func % (percentage: Double) -> Double { 18 | return percentage / 100 19 | } 20 | 21 | extension ViewController { 22 | func increment(key: String, of dict: inout [String:Int]) { 23 | if dict.keys.contains(key) { 24 | dict[key] = dict[key]! + 1 25 | } else { 26 | dict[key] = 1 27 | } 28 | } 29 | 30 | func postprocess(dict: [String:Int]) -> [(String, Double)] { 31 | let total = dict.reduce(0.0) { (result, pair) in 32 | return result + Double(pair.value) 33 | } 34 | 35 | var data = convert(dict: dict) 36 | 37 | data = data.filter() { (_, value) in 38 | return value / total > 2% 39 | } 40 | 41 | data = data.sorted() { a, b in 42 | return a.1 > b.1 43 | } 44 | 45 | var trimmed: [(String, Double)] = data 46 | 47 | if data.count > maximumCategories { 48 | trimmed = Array(data.dropLast(data.count - maximumCategories)) 49 | } 50 | 51 | let difference = dict.keys.count - trimmed.count 52 | trimmed.append(("\0\0", Double(difference))) 53 | 54 | return trimmed 55 | } 56 | 57 | func convert(dict: [String:Int]) -> [(String, Double)] { 58 | var data: [(String, Double)] = [] 59 | 60 | for (key, value) in dict { 61 | data.append((key, Double(value))) 62 | } 63 | 64 | return data 65 | } 66 | 67 | func filteredData() -> [Track] { 68 | var result: [Track] 69 | let category = selectedCategory!.0 70 | 71 | switch tab { 72 | case 0: 73 | result = getFilteredData( 74 | category: category, 75 | of: artists, 76 | with: artistData, 77 | getKey: { object in return object.artist }) 78 | case 1: 79 | result = getFilteredData( 80 | category: category, 81 | of: genres, 82 | with: genreData, 83 | getKey: { object in return object.genre }) 84 | case 2: 85 | result = getFilteredData( 86 | category: category, 87 | of: decades, 88 | with: decadeData, 89 | getKey: { object in return object.decade }) 90 | default: 91 | result = [] 92 | } 93 | 94 | 95 | return result.sorted() { a, b in 96 | return a.title < b.title 97 | } 98 | } 99 | 100 | func getFilteredData(category: String, 101 | of dict: [String:Int], 102 | with dataArray: [(String, Double)], 103 | otherName: String = "\0\0", 104 | getKey: (Track) -> String) -> [Track] { 105 | 106 | if category == otherName { 107 | let other = dict.filter() { item in 108 | let name = item.0 109 | 110 | let isOther = !dataArray.contains() { item in 111 | return item.0 == name 112 | } 113 | 114 | return isOther 115 | } 116 | 117 | return data.filter() { (object: Track) in 118 | return other.contains() { item in 119 | return getKey(object) == item.0 120 | } 121 | } 122 | } 123 | 124 | return data.filter() { (object: Track) in 125 | return getKey(object) == category 126 | } 127 | } 128 | } 129 | 130 | extension ViewController: NSTableViewDataSource { 131 | func tableView(_ tableView: NSTableView, sortDescriptorsDidChange oldDescriptors: [NSSortDescriptor]) { 132 | let content = arrayController.content as! [Track] 133 | 134 | let nsArray = NSArray(array: content) 135 | let array = nsArray.sortedArray(using: tableView.sortDescriptors) 136 | arrayController.content = array 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /iTunes Graphs.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1201A5AF1F0CF68A00100EFB /* Track.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1201A5AE1F0CF68A00100EFB /* Track.swift */; }; 11 | 124A6A8E1F0D26F50094D9B2 /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = 124A6A8D1F0D26F50094D9B2 /* README.md */; }; 12 | 126DFED71F0BAAD200BBC115 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 126DFED61F0BAAD200BBC115 /* AppDelegate.swift */; }; 13 | 126DFED91F0BAAD200BBC115 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 126DFED81F0BAAD200BBC115 /* ViewController.swift */; }; 14 | 126DFEDB1F0BAAD200BBC115 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 126DFEDA1F0BAAD200BBC115 /* Assets.xcassets */; }; 15 | 126DFEDE1F0BAAD200BBC115 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 126DFEDC1F0BAAD200BBC115 /* Main.storyboard */; }; 16 | 126DFEE71F0BAC7500BBC115 /* iTunesLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 126DFEE61F0BAC7500BBC115 /* iTunesLibrary.framework */; }; 17 | 126DFEEE1F0BB4EB00BBC115 /* Chart.swift in Sources */ = {isa = PBXBuildFile; fileRef = 126DFEED1F0BB4EB00BBC115 /* Chart.swift */; }; 18 | 129A105A1F0BF79700446150 /* DataHandling.swift in Sources */ = {isa = PBXBuildFile; fileRef = 129A10591F0BF79700446150 /* DataHandling.swift */; }; 19 | 129A105C1F0BFC4800446150 /* ColouredCircle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 129A105B1F0BFC4800446150 /* ColouredCircle.swift */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 1201A5AE1F0CF68A00100EFB /* Track.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Track.swift; sourceTree = ""; }; 24 | 124A6A8D1F0D26F50094D9B2 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = SOURCE_ROOT; }; 25 | 126DFED31F0BAAD200BBC115 /* iTunes Graphs.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iTunes Graphs.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | 126DFED61F0BAAD200BBC115 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 27 | 126DFED81F0BAAD200BBC115 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 28 | 126DFEDA1F0BAAD200BBC115 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 29 | 126DFEDD1F0BAAD200BBC115 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 30 | 126DFEDF1F0BAAD200BBC115 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | 126DFEE61F0BAC7500BBC115 /* iTunesLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iTunesLibrary.framework; path = ../../../../Library/Frameworks/iTunesLibrary.framework; sourceTree = ""; }; 32 | 126DFEEA1F0BAEEE00BBC115 /* iTunes Graphs-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "iTunes Graphs-Bridging-Header.h"; sourceTree = ""; }; 33 | 126DFEED1F0BB4EB00BBC115 /* Chart.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Chart.swift; sourceTree = ""; }; 34 | 129A10591F0BF79700446150 /* DataHandling.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DataHandling.swift; sourceTree = ""; }; 35 | 129A105B1F0BFC4800446150 /* ColouredCircle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColouredCircle.swift; sourceTree = ""; }; 36 | /* End PBXFileReference section */ 37 | 38 | /* Begin PBXFrameworksBuildPhase section */ 39 | 126DFED01F0BAAD200BBC115 /* Frameworks */ = { 40 | isa = PBXFrameworksBuildPhase; 41 | buildActionMask = 2147483647; 42 | files = ( 43 | 126DFEE71F0BAC7500BBC115 /* iTunesLibrary.framework in Frameworks */, 44 | ); 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | /* End PBXFrameworksBuildPhase section */ 48 | 49 | /* Begin PBXGroup section */ 50 | 126DFECA1F0BAAD200BBC115 = { 51 | isa = PBXGroup; 52 | children = ( 53 | 124A6A8D1F0D26F50094D9B2 /* README.md */, 54 | 126DFED51F0BAAD200BBC115 /* iTunes Graphs */, 55 | 126DFED41F0BAAD200BBC115 /* Products */, 56 | 126DFEE51F0BAC7500BBC115 /* Frameworks */, 57 | ); 58 | sourceTree = ""; 59 | }; 60 | 126DFED41F0BAAD200BBC115 /* Products */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | 126DFED31F0BAAD200BBC115 /* iTunes Graphs.app */, 64 | ); 65 | name = Products; 66 | sourceTree = ""; 67 | }; 68 | 126DFED51F0BAAD200BBC115 /* iTunes Graphs */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 126DFED61F0BAAD200BBC115 /* AppDelegate.swift */, 72 | 126DFED81F0BAAD200BBC115 /* ViewController.swift */, 73 | 1201A5AE1F0CF68A00100EFB /* Track.swift */, 74 | 129A10591F0BF79700446150 /* DataHandling.swift */, 75 | 126DFEDA1F0BAAD200BBC115 /* Assets.xcassets */, 76 | 126DFEDC1F0BAAD200BBC115 /* Main.storyboard */, 77 | 129A105B1F0BFC4800446150 /* ColouredCircle.swift */, 78 | 126DFEED1F0BB4EB00BBC115 /* Chart.swift */, 79 | 126DFEDF1F0BAAD200BBC115 /* Info.plist */, 80 | 126DFEEA1F0BAEEE00BBC115 /* iTunes Graphs-Bridging-Header.h */, 81 | ); 82 | path = "iTunes Graphs"; 83 | sourceTree = ""; 84 | }; 85 | 126DFEE51F0BAC7500BBC115 /* Frameworks */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 126DFEE61F0BAC7500BBC115 /* iTunesLibrary.framework */, 89 | ); 90 | name = Frameworks; 91 | sourceTree = ""; 92 | }; 93 | /* End PBXGroup section */ 94 | 95 | /* Begin PBXNativeTarget section */ 96 | 126DFED21F0BAAD200BBC115 /* iTunes Graphs */ = { 97 | isa = PBXNativeTarget; 98 | buildConfigurationList = 126DFEE21F0BAAD200BBC115 /* Build configuration list for PBXNativeTarget "iTunes Graphs" */; 99 | buildPhases = ( 100 | 126DFECF1F0BAAD200BBC115 /* Sources */, 101 | 126DFED01F0BAAD200BBC115 /* Frameworks */, 102 | 126DFED11F0BAAD200BBC115 /* Resources */, 103 | ); 104 | buildRules = ( 105 | ); 106 | dependencies = ( 107 | ); 108 | name = "iTunes Graphs"; 109 | productName = "iTunes Graphs"; 110 | productReference = 126DFED31F0BAAD200BBC115 /* iTunes Graphs.app */; 111 | productType = "com.apple.product-type.application"; 112 | }; 113 | /* End PBXNativeTarget section */ 114 | 115 | /* Begin PBXProject section */ 116 | 126DFECB1F0BAAD200BBC115 /* Project object */ = { 117 | isa = PBXProject; 118 | attributes = { 119 | LastSwiftUpdateCheck = 0830; 120 | LastUpgradeCheck = 0830; 121 | ORGANIZATIONNAME = "Zac G"; 122 | TargetAttributes = { 123 | 126DFED21F0BAAD200BBC115 = { 124 | CreatedOnToolsVersion = 8.3.3; 125 | DevelopmentTeam = ZX7M3HPXGX; 126 | LastSwiftMigration = 0830; 127 | ProvisioningStyle = Automatic; 128 | }; 129 | }; 130 | }; 131 | buildConfigurationList = 126DFECE1F0BAAD200BBC115 /* Build configuration list for PBXProject "iTunes Graphs" */; 132 | compatibilityVersion = "Xcode 3.2"; 133 | developmentRegion = English; 134 | hasScannedForEncodings = 0; 135 | knownRegions = ( 136 | en, 137 | Base, 138 | ); 139 | mainGroup = 126DFECA1F0BAAD200BBC115; 140 | productRefGroup = 126DFED41F0BAAD200BBC115 /* Products */; 141 | projectDirPath = ""; 142 | projectRoot = ""; 143 | targets = ( 144 | 126DFED21F0BAAD200BBC115 /* iTunes Graphs */, 145 | ); 146 | }; 147 | /* End PBXProject section */ 148 | 149 | /* Begin PBXResourcesBuildPhase section */ 150 | 126DFED11F0BAAD200BBC115 /* Resources */ = { 151 | isa = PBXResourcesBuildPhase; 152 | buildActionMask = 2147483647; 153 | files = ( 154 | 126DFEDB1F0BAAD200BBC115 /* Assets.xcassets in Resources */, 155 | 126DFEDE1F0BAAD200BBC115 /* Main.storyboard in Resources */, 156 | ); 157 | runOnlyForDeploymentPostprocessing = 0; 158 | }; 159 | /* End PBXResourcesBuildPhase section */ 160 | 161 | /* Begin PBXSourcesBuildPhase section */ 162 | 126DFECF1F0BAAD200BBC115 /* Sources */ = { 163 | isa = PBXSourcesBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | 129A105A1F0BF79700446150 /* DataHandling.swift in Sources */, 167 | 126DFEEE1F0BB4EB00BBC115 /* Chart.swift in Sources */, 168 | 126DFED91F0BAAD200BBC115 /* ViewController.swift in Sources */, 169 | 124A6A8E1F0D26F50094D9B2 /* README.md in Sources */, 170 | 126DFED71F0BAAD200BBC115 /* AppDelegate.swift in Sources */, 171 | 129A105C1F0BFC4800446150 /* ColouredCircle.swift in Sources */, 172 | 1201A5AF1F0CF68A00100EFB /* Track.swift in Sources */, 173 | ); 174 | runOnlyForDeploymentPostprocessing = 0; 175 | }; 176 | /* End PBXSourcesBuildPhase section */ 177 | 178 | /* Begin PBXVariantGroup section */ 179 | 126DFEDC1F0BAAD200BBC115 /* Main.storyboard */ = { 180 | isa = PBXVariantGroup; 181 | children = ( 182 | 126DFEDD1F0BAAD200BBC115 /* Base */, 183 | ); 184 | name = Main.storyboard; 185 | sourceTree = ""; 186 | }; 187 | /* End PBXVariantGroup section */ 188 | 189 | /* Begin XCBuildConfiguration section */ 190 | 126DFEE01F0BAAD200BBC115 /* Debug */ = { 191 | isa = XCBuildConfiguration; 192 | buildSettings = { 193 | ALWAYS_SEARCH_USER_PATHS = NO; 194 | CLANG_ANALYZER_NONNULL = YES; 195 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 196 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 197 | CLANG_CXX_LIBRARY = "libc++"; 198 | CLANG_ENABLE_MODULES = YES; 199 | CLANG_ENABLE_OBJC_ARC = YES; 200 | CLANG_WARN_BOOL_CONVERSION = YES; 201 | CLANG_WARN_CONSTANT_CONVERSION = YES; 202 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 203 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 204 | CLANG_WARN_EMPTY_BODY = YES; 205 | CLANG_WARN_ENUM_CONVERSION = YES; 206 | CLANG_WARN_INFINITE_RECURSION = YES; 207 | CLANG_WARN_INT_CONVERSION = YES; 208 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 209 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 210 | CLANG_WARN_UNREACHABLE_CODE = YES; 211 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 212 | CODE_SIGN_IDENTITY = "-"; 213 | COPY_PHASE_STRIP = NO; 214 | DEBUG_INFORMATION_FORMAT = dwarf; 215 | ENABLE_STRICT_OBJC_MSGSEND = YES; 216 | ENABLE_TESTABILITY = YES; 217 | GCC_C_LANGUAGE_STANDARD = gnu99; 218 | GCC_DYNAMIC_NO_PIC = NO; 219 | GCC_NO_COMMON_BLOCKS = YES; 220 | GCC_OPTIMIZATION_LEVEL = 0; 221 | GCC_PREPROCESSOR_DEFINITIONS = ( 222 | "DEBUG=1", 223 | "$(inherited)", 224 | ); 225 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 226 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 227 | GCC_WARN_UNDECLARED_SELECTOR = YES; 228 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 229 | GCC_WARN_UNUSED_FUNCTION = YES; 230 | GCC_WARN_UNUSED_VARIABLE = YES; 231 | MACOSX_DEPLOYMENT_TARGET = 10.12; 232 | MTL_ENABLE_DEBUG_INFO = YES; 233 | ONLY_ACTIVE_ARCH = YES; 234 | SDKROOT = macosx; 235 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 236 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 237 | }; 238 | name = Debug; 239 | }; 240 | 126DFEE11F0BAAD200BBC115 /* Release */ = { 241 | isa = XCBuildConfiguration; 242 | buildSettings = { 243 | ALWAYS_SEARCH_USER_PATHS = NO; 244 | CLANG_ANALYZER_NONNULL = YES; 245 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 246 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 247 | CLANG_CXX_LIBRARY = "libc++"; 248 | CLANG_ENABLE_MODULES = YES; 249 | CLANG_ENABLE_OBJC_ARC = YES; 250 | CLANG_WARN_BOOL_CONVERSION = YES; 251 | CLANG_WARN_CONSTANT_CONVERSION = YES; 252 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 253 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 254 | CLANG_WARN_EMPTY_BODY = YES; 255 | CLANG_WARN_ENUM_CONVERSION = YES; 256 | CLANG_WARN_INFINITE_RECURSION = YES; 257 | CLANG_WARN_INT_CONVERSION = YES; 258 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | CODE_SIGN_IDENTITY = "-"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | MACOSX_DEPLOYMENT_TARGET = 10.12; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = macosx; 278 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 279 | }; 280 | name = Release; 281 | }; 282 | 126DFEE31F0BAAD200BBC115 /* Debug */ = { 283 | isa = XCBuildConfiguration; 284 | buildSettings = { 285 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 286 | CLANG_ENABLE_MODULES = YES; 287 | CODE_SIGN_IDENTITY = "Mac Developer"; 288 | COMBINE_HIDPI_IMAGES = YES; 289 | DEVELOPMENT_TEAM = ZX7M3HPXGX; 290 | FRAMEWORK_SEARCH_PATHS = ( 291 | "$(inherited)", 292 | "$(LOCAL_LIBRARY_DIR)/Frameworks", 293 | "$(LOCAL_LIBRARY_DIR)/Frameworks/iTunesLibrary.framework", 294 | ); 295 | INFOPLIST_FILE = "iTunes Graphs/Info.plist"; 296 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 297 | PRODUCT_BUNDLE_IDENTIFIER = "uk.co.zacgarby.iTunes-Graphs"; 298 | PRODUCT_NAME = "$(TARGET_NAME)"; 299 | PROVISIONING_PROFILE_SPECIFIER = ""; 300 | SWIFT_OBJC_BRIDGING_HEADER = "iTunes Graphs/iTunes Graphs-Bridging-Header.h"; 301 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 302 | SWIFT_VERSION = 3.0; 303 | }; 304 | name = Debug; 305 | }; 306 | 126DFEE41F0BAAD200BBC115 /* Release */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 310 | CLANG_ENABLE_MODULES = YES; 311 | CODE_SIGN_IDENTITY = "Mac Developer"; 312 | COMBINE_HIDPI_IMAGES = YES; 313 | DEVELOPMENT_TEAM = ZX7M3HPXGX; 314 | FRAMEWORK_SEARCH_PATHS = ( 315 | "$(inherited)", 316 | "$(LOCAL_LIBRARY_DIR)/Frameworks", 317 | "$(LOCAL_LIBRARY_DIR)/Frameworks/iTunesLibrary.framework", 318 | ); 319 | INFOPLIST_FILE = "iTunes Graphs/Info.plist"; 320 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 321 | PRODUCT_BUNDLE_IDENTIFIER = "uk.co.zacgarby.iTunes-Graphs"; 322 | PRODUCT_NAME = "$(TARGET_NAME)"; 323 | PROVISIONING_PROFILE_SPECIFIER = ""; 324 | SWIFT_OBJC_BRIDGING_HEADER = "iTunes Graphs/iTunes Graphs-Bridging-Header.h"; 325 | SWIFT_VERSION = 3.0; 326 | }; 327 | name = Release; 328 | }; 329 | /* End XCBuildConfiguration section */ 330 | 331 | /* Begin XCConfigurationList section */ 332 | 126DFECE1F0BAAD200BBC115 /* Build configuration list for PBXProject "iTunes Graphs" */ = { 333 | isa = XCConfigurationList; 334 | buildConfigurations = ( 335 | 126DFEE01F0BAAD200BBC115 /* Debug */, 336 | 126DFEE11F0BAAD200BBC115 /* Release */, 337 | ); 338 | defaultConfigurationIsVisible = 0; 339 | defaultConfigurationName = Release; 340 | }; 341 | 126DFEE21F0BAAD200BBC115 /* Build configuration list for PBXNativeTarget "iTunes Graphs" */ = { 342 | isa = XCConfigurationList; 343 | buildConfigurations = ( 344 | 126DFEE31F0BAAD200BBC115 /* Debug */, 345 | 126DFEE41F0BAAD200BBC115 /* Release */, 346 | ); 347 | defaultConfigurationIsVisible = 0; 348 | defaultConfigurationName = Release; 349 | }; 350 | /* End XCConfigurationList section */ 351 | }; 352 | rootObject = 126DFECB1F0BAAD200BBC115 /* Project object */; 353 | } 354 | -------------------------------------------------------------------------------- /iTunes Graphs/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 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 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 406 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | --------------------------------------------------------------------------------