diff --git a/Dependecies/MKRingProgressView/.gitignore b/Dependecies/MKRingProgressView/.gitignore deleted file mode 100644 index 8615121b2..000000000 --- a/Dependecies/MKRingProgressView/.gitignore +++ /dev/null @@ -1,33 +0,0 @@ -# Xcode -# -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/AppDelegate.swift b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/AppDelegate.swift deleted file mode 100644 index 1941d679f..000000000 --- a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/AppDelegate.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// AppDelegate.swift -// MKRingProgressViewExample -// -// Created by Max Konovalov on 20/10/15. -// Copyright © 2015 Max Konovalov. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { - //let icon = generateAppIcon(scale: 2) - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Contents.json b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 98ae57ec1..000000000 --- a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom": "iphone", - "filename" : "Icon-20@2x.png", - "scale": "2x" - }, - { - "size" : "20x20", - "idiom": "iphone", - "filename" : "Icon-20@3x.png", - "scale": "3x" - }, - { - "size" : "20x20", - "idiom": "ipad", - "filename" : "Icon-20.png", - "scale": "1x" - }, - { - "size" : "20x20", - "idiom": "ipad", - "filename" : "Icon-20@2x.png", - "scale": "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-29.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-40.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-1024.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-1024.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-1024.png deleted file mode 100644 index 28d0cf02d..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-1024.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-20.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-20.png deleted file mode 100644 index 8c20aaacd..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-20.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-20@2x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-20@2x.png deleted file mode 100644 index 8c16f9486..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-20@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-20@3x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-20@3x.png deleted file mode 100644 index fe5bf9678..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-20@3x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-29.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-29.png deleted file mode 100644 index 596371365..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-29.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png deleted file mode 100644 index f968f3f83..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png deleted file mode 100644 index 0daf3e9b2..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-40.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-40.png deleted file mode 100644 index 8c16f9486..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-40.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png deleted file mode 100644 index d1bdfb4f1..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png deleted file mode 100644 index b8a3fc233..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png deleted file mode 100644 index b8a3fc233..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png deleted file mode 100644 index c8a7b52b5..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-76.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-76.png deleted file mode 100644 index 90fc67e15..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-76.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png deleted file mode 100644 index 8042ed2e0..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png deleted file mode 100644 index 37ce86b3b..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/Contents.json b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c9..000000000 --- a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon1.imageset/Contents.json b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon1.imageset/Contents.json deleted file mode 100644 index 5218a68fe..000000000 --- a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon1.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "icon1@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "icon1@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon1.imageset/icon1@2x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon1.imageset/icon1@2x.png deleted file mode 100644 index 0f4597782..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon1.imageset/icon1@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon1.imageset/icon1@3x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon1.imageset/icon1@3x.png deleted file mode 100644 index b6b21bdeb..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon1.imageset/icon1@3x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon2.imageset/Contents.json b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon2.imageset/Contents.json deleted file mode 100644 index 7ca1f6be4..000000000 --- a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon2.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "icon2@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "icon2@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon2.imageset/icon2@2x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon2.imageset/icon2@2x.png deleted file mode 100644 index 5ff228518..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon2.imageset/icon2@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon2.imageset/icon2@3x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon2.imageset/icon2@3x.png deleted file mode 100644 index f71d2f73b..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon2.imageset/icon2@3x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon3.imageset/Contents.json b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon3.imageset/Contents.json deleted file mode 100644 index 013b4c5f5..000000000 --- a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon3.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "icon3@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "icon3@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon3.imageset/icon3@2x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon3.imageset/icon3@2x.png deleted file mode 100644 index 2d34e3480..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon3.imageset/icon3@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon3.imageset/icon3@3x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon3.imageset/icon3@3x.png deleted file mode 100644 index 0f71933b5..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/icon3.imageset/icon3@3x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/tab.imageset/Contents.json b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/tab.imageset/Contents.json deleted file mode 100644 index 9434bcf40..000000000 --- a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/tab.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "tab@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "tab@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/tab.imageset/tab@2x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/tab.imageset/tab@2x.png deleted file mode 100644 index d023a4f4a..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/tab.imageset/tab@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/tab.imageset/tab@3x.png b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/tab.imageset/tab@3x.png deleted file mode 100644 index b8f001b75..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Assets.xcassets/tab.imageset/tab@3x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Base.lproj/LaunchScreen.storyboard b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index a8f8faf38..000000000 --- a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Base.lproj/Main.storyboard b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Base.lproj/Main.storyboard deleted file mode 100644 index 965949127..000000000 --- a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Base.lproj/Main.storyboard +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Icon.swift b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Icon.swift deleted file mode 100644 index fcf2b51bc..000000000 --- a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Icon.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Icon.swift -// MKRingProgressViewExample -// -// Created by Max Konovalov on 25/05/2018. -// Copyright © 2018 Max Konovalov. All rights reserved. -// - -import UIKit - -func generateAppIcon(scale: CGFloat = 1.0) -> UIImage { - let size = CGSize(width: 512, height: 512) - let rect = CGRect(origin: .zero, size: size) - - let icon = UIView(frame: rect) - icon.backgroundColor = #colorLiteral(red: 0.1176470588, green: 0.1176470588, blue: 0.1254901961, alpha: 1) - - let group = RingProgressGroupView(frame: icon.bounds.insetBy(dx: 33, dy: 33)) - group.ringWidth = 50 - group.ringSpacing = 10 - group.ring1StartColor = #colorLiteral(red: 0.8823529412, green: 0, blue: 0.07843137255, alpha: 1) - group.ring1EndColor = #colorLiteral(red: 1, green: 0.1960784314, blue: 0.5294117647, alpha: 1) - group.ring2StartColor = #colorLiteral(red: 0.2156862745, green: 0.862745098, blue: 0, alpha: 1) - group.ring2EndColor = #colorLiteral(red: 0.7176470588, green: 1, blue: 0, alpha: 1) - group.ring3StartColor = #colorLiteral(red: 0, green: 0.7294117647, blue: 0.8823529412, alpha: 1) - group.ring3EndColor = #colorLiteral(red: 0, green: 0.9803921569, blue: 0.8156862745, alpha: 1) - group.ring1.progress = 1.0 - group.ring2.progress = 1.0 - group.ring3.progress = 1.0 - icon.addSubview(group) - - UIGraphicsBeginImageContextWithOptions(size, true, scale) - icon.drawHierarchy(in: rect, afterScreenUpdates: true) - let image = UIGraphicsGetImageFromCurrentImageContext()! - UIGraphicsEndImageContext() - - return image -} diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Info.plist b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Info.plist deleted file mode 100644 index a905c2b55..000000000 --- a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - Rings - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UIStatusBarStyle - UIStatusBarStyleLightContent - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/MKRingProgressGroupButton.swift b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/MKRingProgressGroupButton.swift deleted file mode 100644 index 1a42e07aa..000000000 --- a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/MKRingProgressGroupButton.swift +++ /dev/null @@ -1,83 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2015 Max Konovalov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -import UIKit - -class RingProgressGroupButton: UIButton { - - let contentView = RingProgressGroupView() - - let selectionIndicatorView = UIView(frame: CGRect(x: 0, y: 0, width: 20, height: 20)) - - var contentMargin: CGFloat = 2 { - didSet { - setNeedsLayout() - } - } - - override init(frame: CGRect) { - super.init(frame: frame) - setup() - } - - required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - setup() - } - - private func setup() { - selectionIndicatorView.isUserInteractionEnabled = false - selectionIndicatorView.backgroundColor = .clear - selectionIndicatorView.layer.masksToBounds = false - selectionIndicatorView.layer.shadowColor = UIColor.white.cgColor - selectionIndicatorView.layer.shadowOpacity = 1.0 - selectionIndicatorView.layer.shadowRadius = 1.0 - selectionIndicatorView.layer.shadowOffset = CGSize(width: 0, height: 0) - addSubview(selectionIndicatorView) - selectionIndicatorView.isHidden = true - - contentView.isUserInteractionEnabled = false - addSubview(contentView) - } - - override func layoutSubviews() { - super.layoutSubviews() - let size = min(bounds.width, bounds.height) - contentMargin * 2 - contentView.frame = CGRect(x: (bounds.width - size)/2, y: (bounds.height - size)/2, width: size, height: size) - selectionIndicatorView.frame = contentView.frame - selectionIndicatorView.layer.shadowPath = CGPath(__byStroking: UIBezierPath(ovalIn: selectionIndicatorView.bounds.insetBy(dx: -1, dy: -1)).cgPath, transform: nil, lineWidth: 1.0, lineCap: .round, lineJoin: .round, miterLimit: 0) - } - - override var isHighlighted: Bool { - didSet { - contentView.alpha = isHighlighted ? 0.3 : 1.0 - } - } - - override var isSelected: Bool { - didSet { - selectionIndicatorView.isHidden = !isSelected - } - } -} diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/MKRingProgressGroupView.swift b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/MKRingProgressGroupView.swift deleted file mode 100644 index 88494ab3c..000000000 --- a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/MKRingProgressGroupView.swift +++ /dev/null @@ -1,108 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2015 Max Konovalov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -import UIKit -import MKRingProgressView - -@IBDesignable -class RingProgressGroupView: UIView { - - let ring1 = RingProgressView() - let ring2 = RingProgressView() - let ring3 = RingProgressView() - - @IBInspectable var ring1StartColor: UIColor = .red { - didSet { - ring1.startColor = ring1StartColor - } - } - - @IBInspectable var ring1EndColor: UIColor = .blue { - didSet { - ring1.endColor = ring1EndColor - } - } - - @IBInspectable var ring2StartColor: UIColor = .red { - didSet { - ring2.startColor = ring2StartColor - } - } - - @IBInspectable var ring2EndColor: UIColor = .blue { - didSet { - ring2.endColor = ring2EndColor - } - } - - @IBInspectable var ring3StartColor: UIColor = .red { - didSet { - ring3.startColor = ring3StartColor - } - } - - @IBInspectable var ring3EndColor: UIColor = .blue { - didSet { - ring3.endColor = ring3EndColor - } - } - - @IBInspectable var ringWidth: CGFloat = 20 { - didSet { - ring1.ringWidth = ringWidth - ring2.ringWidth = ringWidth - ring3.ringWidth = ringWidth - setNeedsLayout() - } - } - - @IBInspectable var ringSpacing: CGFloat = 2 { - didSet { - setNeedsLayout() - } - } - - override init(frame: CGRect) { - super.init(frame: frame) - setup() - } - - required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - setup() - } - - private func setup() { - addSubview(ring1) - addSubview(ring2) - addSubview(ring3) - } - - override func layoutSubviews() { - super.layoutSubviews() - ring1.frame = bounds - ring2.frame = bounds.insetBy(dx: ringWidth + ringSpacing, dy: ringWidth + ringSpacing) - ring3.frame = bounds.insetBy(dx: 2 * ringWidth + 2 * ringSpacing, dy: 2 * ringWidth + 2 * ringSpacing) - } -} diff --git a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/ViewController.swift b/Dependecies/MKRingProgressView/Example/ActivityRingsExample/ViewController.swift deleted file mode 100644 index 5d86a5ec2..000000000 --- a/Dependecies/MKRingProgressView/Example/ActivityRingsExample/ViewController.swift +++ /dev/null @@ -1,117 +0,0 @@ -// -// ViewController.swift -// MKRingProgressViewExample -// -// Created by Max Konovalov on 20/10/15. -// Copyright © 2015 Max Konovalov. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - @IBOutlet weak var groupContainerView: UIView! - @IBOutlet weak var progressGroup: RingProgressGroupView! - - @IBOutlet weak var iconsHeightConstraint: NSLayoutConstraint! - - var buttons = [RingProgressGroupButton]() - var selectedIndex = 0 - - override func viewDidLoad() { - super.viewDidLoad() - - let containerView = UIView(frame: navigationController!.navigationBar.bounds) - navigationController!.navigationBar.addSubview(containerView) - - // These are optional and only serve to improve accessibility - progressGroup.ring1.accessibilityLabel = NSLocalizedString("Move", comment: "") - progressGroup.ring2.accessibilityLabel = NSLocalizedString("Exercise", comment: "") - progressGroup.ring3.accessibilityLabel = NSLocalizedString("Stand", comment: "") - - let n = 7 - for i in 0.. selectedIndex) ? -self.view.frame.width : self.view.frame.width - - buttons[selectedIndex].isSelected = false - sender.isSelected = true - selectedIndex = newIndex - - UIView.animate(withDuration: 0.2, delay: 0.0, usingSpringWithDamping: 0.9, initialSpringVelocity: 0.0, options: [], animations: { () -> Void in - self.groupContainerView.transform = CGAffineTransform(translationX: dx, y: 0) - }) { (_) -> Void in - self.groupContainerView.transform = CGAffineTransform(translationX: -dx, y: 0) - self.progressGroup.ring1.progress = 0.0 - self.progressGroup.ring2.progress = 0.0 - self.progressGroup.ring3.progress = 0.0 - UIView.animate(withDuration: 0.3, delay: 0.0, usingSpringWithDamping: 0.9, initialSpringVelocity: 0.0, options: [], animations: { () -> Void in - self.groupContainerView.transform = CGAffineTransform.identity - }, completion: { (_) -> Void in - self.updateMainGroupProgress() - }) - } - } - - private func updateButtonsProgress() { - UIView.animate(withDuration: 0.5) { - for button in self.buttons { - button.contentView.ring1.progress = Double(arc4random() % 200) / 100.0 - button.contentView.ring2.progress = Double(arc4random() % 200) / 100.0 - button.contentView.ring3.progress = Double(arc4random() % 200) / 100.0 - } - } - } - - private func updateMainGroupProgress(delay: TimeInterval = 0.0) { - let selectedGroup = buttons[selectedIndex] - UIView.animate(withDuration: 1.0, delay: delay, usingSpringWithDamping: 1.0, initialSpringVelocity: 0.0, options: [], animations: { - self.progressGroup.ring1.progress = selectedGroup.contentView.ring1.progress - self.progressGroup.ring2.progress = selectedGroup.contentView.ring2.progress - self.progressGroup.ring3.progress = selectedGroup.contentView.ring3.progress - }, completion: nil) - } - - @IBAction func randomize(_ sender: AnyObject? = nil) { - updateButtonsProgress() - updateMainGroupProgress() - } - -} diff --git a/Dependecies/MKRingProgressView/Example/MKRingProgressViewExample.xcodeproj/project.pbxproj b/Dependecies/MKRingProgressView/Example/MKRingProgressViewExample.xcodeproj/project.pbxproj deleted file mode 100644 index 36ba58d42..000000000 --- a/Dependecies/MKRingProgressView/Example/MKRingProgressViewExample.xcodeproj/project.pbxproj +++ /dev/null @@ -1,587 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 5022C19720B803AB0068B650 /* Icon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5022C19620B803AB0068B650 /* Icon.swift */; }; - 50246419217CCA2B00454379 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50246418217CCA2B00454379 /* AppDelegate.swift */; }; - 5024641B217CCA2B00454379 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5024641A217CCA2B00454379 /* ViewController.swift */; }; - 5024641E217CCA2B00454379 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5024641C217CCA2B00454379 /* Main.storyboard */; }; - 50246420217CCA2B00454379 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5024641F217CCA2B00454379 /* Assets.xcassets */; }; - 50246423217CCA2B00454379 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 50246421217CCA2B00454379 /* LaunchScreen.storyboard */; }; - 50246428217CCB1000454379 /* MKRingProgressView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5025B8911E52FF5D0018FA7D /* MKRingProgressView.framework */; }; - 50246429217CCB1000454379 /* MKRingProgressView.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5025B8911E52FF5D0018FA7D /* MKRingProgressView.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 5025B8921E52FF6F0018FA7D /* MKRingProgressView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5025B8911E52FF5D0018FA7D /* MKRingProgressView.framework */; }; - 5025B8941E52FFC90018FA7D /* MKRingProgressView.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5025B8911E52FF5D0018FA7D /* MKRingProgressView.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 507AB38C217E231800D87320 /* ParametersViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 507AB38B217E231800D87320 /* ParametersViewController.swift */; }; - 507AB38F217E2A2600D87320 /* Icon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 507AB38E217E2A2600D87320 /* Icon.swift */; }; - 508CBF7B1BD6C2C7008A3B4E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 508CBF7A1BD6C2C7008A3B4E /* AppDelegate.swift */; }; - 508CBF7D1BD6C2C7008A3B4E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 508CBF7C1BD6C2C7008A3B4E /* ViewController.swift */; }; - 508CBF801BD6C2C7008A3B4E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 508CBF7E1BD6C2C7008A3B4E /* Main.storyboard */; }; - 508CBF821BD6C2C7008A3B4E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 508CBF811BD6C2C7008A3B4E /* Assets.xcassets */; }; - 508CBF851BD6C2C7008A3B4E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 508CBF831BD6C2C7008A3B4E /* LaunchScreen.storyboard */; }; - 508CBF921BD6CA0C008A3B4E /* MKRingProgressGroupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 508CBF911BD6CA0C008A3B4E /* MKRingProgressGroupView.swift */; }; - 508CBF951BD6DBC2008A3B4E /* MKRingProgressGroupButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 508CBF941BD6DBC2008A3B4E /* MKRingProgressGroupButton.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 5025B8901E52FF5D0018FA7D /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 5025B88C1E52FF5D0018FA7D /* MKRingProgressView.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 5085266E1E52FDC000D611F4; - remoteInfo = MKRingProgressView; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 5024642C217CCB1000454379 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 50246429217CCB1000454379 /* MKRingProgressView.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; - 5025B8971E52FFC90018FA7D /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 5025B8941E52FFC90018FA7D /* MKRingProgressView.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 5022C19620B803AB0068B650 /* Icon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Icon.swift; sourceTree = ""; }; - 50246416217CCA2A00454379 /* ProgressRingExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ProgressRingExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 50246418217CCA2B00454379 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 5024641A217CCA2B00454379 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 5024641D217CCA2B00454379 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 5024641F217CCA2B00454379 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 50246422217CCA2B00454379 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 50246424217CCA2B00454379 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 5025B88C1E52FF5D0018FA7D /* MKRingProgressView.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MKRingProgressView.xcodeproj; path = ../MKRingProgressView.xcodeproj; sourceTree = ""; }; - 507AB38B217E231800D87320 /* ParametersViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParametersViewController.swift; sourceTree = ""; }; - 507AB38E217E2A2600D87320 /* Icon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Icon.swift; sourceTree = ""; }; - 508CBF771BD6C2C7008A3B4E /* ActivityRingsExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ActivityRingsExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 508CBF7A1BD6C2C7008A3B4E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 508CBF7C1BD6C2C7008A3B4E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 508CBF7F1BD6C2C7008A3B4E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 508CBF811BD6C2C7008A3B4E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 508CBF841BD6C2C7008A3B4E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 508CBF861BD6C2C7008A3B4E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 508CBF911BD6CA0C008A3B4E /* MKRingProgressGroupView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MKRingProgressGroupView.swift; sourceTree = ""; }; - 508CBF941BD6DBC2008A3B4E /* MKRingProgressGroupButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MKRingProgressGroupButton.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 50246413217CCA2A00454379 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 50246428217CCB1000454379 /* MKRingProgressView.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 508CBF741BD6C2C7008A3B4E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 5025B8921E52FF6F0018FA7D /* MKRingProgressView.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 50246417217CCA2B00454379 /* ProgressRingExample */ = { - isa = PBXGroup; - children = ( - 50246418217CCA2B00454379 /* AppDelegate.swift */, - 507AB38E217E2A2600D87320 /* Icon.swift */, - 5024641A217CCA2B00454379 /* ViewController.swift */, - 507AB38B217E231800D87320 /* ParametersViewController.swift */, - 5024641C217CCA2B00454379 /* Main.storyboard */, - 50246421217CCA2B00454379 /* LaunchScreen.storyboard */, - 5024641F217CCA2B00454379 /* Assets.xcassets */, - 50246424217CCA2B00454379 /* Info.plist */, - ); - path = ProgressRingExample; - sourceTree = ""; - }; - 5025B88D1E52FF5D0018FA7D /* Products */ = { - isa = PBXGroup; - children = ( - 5025B8911E52FF5D0018FA7D /* MKRingProgressView.framework */, - ); - name = Products; - sourceTree = ""; - }; - 508CBF6E1BD6C2C7008A3B4E = { - isa = PBXGroup; - children = ( - 5025B88C1E52FF5D0018FA7D /* MKRingProgressView.xcodeproj */, - 508CBF791BD6C2C7008A3B4E /* ActivityRingsExample */, - 50246417217CCA2B00454379 /* ProgressRingExample */, - 508CBF781BD6C2C7008A3B4E /* Products */, - ); - sourceTree = ""; - }; - 508CBF781BD6C2C7008A3B4E /* Products */ = { - isa = PBXGroup; - children = ( - 508CBF771BD6C2C7008A3B4E /* ActivityRingsExample.app */, - 50246416217CCA2A00454379 /* ProgressRingExample.app */, - ); - name = Products; - sourceTree = ""; - }; - 508CBF791BD6C2C7008A3B4E /* ActivityRingsExample */ = { - isa = PBXGroup; - children = ( - 50DEDC431BD7811E009C3882 /* MKRingProgressGroup */, - 508CBF7A1BD6C2C7008A3B4E /* AppDelegate.swift */, - 5022C19620B803AB0068B650 /* Icon.swift */, - 508CBF7C1BD6C2C7008A3B4E /* ViewController.swift */, - 508CBF7E1BD6C2C7008A3B4E /* Main.storyboard */, - 508CBF831BD6C2C7008A3B4E /* LaunchScreen.storyboard */, - 508CBF811BD6C2C7008A3B4E /* Assets.xcassets */, - 508CBF861BD6C2C7008A3B4E /* Info.plist */, - ); - path = ActivityRingsExample; - sourceTree = ""; - }; - 50DEDC431BD7811E009C3882 /* MKRingProgressGroup */ = { - isa = PBXGroup; - children = ( - 508CBF911BD6CA0C008A3B4E /* MKRingProgressGroupView.swift */, - 508CBF941BD6DBC2008A3B4E /* MKRingProgressGroupButton.swift */, - ); - name = MKRingProgressGroup; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 50246415217CCA2A00454379 /* ProgressRingExample */ = { - isa = PBXNativeTarget; - buildConfigurationList = 50246425217CCA2B00454379 /* Build configuration list for PBXNativeTarget "ProgressRingExample" */; - buildPhases = ( - 50246412217CCA2A00454379 /* Sources */, - 50246413217CCA2A00454379 /* Frameworks */, - 50246414217CCA2A00454379 /* Resources */, - 5024642C217CCB1000454379 /* Embed Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ProgressRingExample; - productName = RingProgressExample; - productReference = 50246416217CCA2A00454379 /* ProgressRingExample.app */; - productType = "com.apple.product-type.application"; - }; - 508CBF761BD6C2C7008A3B4E /* ActivityRingsExample */ = { - isa = PBXNativeTarget; - buildConfigurationList = 508CBF891BD6C2C7008A3B4E /* Build configuration list for PBXNativeTarget "ActivityRingsExample" */; - buildPhases = ( - 508CBF731BD6C2C7008A3B4E /* Sources */, - 508CBF741BD6C2C7008A3B4E /* Frameworks */, - 508CBF751BD6C2C7008A3B4E /* Resources */, - 5025B8971E52FFC90018FA7D /* Embed Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ActivityRingsExample; - productName = MKRingProgressViewExample; - productReference = 508CBF771BD6C2C7008A3B4E /* ActivityRingsExample.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 508CBF6F1BD6C2C7008A3B4E /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 1000; - LastUpgradeCheck = 1020; - ORGANIZATIONNAME = "Max Konovalov"; - TargetAttributes = { - 50246415217CCA2A00454379 = { - CreatedOnToolsVersion = 10.0; - ProvisioningStyle = Manual; - }; - 508CBF761BD6C2C7008A3B4E = { - CreatedOnToolsVersion = 7.0.1; - LastSwiftMigration = 0930; - ProvisioningStyle = Manual; - }; - }; - }; - buildConfigurationList = 508CBF721BD6C2C7008A3B4E /* Build configuration list for PBXProject "MKRingProgressViewExample" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 508CBF6E1BD6C2C7008A3B4E; - productRefGroup = 508CBF781BD6C2C7008A3B4E /* Products */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 5025B88D1E52FF5D0018FA7D /* Products */; - ProjectRef = 5025B88C1E52FF5D0018FA7D /* MKRingProgressView.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 508CBF761BD6C2C7008A3B4E /* ActivityRingsExample */, - 50246415217CCA2A00454379 /* ProgressRingExample */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 5025B8911E52FF5D0018FA7D /* MKRingProgressView.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = MKRingProgressView.framework; - remoteRef = 5025B8901E52FF5D0018FA7D /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 50246414217CCA2A00454379 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 50246423217CCA2B00454379 /* LaunchScreen.storyboard in Resources */, - 50246420217CCA2B00454379 /* Assets.xcassets in Resources */, - 5024641E217CCA2B00454379 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 508CBF751BD6C2C7008A3B4E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 508CBF851BD6C2C7008A3B4E /* LaunchScreen.storyboard in Resources */, - 508CBF821BD6C2C7008A3B4E /* Assets.xcassets in Resources */, - 508CBF801BD6C2C7008A3B4E /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 50246412217CCA2A00454379 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 5024641B217CCA2B00454379 /* ViewController.swift in Sources */, - 507AB38C217E231800D87320 /* ParametersViewController.swift in Sources */, - 507AB38F217E2A2600D87320 /* Icon.swift in Sources */, - 50246419217CCA2B00454379 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 508CBF731BD6C2C7008A3B4E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 508CBF7D1BD6C2C7008A3B4E /* ViewController.swift in Sources */, - 508CBF7B1BD6C2C7008A3B4E /* AppDelegate.swift in Sources */, - 508CBF951BD6DBC2008A3B4E /* MKRingProgressGroupButton.swift in Sources */, - 5022C19720B803AB0068B650 /* Icon.swift in Sources */, - 508CBF921BD6CA0C008A3B4E /* MKRingProgressGroupView.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 5024641C217CCA2B00454379 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 5024641D217CCA2B00454379 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 50246421217CCA2B00454379 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 50246422217CCA2B00454379 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; - 508CBF7E1BD6C2C7008A3B4E /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 508CBF7F1BD6C2C7008A3B4E /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 508CBF831BD6C2C7008A3B4E /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 508CBF841BD6C2C7008A3B4E /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 50246426217CCA2B00454379 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = ""; - GCC_C_LANGUAGE_STANDARD = gnu11; - INFOPLIST_FILE = "$(SRCROOT)/ProgressRingExample/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.maxkonovalov.ProgressRingExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 50246427217CCA2B00454379 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = ""; - GCC_C_LANGUAGE_STANDARD = gnu11; - INFOPLIST_FILE = "$(SRCROOT)/ProgressRingExample/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.maxkonovalov.ProgressRingExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 508CBF871BD6C2C7008A3B4E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.2; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 508CBF881BD6C2C7008A3B4E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.2; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 508CBF8A1BD6C2C7008A3B4E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = "$(SRCROOT)/ActivityRingsExample/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.maxkonovalov.ActivityRingsExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_COMPILATION_MODE = singlefile; - }; - name = Debug; - }; - 508CBF8B1BD6C2C7008A3B4E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = "$(SRCROOT)/ActivityRingsExample/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.maxkonovalov.ActivityRingsExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 50246425217CCA2B00454379 /* Build configuration list for PBXNativeTarget "ProgressRingExample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 50246426217CCA2B00454379 /* Debug */, - 50246427217CCA2B00454379 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 508CBF721BD6C2C7008A3B4E /* Build configuration list for PBXProject "MKRingProgressViewExample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 508CBF871BD6C2C7008A3B4E /* Debug */, - 508CBF881BD6C2C7008A3B4E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 508CBF891BD6C2C7008A3B4E /* Build configuration list for PBXNativeTarget "ActivityRingsExample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 508CBF8A1BD6C2C7008A3B4E /* Debug */, - 508CBF8B1BD6C2C7008A3B4E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 508CBF6F1BD6C2C7008A3B4E /* Project object */; -} diff --git a/Dependecies/MKRingProgressView/Example/MKRingProgressViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Dependecies/MKRingProgressView/Example/MKRingProgressViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 371651bf2..000000000 --- a/Dependecies/MKRingProgressView/Example/MKRingProgressViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Dependecies/MKRingProgressView/Example/MKRingProgressViewExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Dependecies/MKRingProgressView/Example/MKRingProgressViewExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003..000000000 --- a/Dependecies/MKRingProgressView/Example/MKRingProgressViewExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/AppDelegate.swift b/Dependecies/MKRingProgressView/Example/ProgressRingExample/AppDelegate.swift deleted file mode 100644 index 9e2280185..000000000 --- a/Dependecies/MKRingProgressView/Example/ProgressRingExample/AppDelegate.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// AppDelegate.swift -// RingProgressExample -// -// Created by Max Konovalov on 21/10/2018. -// Copyright © 2018 Max Konovalov. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - //let icon = generateAppIcon(scale: 2) - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Contents.json b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 98ae57ec1..000000000 --- a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom": "iphone", - "filename" : "Icon-20@2x.png", - "scale": "2x" - }, - { - "size" : "20x20", - "idiom": "iphone", - "filename" : "Icon-20@3x.png", - "scale": "3x" - }, - { - "size" : "20x20", - "idiom": "ipad", - "filename" : "Icon-20.png", - "scale": "1x" - }, - { - "size" : "20x20", - "idiom": "ipad", - "filename" : "Icon-20@2x.png", - "scale": "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-29.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-40.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-1024.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-1024.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-1024.png deleted file mode 100644 index 374a3f02e..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-1024.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-20.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-20.png deleted file mode 100644 index e5cef17a2..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-20.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-20@2x.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-20@2x.png deleted file mode 100644 index 92715c43f..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-20@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-20@3x.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-20@3x.png deleted file mode 100644 index c09c10e5d..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-20@3x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-29.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-29.png deleted file mode 100644 index e1cac0beb..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-29.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png deleted file mode 100644 index fe8e04698..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png deleted file mode 100644 index c7c20c935..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-40.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-40.png deleted file mode 100644 index 92715c43f..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-40.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png deleted file mode 100644 index 8d9faf15f..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png deleted file mode 100644 index 4887a8bef..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png deleted file mode 100644 index 4887a8bef..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png deleted file mode 100644 index ce988aefc..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-76.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-76.png deleted file mode 100644 index 819156f1d..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-76.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png deleted file mode 100644 index ff069a262..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png deleted file mode 100644 index 4b9ca75b1..000000000 Binary files a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/Contents.json b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c9..000000000 --- a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Base.lproj/LaunchScreen.storyboard b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 9362cb623..000000000 --- a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Base.lproj/Main.storyboard b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Base.lproj/Main.storyboard deleted file mode 100644 index 3cbbc0fc7..000000000 --- a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Base.lproj/Main.storyboard +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Icon.swift b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Icon.swift deleted file mode 100644 index 0ee6a784f..000000000 --- a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Icon.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// Icon.swift -// ProgressRingExample -// -// Created by Max Konovalov on 22/10/2018. -// Copyright © 2018 Max Konovalov. All rights reserved. -// - -import UIKit -import MKRingProgressView - -func generateAppIcon(scale: CGFloat = 1.0) -> UIImage { - let size = CGSize(width: 512, height: 512) - let rect = CGRect(origin: .zero, size: size) - - let icon = UIView(frame: rect) - icon.backgroundColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1) - - let ring = RingProgressView(frame: icon.bounds.insetBy(dx: 66, dy: 66)) - ring.ringWidth = 93 - ring.startColor = #colorLiteral(red: 1, green: 0.07450980392, blue: 0.3254901961, alpha: 1) - ring.endColor = #colorLiteral(red: 0, green: 0.4784313725, blue: 1, alpha: 1) - ring.progress = 1.0 - icon.addSubview(ring) - - UIGraphicsBeginImageContextWithOptions(size, true, scale) - icon.drawHierarchy(in: rect, afterScreenUpdates: true) - let image = UIGraphicsGetImageFromCurrentImageContext()! - UIGraphicsEndImageContext() - - return image -} diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Info.plist b/Dependecies/MKRingProgressView/Example/ProgressRingExample/Info.plist deleted file mode 100644 index cc1fdac00..000000000 --- a/Dependecies/MKRingProgressView/Example/ProgressRingExample/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Ring - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/ParametersViewController.swift b/Dependecies/MKRingProgressView/Example/ProgressRingExample/ParametersViewController.swift deleted file mode 100644 index 4f78aee35..000000000 --- a/Dependecies/MKRingProgressView/Example/ProgressRingExample/ParametersViewController.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// ParametersViewController.swift -// ProgressRingExample -// -// Created by Max Konovalov on 22/10/2018. -// Copyright © 2018 Max Konovalov. All rights reserved. -// - -import MKRingProgressView -import UIKit - -protocol ParametersViewControllerDelegate: class { - func parametersViewControllerDidChangeProgress(_ progress: Double) - func parametersViewControllerDidChangeStyle(_ style: RingProgressViewStyle) - func parametersViewControllerDidChangeShadowOpacity(_ shadowOpacity: CGFloat) - func parametersViewControllerDidChangeHidesRingForZeroProgressValue(_ hidesRingForZeroProgress: Bool) -} - -class ParametersViewController: UITableViewController { - weak var delegate: ParametersViewControllerDelegate? - - override func viewDidLoad() { - super.viewDidLoad() - tableView.tableFooterView = UIView() - } - - @IBAction func progressChanged(_ sender: UISlider) { - let progress = Double(sender.value) - delegate?.parametersViewControllerDidChangeProgress(progress) - } - - @IBAction func styleChanged(_ sender: UISegmentedControl) { - guard let style = RingProgressViewStyle(rawValue: sender.selectedSegmentIndex) else { - return - } - delegate?.parametersViewControllerDidChangeStyle(style) - } - - @IBAction func shadowChanged(_ sender: UISwitch) { - let shadowOpacity: CGFloat = sender.isOn ? 1.0 : 0.0 - delegate?.parametersViewControllerDidChangeShadowOpacity(shadowOpacity) - } - - @IBAction func hidesRingForZeroProgressChanged(_ sender: UISwitch) { - let hidesRingForZeroProgress = sender.isOn - delegate?.parametersViewControllerDidChangeHidesRingForZeroProgressValue(hidesRingForZeroProgress) - } -} diff --git a/Dependecies/MKRingProgressView/Example/ProgressRingExample/ViewController.swift b/Dependecies/MKRingProgressView/Example/ProgressRingExample/ViewController.swift deleted file mode 100644 index 45a0e7ff0..000000000 --- a/Dependecies/MKRingProgressView/Example/ProgressRingExample/ViewController.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// ViewController.swift -// RingProgressExample -// -// Created by Max Konovalov on 21/10/2018. -// Copyright © 2018 Max Konovalov. All rights reserved. -// - -import MKRingProgressView -import UIKit - -class ViewController: UIViewController { - @IBOutlet var ringProgressView: RingProgressView! - @IBOutlet var valueLabel: UILabel! - - override func viewDidLayoutSubviews() { - super.viewDidLayoutSubviews() - ringProgressView.ringWidth = ringProgressView.bounds.width * 0.2 - } - - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - if case let parametersViewController as ParametersViewController = segue.destination { - parametersViewController.delegate = self - } - } -} - -extension ViewController: ParametersViewControllerDelegate { - func parametersViewControllerDidChangeProgress(_ progress: Double) { - ringProgressView.progress = progress - valueLabel.text = String(format: "%.2f", progress) - } - - func parametersViewControllerDidChangeStyle(_ style: RingProgressViewStyle) { - ringProgressView.style = style - } - - func parametersViewControllerDidChangeShadowOpacity(_ shadowOpacity: CGFloat) { - ringProgressView.shadowOpacity = shadowOpacity - } - - func parametersViewControllerDidChangeHidesRingForZeroProgressValue(_ hidesRingForZeroProgress: Bool) { - ringProgressView.hidesRingForZeroProgress = hidesRingForZeroProgress - } -} diff --git a/Dependecies/MKRingProgressView/LICENSE b/Dependecies/MKRingProgressView/LICENSE deleted file mode 100644 index 8f030dd59..000000000 --- a/Dependecies/MKRingProgressView/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Max Konovalov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/Dependecies/MKRingProgressView/MKRingProgressView.png b/Dependecies/MKRingProgressView/MKRingProgressView.png deleted file mode 100644 index 859fef0d5..000000000 Binary files a/Dependecies/MKRingProgressView/MKRingProgressView.png and /dev/null differ diff --git a/Dependecies/MKRingProgressView/MKRingProgressView.podspec b/Dependecies/MKRingProgressView/MKRingProgressView.podspec deleted file mode 100644 index 013a61438..000000000 --- a/Dependecies/MKRingProgressView/MKRingProgressView.podspec +++ /dev/null @@ -1,19 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'MKRingProgressView' - s.version = '2.2.2' - s.summary = 'Ring progress view similar to Activity app on Apple Watch' - s.homepage = 'https://github.com/maxkonovalov/MKRingProgressView' - s.license = 'MIT' - s.author = 'Max Konovalov' - s.source = { git: 'https://github.com/maxkonovalov/MKRingProgressView.git', tag: s.version.to_s } - - s.source_files = 'MKRingProgressView/**/*.swift' - - s.ios.deployment_target = '8.2' - s.tvos.deployment_target = '9.0' - - s.swift_version = '5.0' - s.swift_versions = ['4.0', '4.2', '5.0'] - - s.frameworks = 'UIKit' -end diff --git a/Dependecies/MKRingProgressView/MKRingProgressView.xcodeproj/project.pbxproj b/Dependecies/MKRingProgressView/MKRingProgressView.xcodeproj/project.pbxproj deleted file mode 100644 index 8b92158fc..000000000 --- a/Dependecies/MKRingProgressView/MKRingProgressView.xcodeproj/project.pbxproj +++ /dev/null @@ -1,342 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 5022C19A20B872EA0068B650 /* MKRingProgressLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5022C19920B872EA0068B650 /* MKRingProgressLayer.swift */; }; - 508526731E52FDC000D611F4 /* MKRingProgressView.h in Headers */ = {isa = PBXBuildFile; fileRef = 508526711E52FDC000D611F4 /* MKRingProgressView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5085267B1E52FE7800D611F4 /* MKGradientGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 508526791E52FE7800D611F4 /* MKGradientGenerator.swift */; }; - 5085267C1E52FE7800D611F4 /* MKRingProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5085267A1E52FE7800D611F4 /* MKRingProgressView.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 5022C19920B872EA0068B650 /* MKRingProgressLayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MKRingProgressLayer.swift; sourceTree = ""; }; - 5085266E1E52FDC000D611F4 /* MKRingProgressView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MKRingProgressView.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 508526711E52FDC000D611F4 /* MKRingProgressView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MKRingProgressView.h; sourceTree = ""; }; - 508526721E52FDC000D611F4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 508526791E52FE7800D611F4 /* MKGradientGenerator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MKGradientGenerator.swift; sourceTree = ""; }; - 5085267A1E52FE7800D611F4 /* MKRingProgressView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MKRingProgressView.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 5085266A1E52FDC000D611F4 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 508526641E52FDC000D611F4 = { - isa = PBXGroup; - children = ( - 508526701E52FDC000D611F4 /* MKRingProgressView */, - 5085266F1E52FDC000D611F4 /* Products */, - ); - sourceTree = ""; - }; - 5085266F1E52FDC000D611F4 /* Products */ = { - isa = PBXGroup; - children = ( - 5085266E1E52FDC000D611F4 /* MKRingProgressView.framework */, - ); - name = Products; - sourceTree = ""; - }; - 508526701E52FDC000D611F4 /* MKRingProgressView */ = { - isa = PBXGroup; - children = ( - 508526711E52FDC000D611F4 /* MKRingProgressView.h */, - 508526791E52FE7800D611F4 /* MKGradientGenerator.swift */, - 5022C19920B872EA0068B650 /* MKRingProgressLayer.swift */, - 5085267A1E52FE7800D611F4 /* MKRingProgressView.swift */, - 508526721E52FDC000D611F4 /* Info.plist */, - ); - path = MKRingProgressView; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 5085266B1E52FDC000D611F4 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 508526731E52FDC000D611F4 /* MKRingProgressView.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 5085266D1E52FDC000D611F4 /* MKRingProgressView */ = { - isa = PBXNativeTarget; - buildConfigurationList = 508526761E52FDC000D611F4 /* Build configuration list for PBXNativeTarget "MKRingProgressView" */; - buildPhases = ( - 508526691E52FDC000D611F4 /* Sources */, - 5085266A1E52FDC000D611F4 /* Frameworks */, - 5085266B1E52FDC000D611F4 /* Headers */, - 5085266C1E52FDC000D611F4 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = MKRingProgressView; - productName = MKRingProgressView; - productReference = 5085266E1E52FDC000D611F4 /* MKRingProgressView.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 508526651E52FDC000D611F4 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1240; - ORGANIZATIONNAME = "Max Konovalov"; - TargetAttributes = { - 5085266D1E52FDC000D611F4 = { - CreatedOnToolsVersion = 8.2.1; - LastSwiftMigration = 1020; - ProvisioningStyle = Manual; - }; - }; - }; - buildConfigurationList = 508526681E52FDC000D611F4 /* Build configuration list for PBXProject "MKRingProgressView" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 508526641E52FDC000D611F4; - productRefGroup = 5085266F1E52FDC000D611F4 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5085266D1E52FDC000D611F4 /* MKRingProgressView */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 5085266C1E52FDC000D611F4 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 508526691E52FDC000D611F4 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 5085267B1E52FE7800D611F4 /* MKGradientGenerator.swift in Sources */, - 5022C19A20B872EA0068B650 /* MKRingProgressLayer.swift in Sources */, - 5085267C1E52FE7800D611F4 /* MKRingProgressView.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 508526741E52FDC000D611F4 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 12.0; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 508526751E52FDC000D611F4 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 12.0; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 508526771E52FDC000D611F4 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; - DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = MKRingProgressView/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.maxkonovalov.MKRingProgressView; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 508526781E52FDC000D611F4 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; - DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = MKRingProgressView/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.maxkonovalov.MKRingProgressView; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 508526681E52FDC000D611F4 /* Build configuration list for PBXProject "MKRingProgressView" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 508526741E52FDC000D611F4 /* Debug */, - 508526751E52FDC000D611F4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 508526761E52FDC000D611F4 /* Build configuration list for PBXNativeTarget "MKRingProgressView" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 508526771E52FDC000D611F4 /* Debug */, - 508526781E52FDC000D611F4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 508526651E52FDC000D611F4 /* Project object */; -} diff --git a/Dependecies/MKRingProgressView/MKRingProgressView.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Dependecies/MKRingProgressView/MKRingProgressView.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 24780a9c2..000000000 --- a/Dependecies/MKRingProgressView/MKRingProgressView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Dependecies/MKRingProgressView/MKRingProgressView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Dependecies/MKRingProgressView/MKRingProgressView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003..000000000 --- a/Dependecies/MKRingProgressView/MKRingProgressView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/Dependecies/MKRingProgressView/MKRingProgressView.xcodeproj/xcshareddata/xcschemes/MKRingProgressView.xcscheme b/Dependecies/MKRingProgressView/MKRingProgressView.xcodeproj/xcshareddata/xcschemes/MKRingProgressView.xcscheme deleted file mode 100644 index 6de085895..000000000 --- a/Dependecies/MKRingProgressView/MKRingProgressView.xcodeproj/xcshareddata/xcschemes/MKRingProgressView.xcscheme +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Dependecies/MKRingProgressView/MKRingProgressView/Info.plist b/Dependecies/MKRingProgressView/MKRingProgressView/Info.plist deleted file mode 100644 index fbe1e6b31..000000000 --- a/Dependecies/MKRingProgressView/MKRingProgressView/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/Dependecies/MKRingProgressView/MKRingProgressView/MKGradientGenerator.swift b/Dependecies/MKRingProgressView/MKRingProgressView/MKGradientGenerator.swift deleted file mode 100644 index 21e90c993..000000000 --- a/Dependecies/MKRingProgressView/MKRingProgressView/MKGradientGenerator.swift +++ /dev/null @@ -1,223 +0,0 @@ -/* - The MIT License (MIT) - - Copyright (c) 2015 Max Konovalov - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - */ - -import UIKit - -internal final class GradientGenerator { - - var scale: CGFloat = UIScreen.main.scale { - didSet { - if scale != oldValue { - reset() - } - } - } - - var size: CGSize = .zero { - didSet { - if size != oldValue { - reset() - } - } - } - - var colors: [CGColor] = [] { - didSet { - if colors != oldValue { - reset() - } - } - } - - var locations: [Float] = [] { - didSet { - if locations != oldValue { - reset() - } - } - } - - var startPoint: CGPoint = CGPoint(x: 0.5, y: 0.5) { - didSet { - if startPoint != oldValue { - reset() - } - } - } - - var endPoint: CGPoint = CGPoint(x: 1.0, y: 0.5) { - didSet { - if endPoint != oldValue { - reset() - } - } - } - - private var generatedImage: CGImage? - - func reset() { - generatedImage = nil - } - - func image() -> CGImage { - if let image = generatedImage { - return image - } - - let w = Int(size.width * scale) - let h = Int(size.height * scale) - let bitsPerComponent: Int = MemoryLayout.size * 8 - let bytesPerPixel: Int = bitsPerComponent * 4 / 8 - - var data = [ARGB]() - - for y in 0.. ARGB { - let t = conicalGradientStop(point, size, startPoint, endPoint) - return interpolatedColor(t, colors, locations) - } - - private func conicalGradientStop(_ point: CGPoint, _ size: CGSize, _ g0: CGPoint, _ g1: CGPoint) -> Float { - let c = CGPoint(x: size.width * g0.x, y: size.height * g0.y) - let s = CGPoint(x: size.width * (g1.x - g0.x), y: size.height * (g1.y - g0.y)) - let q = atan2(s.y, s.x) - let p = CGPoint(x: point.x - c.x, y: point.y - c.y) - var a = atan2(p.y, p.x) - q - if a < 0 { - a += 2 * .pi - } - let t = a / (2 * .pi) - return Float(t) - } - - private func interpolatedColor(_ t: Float, _ colors: [CGColor], _ locations: [Float]) -> ARGB { - assert(!colors.isEmpty) - assert(colors.count == locations.count) - - var p0: Float = 0 - var p1: Float = 1 - - var c0 = colors.first! - var c1 = colors.last! - - for (i, v) in locations.enumerated() { - if v > p0 && t >= v { - p0 = v - c0 = colors[i] - } - if v < p1 && t <= v { - p1 = v - c1 = colors[i] - } - } - - let p: Float - if p0 == p1 { - p = 0 - } else { - p = lerp(t, inRange: p0...p1, outRange: 0...1) - } - - let color0 = ARGB(c0) - let color1 = ARGB(c1) - - return color0.interpolateTo(color1, p) - } - -} - -// MARK: - Color Data - -fileprivate struct ARGB { - let a: UInt8 = 0xff - var r: UInt8 - var g: UInt8 - var b: UInt8 -} - -extension ARGB: Equatable { - static func ==(lhs: ARGB, rhs: ARGB) -> Bool { - return (lhs.r == rhs.r && lhs.g == rhs.g && lhs.b == rhs.b) - } -} - -extension ARGB { - - init(_ color: CGColor) { - let c = color.components?.map { min(max($0, 0.0), 1.0) } - switch color.numberOfComponents { - case 2: - self.init(r: UInt8((c?[0])! * 0xff), g: UInt8((c?[0])! * 0xff), b: UInt8((c?[0])! * 0xff)) - case 4: - self.init(r: UInt8((c?[0])! * 0xff), g: UInt8((c?[1])! * 0xff), b: UInt8((c?[2])! * 0xff)) - default: - self.init(r: 0, g: 0, b: 0) - } - } - - func interpolateTo(_ color: ARGB, _ t: Float) -> ARGB { - let r = lerp(t, self.r, color.r) - let g = lerp(t, self.g, color.g) - let b = lerp(t, self.b, color.b) - return ARGB(r: r, g: g, b: b) - } - -} - -// MARK: - Utility - -fileprivate func lerp(_ t: Float, _ a: UInt8, _ b: UInt8) -> UInt8 { - return UInt8(Float(a) + min(max(t, 0), 1) * (Float(b) - Float(a))) -} - -fileprivate func lerp(_ value: Float, inRange: ClosedRange, outRange: ClosedRange) -> Float { - return (value - inRange.lowerBound) * (outRange.upperBound - outRange.lowerBound) / (inRange.upperBound - inRange.lowerBound) + outRange.lowerBound -} diff --git a/Dependecies/MKRingProgressView/MKRingProgressView/MKRingProgressLayer.swift b/Dependecies/MKRingProgressView/MKRingProgressView/MKRingProgressLayer.swift deleted file mode 100644 index f379a95fa..000000000 --- a/Dependecies/MKRingProgressView/MKRingProgressView/MKRingProgressLayer.swift +++ /dev/null @@ -1,327 +0,0 @@ -/* - The MIT License (MIT) - - Copyright (c) 2015 Max Konovalov - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - */ - -import UIKit - -@objc(MKRingProgressLayer) -open class RingProgressLayer: CALayer { - /// The progress ring start color. - @objc open var startColor: CGColor = UIColor.red.cgColor { - didSet { - setNeedsDisplay() - } - } - - /// The progress ring end color. - @objc open var endColor: CGColor = UIColor.blue.cgColor { - didSet { - setNeedsDisplay() - } - } - - /// The color of the background ring. - @objc open var backgroundRingColor: CGColor? { - didSet { - setNeedsDisplay() - } - } - - /// The width of the progress ring. - @objc open var ringWidth: CGFloat = 20 { - didSet { - setNeedsDisplay() - } - } - - /// The style of the progress line end (rounded or straight). - @objc open var progressStyle: RingProgressViewStyle = .round { - didSet { - setNeedsDisplay() - } - } - - /// The opacity of the shadow under the progress end. - @objc open var endShadowOpacity: CGFloat = 1.0 { - didSet { - endShadowOpacity = min(max(endShadowOpacity, 0.0), 1.0) - setNeedsDisplay() - } - } - - /// Whether or not to hide the progress ring when progress is zero. - @objc open var hidesRingForZeroProgress: Bool = false { - didSet { - setNeedsDisplay() - } - } - - /// Whether or not to allow anti-aliasing for the generated image. - @objc open var allowsAntialiasing: Bool = true { - didSet { - setNeedsDisplay() - } - } - - /// The scale of the generated gradient image. - /// Use lower values for better performance and higher values for more precise gradients. - @objc open var gradientImageScale: CGFloat = 1.0 { - didSet { - setNeedsDisplay() - } - } - - /// The current progress shown by the view. - /// Values less than 0.0 are clamped. Values greater than 1.0 present multiple revolutions of the progress ring. - @NSManaged public var progress: CGFloat - - /// Disable actions for `progress` property. - internal var disableProgressAnimation: Bool = false - - private let gradientGenerator = GradientGenerator() - - open override class func needsDisplay(forKey key: String) -> Bool { - if key == "progress" { - return true - } - return super.needsDisplay(forKey: key) - } - - open override func action(forKey event: String) -> CAAction? { - if !disableProgressAnimation, event == "progress" { - if let action = super.action(forKey: "opacity") as? CABasicAnimation { - let animation = action.copy() as! CABasicAnimation - animation.keyPath = event - animation.fromValue = presentation()?.value(forKey: event) - animation.toValue = nil - return animation - } else { - let animation = CABasicAnimation(keyPath: event) - animation.duration = 0.001 - return animation - } - } - return super.action(forKey: event) - } - - open override func display() { - contents = contentImage() - } - - func contentImage() -> CGImage? { - let size = bounds.size - if #available(iOS 10.0, tvOS 10.0, *) { - let format = UIGraphicsImageRendererFormat.default() - let image = UIGraphicsImageRenderer(size: size, format: format).image { ctx in - drawContent(in: ctx.cgContext) - } - return image.cgImage - } else { - UIGraphicsBeginImageContextWithOptions(size, false, 0) - guard let ctx = UIGraphicsGetCurrentContext() else { - return nil - } - drawContent(in: ctx) - let image = UIGraphicsGetImageFromCurrentImageContext()?.cgImage - UIGraphicsEndImageContext() - return image - } - } - - private func drawContent(in context: CGContext) { - context.setShouldAntialias(allowsAntialiasing) - context.setAllowsAntialiasing(allowsAntialiasing) - - let useGradient = startColor != endColor - - let squareSize = min(bounds.width, bounds.height) - let squareRect = CGRect(x: (bounds.width - squareSize) / 2, y: (bounds.height - squareSize) / 2, - width: squareSize, height: squareSize) - let gradientRect = squareRect.integral - - let w = min(ringWidth, squareSize / 2) - let r = min(bounds.width, bounds.height) / 2 - w / 2 - let c = CGPoint(x: bounds.width / 2, y: bounds.height / 2) - let p = max(0.0, disableProgressAnimation ? progress : presentation()?.progress ?? 0.0) - let angleOffset = CGFloat.pi / 2 - let angle = 2 * .pi * p - angleOffset - let minAngle = 1.1 * atan(0.5 * w / r) - let maxAngle = 2 * .pi - 3 * minAngle - angleOffset - - let circleRect = squareRect.insetBy(dx: w / 2, dy: w / 2) - let circlePath = UIBezierPath(ovalIn: circleRect) - - let angle1 = angle > maxAngle ? maxAngle : angle - - context.setLineWidth(w) - context.setLineCap(progressStyle.lineCap) - - // Draw backdrop circle - - context.addPath(circlePath.cgPath) - let bgColor = backgroundRingColor ?? startColor.copy(alpha: 0.15)! - context.setStrokeColor(bgColor) - context.strokePath() - - // Draw solid arc - - if angle > maxAngle { - let offset = angle - maxAngle - - let arc2Path = UIBezierPath(arcCenter: c, - radius: r, - startAngle: -angleOffset, - endAngle: offset, - clockwise: true) - context.addPath(arc2Path.cgPath) - context.setStrokeColor(startColor) - context.strokePath() - - context.translateBy(x: circleRect.midX, y: circleRect.midY) - context.rotate(by: offset) - context.translateBy(x: -circleRect.midX, y: -circleRect.midY) - } - - // Draw shadow and progress end - - if p > 0.0 || !hidesRingForZeroProgress { - context.saveGState() - - if endShadowOpacity > 0.0 { - context.addPath(CGPath(__byStroking: circlePath.cgPath, - transform: nil, - lineWidth: w, - lineCap: .round, - lineJoin: .round, - miterLimit: 0)!) - context.clip() - - let shadowOffset = CGSize(width: w / 10 * cos(angle + angleOffset), - height: w / 10 * sin(angle + angleOffset)) - context.setShadow(offset: shadowOffset, - blur: w / 3, - color: UIColor(white: 0.0, alpha: endShadowOpacity).cgColor) - } - - let arcEnd = CGPoint(x: c.x + r * cos(angle1), y: c.y + r * sin(angle1)) - - let shadowPath: UIBezierPath = { - switch progressStyle { - case .round: - return UIBezierPath(ovalIn: CGRect(x: arcEnd.x - w / 2, - y: arcEnd.y - w / 2, - width: w, - height: w)) - case .square: - let path = UIBezierPath(rect: CGRect(x: arcEnd.x - w / 2, - y: arcEnd.y - 2, - width: w, - height: 2)) - path.apply(CGAffineTransform(translationX: -arcEnd.x, y: -arcEnd.y)) - path.apply(CGAffineTransform(rotationAngle: angle1)) - path.apply(CGAffineTransform(translationX: arcEnd.x, y: arcEnd.y)) - return path - } - }() - - let shadowFillColor: CGColor = { - let fadeStartProgress: CGFloat = 0.02 - if !hidesRingForZeroProgress || p > fadeStartProgress { - return startColor - } - // gradually decrease shadow opacity - return startColor.copy(alpha: p / fadeStartProgress)! - }() - context.addPath(shadowPath.cgPath) - context.setFillColor(shadowFillColor) - context.fillPath() - - context.restoreGState() - } - - // Draw gradient arc - - let gradient: CGImage? = { - guard useGradient else { - return nil - } - let s = Float(1.5 * w / (2 * .pi * r)) - gradientGenerator.scale = gradientImageScale - gradientGenerator.size = gradientRect.size - gradientGenerator.colors = [endColor, endColor, startColor, startColor] - gradientGenerator.locations = [0.0, s, 1.0 - s, 1.0] - gradientGenerator.endPoint = CGPoint(x: 0.5 - CGFloat(2 * s), y: 1.0) - return gradientGenerator.image() - }() - - if p > 0.0 { - let arc1Path = UIBezierPath(arcCenter: c, - radius: r, - startAngle: -angleOffset, - endAngle: angle1, - clockwise: true) - if let gradient = gradient { - context.saveGState() - - context.addPath(CGPath(__byStroking: arc1Path.cgPath, - transform: nil, - lineWidth: w, - lineCap: progressStyle.lineCap, - lineJoin: progressStyle.lineJoin, - miterLimit: 0)!) - context.clip() - - context.interpolationQuality = .none - context.draw(gradient, in: gradientRect) - - context.restoreGState() - } else { - context.setStrokeColor(startColor) - context.setLineWidth(w) - context.setLineCap(progressStyle.lineCap) - context.addPath(arc1Path.cgPath) - context.strokePath() - } - } - } -} - -private extension RingProgressViewStyle { - var lineCap: CGLineCap { - switch self { - case .round: - return .round - case .square: - return .butt - } - } - - var lineJoin: CGLineJoin { - switch self { - case .round: - return .round - case .square: - return .miter - } - } -} diff --git a/Dependecies/MKRingProgressView/MKRingProgressView/MKRingProgressView.h b/Dependecies/MKRingProgressView/MKRingProgressView/MKRingProgressView.h deleted file mode 100644 index f6e45c13f..000000000 --- a/Dependecies/MKRingProgressView/MKRingProgressView/MKRingProgressView.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// MKRingProgressView.h -// MKRingProgressView -// -// Created by Max Konovalov on 14/02/2017. -// Copyright © 2017 Max Konovalov. All rights reserved. -// - -#import - -//! Project version number for MKRingProgressView. -FOUNDATION_EXPORT double MKRingProgressViewVersionNumber; - -//! Project version string for MKRingProgressView. -FOUNDATION_EXPORT const unsigned char MKRingProgressViewVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - - diff --git a/Dependecies/MKRingProgressView/MKRingProgressView/MKRingProgressView.swift b/Dependecies/MKRingProgressView/MKRingProgressView/MKRingProgressView.swift deleted file mode 100644 index 9d70c4bbf..000000000 --- a/Dependecies/MKRingProgressView/MKRingProgressView/MKRingProgressView.swift +++ /dev/null @@ -1,197 +0,0 @@ -/* - The MIT License (MIT) - - Copyright (c) 2015 Max Konovalov - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - */ - -import UIKit - -@objc(MKRingProgressViewStyle) -public enum RingProgressViewStyle: Int { - case round - case square -} - -@IBDesignable -@objc(MKRingProgressView) -open class RingProgressView: UIView { - /// The start color of the progress ring. - @IBInspectable open var startColor: UIColor { - get { - return UIColor(cgColor: ringProgressLayer.startColor) - } - set { - ringProgressLayer.startColor = newValue.cgColor - } - } - - /// The end color of the progress ring. - @IBInspectable open var endColor: UIColor { - get { - return UIColor(cgColor: ringProgressLayer.endColor) - } - set { - ringProgressLayer.endColor = newValue.cgColor - } - } - - /// The color of backdrop circle, visible at progress values between 0.0 and 1.0. - /// If not specified, `startColor` with 15% opacity will be used. - @IBInspectable open var backgroundRingColor: UIColor? { - get { - if let color = ringProgressLayer.backgroundRingColor { - return UIColor(cgColor: color) - } - return nil - } - set { - ringProgressLayer.backgroundRingColor = newValue?.cgColor - } - } - - /// The width of the progress ring. Defaults to `20`. - @IBInspectable open var ringWidth: CGFloat { - get { - return ringProgressLayer.ringWidth - } - set { - ringProgressLayer.ringWidth = newValue - } - } - - /// The style of the progress line end. Defaults to `round`. - @objc open var style: RingProgressViewStyle { - get { - return ringProgressLayer.progressStyle - } - set { - ringProgressLayer.progressStyle = newValue - } - } - - /// The opacity of the shadow below progress line end. Defaults to `1.0`. - /// Values outside the [0,1] range will be clamped. - @IBInspectable open var shadowOpacity: CGFloat { - get { - return ringProgressLayer.endShadowOpacity - } - set { - ringProgressLayer.endShadowOpacity = newValue - } - } - - /// Whether or not to hide the progress ring when progress is zero. Defaults to `false`. - @IBInspectable open var hidesRingForZeroProgress: Bool { - get { - return ringProgressLayer.hidesRingForZeroProgress - } - set { - ringProgressLayer.hidesRingForZeroProgress = newValue - } - } - - /// The Antialiasing switch. Defaults to `true`. - @IBInspectable open var allowsAntialiasing: Bool { - get { - return ringProgressLayer.allowsAntialiasing - } - set { - ringProgressLayer.allowsAntialiasing = newValue - } - } - - /// The scale of the generated gradient image. - /// Use lower values for better performance and higher values for more precise gradients. - @IBInspectable open var gradientImageScale: CGFloat { - get { - return ringProgressLayer.gradientImageScale - } - set { - ringProgressLayer.gradientImageScale = newValue - } - } - - /// The progress. Can be any nonnegative number, every whole number corresponding to one full revolution, i.e. 1.0 -> 360°, 2.0 -> 720°, etc. Defaults to `0.0`. Animatable. - @IBInspectable open var progress: Double { - get { - return Double(ringProgressLayer.progress) - } - set { - ringProgressLayer.progress = CGFloat(newValue) - } - } - - open override class var layerClass: AnyClass { - return RingProgressLayer.self - } - - private var ringProgressLayer: RingProgressLayer { - return layer as! RingProgressLayer - } - - public override init(frame: CGRect) { - super.init(frame: frame) - setup() - } - - public required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - setup() - } - - init() { - super.init(frame: .zero) - setup() - } - - private func setup() { - layer.drawsAsynchronously = true - layer.contentsScale = UIScreen.main.scale - isAccessibilityElement = true - #if swift(>=4.2) - accessibilityTraits = UIAccessibilityTraits.updatesFrequently - #else - accessibilityTraits = UIAccessibilityTraitUpdatesFrequently - #endif - accessibilityLabel = "Ring progress" - } - - open override func prepareForInterfaceBuilder() { - super.prepareForInterfaceBuilder() - ringProgressLayer.disableProgressAnimation = true - } - - // MARK: Accessibility - - private var overriddenAccessibilityValue: String? - - open override var accessibilityValue: String? { - get { - if let override = overriddenAccessibilityValue { - return override - } - return String(format: "%.f%%", progress * 100) - } - set { - overriddenAccessibilityValue = newValue - } - } -} diff --git a/Dependecies/MKRingProgressView/README.md b/Dependecies/MKRingProgressView/README.md deleted file mode 100644 index 116c3c8fe..000000000 --- a/Dependecies/MKRingProgressView/README.md +++ /dev/null @@ -1,87 +0,0 @@ -# MKRingProgressView - -[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat)](https://developer.apple.com/swift) -[![Platform](https://img.shields.io/cocoapods/p/MKRingProgressView.svg?style=flat)](http://cocoapods.org/pods/MKRingProgressView) -[![License](https://img.shields.io/cocoapods/l/MKRingProgressView.svg?style=flat)](http://cocoapods.org/pods/MKRingProgressView) -[![Version](https://img.shields.io/cocoapods/v/MKRingProgressView.svg?style=flat)](http://cocoapods.org/pods/MKRingProgressView) -[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) - - -Ring progress view similar to Activity app on Apple Watch - -MKRingProgressView - -## Features - -- Progress animation -- Customizable start/end and backdrop ring colors -- Customizable ring width -- Customizable progress line end style -- Customizable shadow under progress line end -- Progress values above 100% (or 360°) can also be displayed - -## Installation - -### CocoaPods - -To install `MKRingProgressView` via [CocoaPods](http://cocoapods.org), add the following line to your Podfile: - -``` -pod 'MKRingProgressView' -``` - -### Carthage - -To install `MKRingProgressView` via [Carthage](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos), add the following line to your Cartfile: - -``` -github "maxkonovalov/MKRingProgressView" -``` - -## Usage - -See the example Xcode project. It contains 2 targets: -- **ProgressRingExample** - a simple example containing a single progress ring with adjustable parameters. -- **ActivityRingsExample** - an advanced usage example replicating Activity app by Apple. It also contains additional classes for convenient grouping of 3 ring progress views together. - -### Interface Builder - -`MKRingProgressView` can be set up in Interface Builder. To use it, set the custom view class to `MKRingProgressView`. Most of the control's parameters can be customized in Interface Builder. - -### Code - -```swift -let ringProgressView = RingProgressView(frame: CGRect(x: 0, y: 100, width: 100, height: 100)) -ringProgressView.startColor = .red -ringProgressView.endColor = .magenta -ringProgressView.ringWidth = 25 -ringProgressView.progress = 0.0 -view.addSubview(ringProgressView) -``` - -The `progress` value can be animated the same way you would normally animate any property using `UIView`'s block-based animations: - -```swift -UIView.animate(withDuration: 0.5) { - ringProgressView.progress = 1.0 -} -``` - -## Performance - -To achieve better performance the following options are possible: - -- Set `gradientImageScale` to lower values like `0.5` (defaults to `1.0`) -- Set `startColor` and `endColor` to the same value -- Set `shadowOpacity` to `0.0` -- Set `allowsAntialiasing` to `false` - -## Requirements - -- iOS 8.2 -- tvOS 9.0 -- Xcode 10, Swift 4+ - -## License - -`MKRingProgressView` is available under the MIT license. See the LICENSE file for more info. diff --git a/Dependecies/SwiftCharts/.gitignore b/Dependecies/SwiftCharts/.gitignore deleted file mode 100644 index 58384e4b1..000000000 --- a/Dependecies/SwiftCharts/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -# Xcode -# -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate -.DS_Store - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control -# -Pods - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build diff --git a/Dependecies/SwiftCharts/CHANGELOG.md b/Dependecies/SwiftCharts/CHANGELOG.md deleted file mode 100644 index c1093402b..000000000 --- a/Dependecies/SwiftCharts/CHANGELOG.md +++ /dev/null @@ -1,145 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). - -## [Unreleased] - -## [0.6.5] - 2019.03.30 -- Correct deployment target - -## [0.6.4] - 2019.03.29 -- Swift 5.0 upgrade - - -## [0.6.3] - 2018.09.30 -- Swift 4.2 upgrade - - -## [0.6.2] - 2018.09.15 -- Fix iPad demo crash -- Add missing AppIcon image sizes -- Fix Xcode 10 compilation -- Fix dividing by zero while calculating axis inner frame -- Fill area width fixed: now it is equal to graph line width -- Expose bar views, e.g. to enable highlighting by external events - -## [0.6.1] - 2017.12.04 -- Fix area chart broken with straight line generator -- Fix unclipped container behind content view, don't mask if there's no clip rect -- Implemented gradient fill for curved areas -- Added support for gradient line charts -- Make candle stick fill colours configurable -- ChartPointViewBarStacked: allowing only rounding some corners -- Make candle stick fill colours configurable, show usage in example -- Fixed 2 leaks setting stackedTapHandler -- Bar chart axis labels now use provided label font and color -- Swift 4 support -- Fix passing incorrect parameter to Zoomable - -## [0.6] - 2017.04.23 -- Fix guidelines overlap with axis lines -- Fix axis line minor irregularities (fixes #151) -- Make ChartPointsLayer.display(Chart) open -- Allow to retrieve frames of axis labels -- Separate axis from layer with related UI elements (refactoring) -- Implement dynamic axis values and labels generators (multiplier, fixed, non-overapping, nice numbers, suffix, date) -- Zooming & panning -- Allow to set line join/cap -- Allow to set padding in points for axis values -- Implement global tap handling -- Allow to set fixed bar width for grouped bars -- Improve info bubble -- Implement axis tap handling -- Add multiline support to tracker, modify gesture handling work well with zoom & pan -- Implement tap handling for bars and stack frames -- Implement animators -- Implement catmull rom path generator -- Add modes to views layer to add subviews to scale&translate subviews as part of own transform or only translate by updating their positions individually -- Allow to generate custom views in bars(plain, grouped, stacked) and line layer -- Implement elastic zoom/pan -- Fix dashed path not showing when line is not animated -- Implement grouped bars companion layer (to add e.g. labels to individual grouped bars). -- Remove unnecessary use of self, improve formatting -- Don't force unwrap context -- Add custom transform mode to ChartPointsViewsLayer. -- Allow to disable axis layer modification of chart's frame -- Allow to show chart points outside of the chart's inner frame -- Add example for ranged axis and rotation handling -- Adjust "Custom units" example to show how to set a fixed scrollable area / initial zoom. -- Allow to use gradients in ChartPointsAreaLayer -- Allow to use bars with rounded corners -- Diverse other improvements and fixes - -## [0.5] - 2016.11.23 -- Add multi-chart tracker layer -- Add dashed line support -- Migrate to Swift 2.3 -- Migrate to Swift 3.0 -- Fix division by 0 in axis layer -- Fix not being able to use reversed axis values - -## [0.4] - 2016.05.29 -- Fix tracker showing NaN on constant coordinate -- Pass tension values to cubic line to be able to modify curviness -- Add tvOS target -- Fix value of ChartAxisValue does not update in subsequent calls to copy -- Fix axis stroke width setting has no effect -- Add public init so to ChartLayerBase to allow it to be subclassed -- Update examples to use ChartAxisValueDouble instead of ChartAxisValueFloat (deprecated) -- Make ChartPoint, ChartAxisValue and subclasses conform to CustomStringConvertible -- Use closure to map dates instead of date formatter for more flexibility -- Improve inline documentation -- Allow to change text alignment of y axis labels -- Make ChartPointsScatterLayer class along with its' properties and methods public for subclassing outside swift module -- Use flatMap instead of reduce to improve performance -- Don't sort axis values in axis layer -- Move labels in y axis if they overlap -- Fix dividers not showing in upper x axis -- Fix line layer blocking touch -- Fix memory leak in CoordExample (issue #101) -- Add top right coord space initialisation helper - -## [0.3] - 2015.09.28 -- Merge swift2.0 in master - -## [0.2.5] - 2015.08.31 -- Fix stacked bar frames displaying incorrectly when start is not 0 -- Improve project organization -- Make usage of ChartAxisValue clearer, improve docs -- Use only Double instead of CGFloat for axis values, deprecate ChartAxisValueFloat and ChartAxisValueFloatScreenLoc - -## [0.2.4] - 2015.08.09 -- Automatic generation of trendlines -- Add Carthage support - -## [0.2.3] -- Allow rotating y axis title label -- Add LineChart to create (multi)line chart with few lines -- Add BarChart to create bar chart with few lines -- Change axis value's scalar type to Double to fix inaccuracies when using dates - -## [0.2.2] -- Refactor circle and bubble views, now ChartPointEllipseView -- Rename BubbleView in InfoBubble and move it to example project - -## [0.2.1] - 2015-05-24 -- Improve performance drawing guidelines -- Generate calculation intensive coordinates spaces in the background (examples) -- Performance improvements calculating axis labels size - -## [0.2] - 2015-05-22 - -### Added -- iOS7 support -- Bars example with variable axes -- Stacked bars layer and example -- Bubble chart layer and example, example includes functionality to map model values to colors from gradient bar -- Scatter chart layer and example -- Bars layer, +/- bars with dynamic gradient example -- Grouped bars layer and example - -### Removed -- Bars example with horizontal axis - now included in variable axes example - -## [0.1] - 2015-05-10 -First import, pods settings diff --git a/Dependecies/SwiftCharts/Examples/AppDelegate.swift b/Dependecies/SwiftCharts/Examples/AppDelegate.swift deleted file mode 100644 index 0f8529559..000000000 --- a/Dependecies/SwiftCharts/Examples/AppDelegate.swift +++ /dev/null @@ -1,96 +0,0 @@ -// -// AppDelegate.swift -// Examples -// -// Created by ischuetz on 08/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate { - - var window: UIWindow? - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - - if UIDevice.current.userInterfaceIdiom == .pad { - - let splitViewController = self.window!.rootViewController as! UISplitViewController - let navigationController = splitViewController.viewControllers.last as! UINavigationController - splitViewController.delegate = self - - if #available(iOS 8.0, *) { - navigationController.topViewController?.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem - } - } - - return true - - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - // MARK: - Split view - - func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController) -> Bool { - if let secondaryAsNavController = secondaryViewController as? UINavigationController { - if let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController { - if topAsDetailController.detailItem == nil { - // Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded. - return true - } - } - } - return false - } - - fileprivate func setSplitSwipeEnabled(_ enabled: Bool) { - if UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.pad { - let splitViewController = UIApplication.shared.delegate?.window!!.rootViewController as! UISplitViewController - splitViewController.presentsWithGesture = enabled - } - } - - func splitViewController(_ svc: UISplitViewController, willHide aViewController: UIViewController, with barButtonItem: UIBarButtonItem, for pc: UIPopoverController) { - - let navigationController = svc.viewControllers[svc.viewControllers.count-1] as! UINavigationController - if let topAsDetailController = navigationController.topViewController as? DetailViewController { - barButtonItem.title = "Examples" - topAsDetailController.navigationItem.setLeftBarButton(barButtonItem, animated: true) - } - } -} - - -// src: http://stackoverflow.com/a/27399688/930450 -extension UISplitViewController { - func toggleMasterView() { - if #available(iOS 8.0, *) { - let barButtonItem = self.displayModeButtonItem - UIApplication.shared.sendAction(barButtonItem.action!, to: barButtonItem.target, from: nil, for: nil) - } - } -} diff --git a/Dependecies/SwiftCharts/Examples/DetailViewController.swift b/Dependecies/SwiftCharts/Examples/DetailViewController.swift deleted file mode 100644 index 8f45e3e9e..000000000 --- a/Dependecies/SwiftCharts/Examples/DetailViewController.swift +++ /dev/null @@ -1,132 +0,0 @@ -// -// DetailViewController.swift -// SwiftCharts -// -// Created by ischuetz on 20/04/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit - -class DetailViewController: UIViewController, UISplitViewControllerDelegate { - - @IBOutlet weak var detailDescriptionLabel: UILabel! - - lazy private(set) var chartFrame: CGRect! = { - CGRect(x: 0, y: 80, width: self.view.frame.size.width, height: self.view.frame.size.height - 80) - }() - - var detailItem: Example? { - didSet { - configureView() - } - } - var currentExampleController: UIViewController? - - func configureView() { - - if let example: Example = detailItem { - switch example { - case .helloWorld: - setSplitSwipeEnabled(true) - showExampleController(HelloWorld()) - case .bars: - setSplitSwipeEnabled(true) - showExampleController(BarsExample()) - case .stackedBars: - setSplitSwipeEnabled(true) - showExampleController(StackedBarsExample()) - case .barsPlusMinus: - setSplitSwipeEnabled(true) - showExampleController(BarsPlusMinusWithGradientExample()) - case .groupedBars: - setSplitSwipeEnabled(true) - showExampleController(GroupedBarsExample()) - case .barsStackedGrouped: - setSplitSwipeEnabled(true) - showExampleController(GroupedAndStackedBarsExample()) - case .scatter: - setSplitSwipeEnabled(true) - showExampleController(ScatterExample()) - case .notifications: - setSplitSwipeEnabled(true) - showExampleController(NotificationsExample()) - case .target: - setSplitSwipeEnabled(true) - showExampleController(TargetExample()) - case .areas: - setSplitSwipeEnabled(true) - showExampleController(AreasExample()) - case .rangedAxis: - setSplitSwipeEnabled(true) - showExampleController(RangedAxisExample()) - case .bubble: - setSplitSwipeEnabled(true) - showExampleController(BubbleExample()) - case .combination: - setSplitSwipeEnabled(true) - showExampleController(BarsPlusMinusAndLinesExample()) - case .coords: - setSplitSwipeEnabled(true) - showExampleController(CoordsExample()) - case .tracker: - setSplitSwipeEnabled(false) - showExampleController(TrackerExample()) - case .multiTracker: - setSplitSwipeEnabled(false) - showExampleController(MultiTrackerExample()) - case .equalSpacing: - setSplitSwipeEnabled(true) - showExampleController(EqualSpacingExample()) - case .customUnits: - setSplitSwipeEnabled(true) - showExampleController(CustomUnitsExample()) - case .multival: - setSplitSwipeEnabled(true) - showExampleController(MultipleLabelsExample()) - case .multiAxis: - setSplitSwipeEnabled(true) - showExampleController(MultipleAxesExample()) - case .multiAxisInteractive: - setSplitSwipeEnabled(true) - showExampleController(MultipleAxesInteractiveExample()) - case .candleStick: - setSplitSwipeEnabled(true) - showExampleController(CandleStickExample()) - case .cubiclines: - setSplitSwipeEnabled(true) - showExampleController(CubicLinesExample()) - case .cubiclinesWithGradient: - setSplitSwipeEnabled(true) - showExampleController(CubicLinesWithGradientExample()) - case .notNumeric: - setSplitSwipeEnabled(true) - showExampleController(NotNumericExample()) - case .candleStickInteractive: - setSplitSwipeEnabled(false) - showExampleController(CandleStickInteractiveExample()) - case .trendline: - setSplitSwipeEnabled(true) - showExampleController(TrendlineExample()) - } - } - } - - fileprivate func showExampleController(_ controller: UIViewController) { - if let currentExampleController = currentExampleController { - currentExampleController.removeFromParent() - currentExampleController.view.removeFromSuperview() - } - addChild(controller) - view.addSubview(controller.view) - currentExampleController = controller - } - - fileprivate func setSplitSwipeEnabled(_ enabled: Bool) { - if UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.pad { - let splitViewController = UIApplication.shared.delegate?.window!!.rootViewController as! UISplitViewController - splitViewController.presentsWithGesture = enabled - } - } -} - diff --git a/Dependecies/SwiftCharts/Examples/Examples/AreasExample.swift b/Dependecies/SwiftCharts/Examples/Examples/AreasExample.swift deleted file mode 100644 index 5cfc1caf6..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/AreasExample.swift +++ /dev/null @@ -1,172 +0,0 @@ -// -// AreasExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class AreasExample: UIViewController, ChartDelegate { - - fileprivate var chart: Chart? // arc - - fileprivate var popups: [UIView] = [] - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let chartPoints1 = [(0, 50), (2, 65), (4, 125), (6, 140)].map{ChartPoint(x: ChartAxisValueInt($0.0, labelSettings: labelSettings), y: ChartAxisValueInt($0.1))} - let chartPoints2 = [(0, 150), (2, 100), (4, 200), (6, 60)].map{ChartPoint(x: ChartAxisValueInt($0.0, labelSettings: labelSettings), y: ChartAxisValueInt($0.1))} - let chartPoints3 = [(0, 200), (2, 210), (4, 260), (6, 290)].map{ChartPoint(x: ChartAxisValueInt($0.0, labelSettings: labelSettings), y: ChartAxisValueInt($0.1))} - - let allChartPoints = (chartPoints1 + chartPoints2 + chartPoints3).sorted {(obj1, obj2) in return obj1.x.scalar < obj2.x.scalar} - - let xValues: [ChartAxisValue] = (NSOrderedSet(array: allChartPoints).array as! [ChartPoint]).map{$0.x} - let yValues = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(allChartPoints, minSegmentCount: 5, maxSegmentCount: 20, multiple: 50, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: labelSettings)}, addPaddingSegmentIfEdge: false) - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - var chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - chartSettings.trailing = 20 - chartSettings.labelsToAxisSpacingX = 20 - chartSettings.labelsToAxisSpacingY = 20 - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let c1 = UIColor(red: 0.1, green: 0.1, blue: 0.9, alpha: 0.4) - let c2 = UIColor(red: 0.9, green: 0.1, blue: 0.1, alpha: 0.4) - let c3 = UIColor(red: 0.1, green: 0.9, blue: 0.1, alpha: 0.4) - - let lineModel1 = ChartLineModel(chartPoints: chartPoints1, lineColor: UIColor.black, animDuration: 1, animDelay: 0) - let lineModel2 = ChartLineModel(chartPoints: chartPoints2, lineColor: UIColor.black, animDuration: 1, animDelay: 0) - let lineModel3 = ChartLineModel(chartPoints: chartPoints3, lineColor: UIColor.black, animDuration: 1, animDelay: 0) - - let chartPointsLineLayer = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [lineModel1, lineModel2, lineModel3], pathGenerator: CatmullPathGenerator()) - - let chartPointsLayer1 = ChartPointsAreaLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints1, areaColors: [c1], animDuration: 3, animDelay: 0, addContainerPoints: true, pathGenerator: chartPointsLineLayer.pathGenerator) - let chartPointsLayer2 = ChartPointsAreaLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints2, areaColors: [c2], animDuration: 3, animDelay: 0, addContainerPoints: true, pathGenerator: chartPointsLineLayer.pathGenerator) - let chartPointsLayer3 = ChartPointsAreaLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints3, areaColors: [c3], animDuration: 3, animDelay: 0, addContainerPoints: true, pathGenerator: chartPointsLineLayer.pathGenerator) - - var selectedView: ChartPointTextCircleView? - - let circleViewGenerator = {[weak self] (chartPointModel: ChartPointLayerModel, layer: ChartPointsLayer, chart: Chart) -> UIView? in guard let weakSelf = self else {return nil} - - let (chartPoint, screenLoc) = (chartPointModel.chartPoint, chartPointModel.screenLoc) - - let v = ChartPointTextCircleView(chartPoint: chartPoint, center: screenLoc, diameter: Env.iPad ? 50 : 30, cornerRadius: Env.iPad ? 24: 15, borderWidth: Env.iPad ? 2 : 1, font: ExamplesDefaults.fontWithSize(Env.iPad ? 14 : 8)) - v.viewTapped = {view in - for p in weakSelf.popups {p.removeFromSuperview()} - selectedView?.selected = false - - let w: CGFloat = Env.iPad ? 250 : 150 - let h: CGFloat = Env.iPad ? 100 : 80 - - if let chartViewScreenLoc = layer.containerToGlobalScreenLoc(chartPoint) { - let x: CGFloat = { - let attempt = chartViewScreenLoc.x - (w/2) - let leftBound: CGFloat = chart.bounds.origin.x - let rightBound = chart.bounds.size.width - 5 - if attempt < leftBound { - return view.frame.origin.x - } else if attempt + w > rightBound { - return rightBound - w - } - return attempt - }() - - let frame = CGRect(x: x, y: chartViewScreenLoc.y - (h + (Env.iPad ? 30 : 12)), width: w, height: h) - - let bubbleView = InfoBubble(point: chartViewScreenLoc, frame: frame, arrowWidth: Env.iPad ? 40 : 28, arrowHeight: Env.iPad ? 20 : 14, bgColor: UIColor.black, arrowX: chartViewScreenLoc.x - x, arrowY: -1) // TODO don't calculate this here - chart.view.addSubview(bubbleView) - - bubbleView.transform = CGAffineTransform(scaleX: 0, y: 0).concatenating(CGAffineTransform(translationX: 0, y: 100)) - let infoView = UILabel(frame: CGRect(x: 0, y: 10, width: w, height: h - 30)) - infoView.textColor = UIColor.white - infoView.backgroundColor = UIColor.black - infoView.text = "Some text about \(chartPoint)" - infoView.font = ExamplesDefaults.fontWithSize(Env.iPad ? 14 : 12) - infoView.textAlignment = NSTextAlignment.center - - bubbleView.addSubview(infoView) - weakSelf.popups.append(bubbleView) - - UIView.animate(withDuration: 0.2, delay: 0, options: UIView.AnimationOptions(), animations: { - view.selected = true - selectedView = view - - bubbleView.transform = CGAffineTransform.identity - }, completion: {finished in}) - } - } - - UIView.animate(withDuration: 0.7, delay: 0, usingSpringWithDamping: 0.6, initialSpringVelocity: 0, options: UIView.AnimationOptions(), animations: { - let w: CGFloat = v.frame.size.width - let h: CGFloat = v.frame.size.height - let frame = CGRect(x: screenLoc.x - (w/2), y: screenLoc.y - (h/2), width: w, height: h) - v.frame = frame - }, completion: nil) - - return v - } - - let itemsDelay: Float = 0.08 - - // To not have circles clipped by the chart bounds, pass clipViews: false (and ChartSettings.customClipRect in case you want to clip them by other bounds) - let chartPointsCircleLayer1 = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints1, viewGenerator: circleViewGenerator, displayDelay: 0.9, delayBetweenItems: itemsDelay, mode: .translate) - - let chartPointsCircleLayer2 = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints2, viewGenerator: circleViewGenerator, displayDelay: 1.8, delayBetweenItems: itemsDelay, mode: .translate) - - let chartPointsCircleLayer3 = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints3, viewGenerator: circleViewGenerator, displayDelay: 2.7, delayBetweenItems: itemsDelay, mode: .translate) - - let settings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - chartPointsLayer1, - chartPointsLayer2, - chartPointsLayer3, - chartPointsLineLayer, - chartPointsCircleLayer1, - chartPointsCircleLayer2, - chartPointsCircleLayer3 - ] - ) - - chart.delegate = self - - view.addSubview(chart.view) - self.chart = chart - } - - fileprivate func removePopups() { - for popup in popups { - popup.removeFromSuperview() - } - } - - // MARK: - ChartDelegate - - func onZoom(scaleX: CGFloat, scaleY: CGFloat, deltaX: CGFloat, deltaY: CGFloat, centerX: CGFloat, centerY: CGFloat, isGesture: Bool) { - removePopups() - } - - func onPan(transX: CGFloat, transY: CGFloat, deltaX: CGFloat, deltaY: CGFloat, isGesture: Bool, isDeceleration: Bool) { - removePopups() - } - - func onTap(_ models: [TappedChartPointLayerModels]) { - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/BarsExample.swift b/Dependecies/SwiftCharts/Examples/Examples/BarsExample.swift deleted file mode 100644 index f0fb738a3..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/BarsExample.swift +++ /dev/null @@ -1,172 +0,0 @@ -// -// BarsExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -// This example uses a normal view generator to create bars. This allows a high degree of customization at view level, since any UIView can be used. -// Alternatively it's possible to use ChartBarsLayer (see e.g. implementation of BarsChart for a simple example), which provides more ready to use, bar-specific functionality, but is accordingly more constrained. -class BarsExample: UIViewController { - - fileprivate var chart: Chart? - - let sideSelectorHeight: CGFloat = 50 - - fileprivate func barsChart(horizontal: Bool) -> Chart { - let tuplesXY = [(2, 8), (4, 9), (6, 10), (8, 12), (12, 17)] - - func reverseTuples(_ tuples: [(Int, Int)]) -> [(Int, Int)] { - return tuples.map{($0.1, $0.0)} - } - - let chartPoints = (horizontal ? reverseTuples(tuplesXY) : tuplesXY).map{ChartPoint(x: ChartAxisValueInt($0.0), y: ChartAxisValueInt($0.1))} - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let generator = ChartAxisGeneratorMultiplier(2) - let labelsGenerator = ChartAxisLabelsGeneratorFunc {scalar in - return ChartAxisLabel(text: "\(scalar)", settings: labelSettings) - } - let xGenerator = ChartAxisGeneratorMultiplier(2) - - let xModel = ChartAxisModel(firstModelValue: 0, lastModelValue: 20, axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: labelSettings)], axisValuesGenerator: xGenerator, labelsGenerator: labelsGenerator) - let yModel = ChartAxisModel(firstModelValue: 0, lastModelValue: 20, axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())], axisValuesGenerator: generator, labelsGenerator: labelsGenerator) - - let barViewGenerator = {(chartPointModel: ChartPointLayerModel, layer: ChartPointsViewsLayer, chart: Chart) -> UIView? in - let bottomLeft = layer.modelLocToScreenLoc(x: 0, y: 0) - - let barWidth: CGFloat = Env.iPad ? 60 : 30 - - let settings = ChartBarViewSettings(animDuration: 0.5) - - let (p1, p2): (CGPoint, CGPoint) = { - if horizontal { - return (CGPoint(x: bottomLeft.x, y: chartPointModel.screenLoc.y), CGPoint(x: chartPointModel.screenLoc.x, y: chartPointModel.screenLoc.y)) - } else { - return (CGPoint(x: chartPointModel.screenLoc.x, y: bottomLeft.y), CGPoint(x: chartPointModel.screenLoc.x, y: chartPointModel.screenLoc.y)) - } - }() - return ChartPointViewBar(p1: p1, p2: p2, width: barWidth, bgColor: UIColor.blue.withAlphaComponent(0.6), settings: settings) - } - - let frame = ExamplesDefaults.chartFrame(view.bounds) - let chartFrame = chart?.frame ?? CGRect(x: frame.origin.x, y: frame.origin.y, width: frame.size.width, height: frame.size.height - sideSelectorHeight) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let chartPointsLayer = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints, viewGenerator: barViewGenerator) - - let settings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - return Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - chartPointsLayer - ] - ) - } - - fileprivate func showChart(horizontal: Bool) { - self.chart?.clearView() - - let chart = barsChart(horizontal: horizontal) - view.addSubview(chart.view) - self.chart = chart - } - - override func viewDidLoad() { - showChart(horizontal: false) - if let chart = chart { - let sideSelector = DirSelector(frame: CGRect(x: 0, y: chart.frame.origin.y + chart.frame.size.height, width: view.frame.size.width, height: sideSelectorHeight), controller: self) - view.addSubview(sideSelector) - } - } - - - class DirSelector: UIView { - - let horizontal: UIButton - let vertical: UIButton - - weak var controller: BarsExample? - - fileprivate let buttonDirs: [UIButton : Bool] - - init(frame: CGRect, controller: BarsExample) { - - self.controller = controller - - horizontal = UIButton() - horizontal.setTitle("Horizontal", for: UIControl.State()) - vertical = UIButton() - vertical.setTitle("Vertical", for: UIControl.State()) - - buttonDirs = [horizontal : true, vertical : false] - - super.init(frame: frame) - - addSubview(horizontal) - addSubview(vertical) - - for button in [horizontal, vertical] { - button.titleLabel?.font = ExamplesDefaults.fontWithSize(14) - button.setTitleColor(UIColor.blue, for: UIControl.State()) - button.addTarget(self, action: #selector(DirSelector.buttonTapped(_:)), for: .touchUpInside) - } - } - - @objc func buttonTapped(_ sender: UIButton) { - let horizontal = sender == self.horizontal ? true : false - controller?.showChart(horizontal: horizontal) - } - - override func didMoveToSuperview() { - let views = [horizontal, vertical] - for v in views { - v.translatesAutoresizingMaskIntoConstraints = false - } - - let namedViews = views.enumerated().map{index, view in - ("v\(index)", view) - } - - var viewsDict = Dictionary() - for namedView in namedViews { - viewsDict[namedView.0] = namedView.1 - } - - let buttonsSpace: CGFloat = Env.iPad ? 20 : 10 - - let hConstraintStr = namedViews.reduce("H:|") {str, tuple in - "\(str)-(\(buttonsSpace))-[\(tuple.0)]" - } - - let vConstraits = namedViews.flatMap {NSLayoutConstraint.constraints(withVisualFormat: "V:|[\($0.0)]", options: NSLayoutConstraint.FormatOptions(), metrics: nil, views: viewsDict)} - - addConstraints(NSLayoutConstraint.constraints(withVisualFormat: hConstraintStr, options: NSLayoutConstraint.FormatOptions(), metrics: nil, views: viewsDict) - + vConstraits) - } - - required init(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - } -} - - - - diff --git a/Dependecies/SwiftCharts/Examples/Examples/BarsPlusMinusAndLinesExample.swift b/Dependecies/SwiftCharts/Examples/Examples/BarsPlusMinusAndLinesExample.swift deleted file mode 100644 index 24d2c66fb..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/BarsPlusMinusAndLinesExample.swift +++ /dev/null @@ -1,150 +0,0 @@ -// -// BarsPlusMinusAndLinesExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class BarsPlusMinusAndLinesExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let barsData: [(title: String, min: Double, max: Double)] = [ - ("A", -65, 40), - ("B", -30, 50), - ("C", -40, 35), - ("D", -50, 40), - ("E", -60, 30), - ("F", -35, 47), - ("G", -30, 60), - ("H", -46, 48) - ] - - let lineData: [(title: String, val: Double)] = [ - ("A", -10), - ("B", 20), - ("C", -20), - ("D", 10), - ("E", -20), - ("F", 23), - ("G", 10), - ("H", 45) - ] - - let alpha: CGFloat = 0.5 - let posColor = UIColor.green.withAlphaComponent(alpha) - let negColor = UIColor.red.withAlphaComponent(alpha) - let zero = ChartAxisValueDouble(0) - let bars: [ChartBarModel] = barsData.enumerated().flatMap {index, tuple in - [ - ChartBarModel(constant: ChartAxisValueDouble(index), axisValue1: zero, axisValue2: ChartAxisValueDouble(tuple.min), bgColor: negColor), - ChartBarModel(constant: ChartAxisValueDouble(index), axisValue1: zero, axisValue2: ChartAxisValueDouble(tuple.max), bgColor: posColor) - ] - } - - let xGenerator = ChartAxisGeneratorMultiplier(1) - let yGenerator = ChartAxisGeneratorMultiplier(20) - let labelsGenerator = ChartAxisLabelsGeneratorFunc {scalar in - return ChartAxisLabel(text: "\(scalar)", settings: labelSettings) - } - - let xModel = ChartAxisModel(firstModelValue: -1, lastModelValue: Double(barsData.count), axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: labelSettings)], axisValuesGenerator: xGenerator, labelsGenerator: labelsGenerator) - let yModel = ChartAxisModel(firstModelValue: -80, lastModelValue: 80, axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())], axisValuesGenerator: yGenerator, labelsGenerator: labelsGenerator) - - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let barViewSettings = ChartBarViewSettings(animDuration: 0.5) - let barsLayer = ChartBarsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, bars: bars, horizontal: false, barWidth: Env.iPad ? 40 : 25, settings: barViewSettings) - - /* - Labels layer. - Create chartpoints for the top and bottom of the bars, where we will show the labels. - There are multiple ways to do this. Here we represent the labels with chartpoints at the top/bottom of the bars. We set some space using domain coordinates, in order for this to be updated properly during zoom / pan. Note that with this the spacing is also zoomed, meaning the labels will move away from the edges of the bars when we scale up, which maybe it's not wanted. More elaborate approaches involve passing a custom transform closure to the layer, or using GroupedBarsCompanionsLayer (currently only for stacked/grouped bars, though any bar chart can be represented with this). - */ - let labelToBarSpace: Double = 3 // domain units - let labelChartPoints = bars.map {bar in - ChartPoint(x: bar.constant, y: bar.axisValue2.copy(bar.axisValue2.scalar + (bar.axisValue2.scalar > 0 ? labelToBarSpace : -labelToBarSpace))) - } - let formatter = NumberFormatter() - formatter.maximumFractionDigits = 2 - let labelsLayer = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: labelChartPoints, viewGenerator: {(chartPointModel, layer, chart) -> UIView? in - let label = HandlingLabel() - - let pos = chartPointModel.chartPoint.y.scalar > 0 - - label.text = "\(formatter.string(from: NSNumber(value: chartPointModel.chartPoint.y.scalar - labelToBarSpace))!)%" - label.font = ExamplesDefaults.labelFont - label.sizeToFit() - label.center = CGPoint(x: chartPointModel.screenLoc.x, y: pos ? innerFrame.origin.y : innerFrame.origin.y + innerFrame.size.height) - label.alpha = 0 - - label.movedToSuperViewHandler = {[weak label] in - UIView.animate(withDuration: 0.3, animations: { - label?.alpha = 1 - label?.center.y = chartPointModel.screenLoc.y - }) - } - return label - - }, displayDelay: 0.5, mode: .translate) // show after bars animation - - // NOTE: If you need the labels from labelsLayer to stay at the same distance from the bars during zooming, i.e. that the space between them and the bars is not scaled, use mode: .custom and pass a custom transform block, in which you update manually the position. Similar to how it's done in e.g. NotificationsExample for the notifications views. - - // line layer - let lineChartPoints = lineData.enumerated().map {index, tuple in ChartPoint(x: ChartAxisValueDouble(index), y: ChartAxisValueDouble(tuple.val))} - let lineModel = ChartLineModel(chartPoints: lineChartPoints, lineColor: UIColor.black, lineWidth: 2, animDuration: 0.5, animDelay: 1) - let lineLayer = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [lineModel]) - - // circles layer - let circleViewGenerator = {(chartPointModel: ChartPointLayerModel, layer: ChartPointsLayer, chart: Chart) -> UIView? in - let color = UIColor(red: 0.7, green: 0.7, blue: 0.7, alpha: 1) - let circleView = ChartPointEllipseView(center: chartPointModel.screenLoc, diameter: 6) - circleView.animDuration = 0.5 - circleView.fillColor = color - return circleView - } - let lineCirclesLayer = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: lineChartPoints, viewGenerator: circleViewGenerator, displayDelay: 1.5, delayBetweenItems: 0.05, mode: .translate) - - - // show a gap between positive and negative bar - let dummyZeroYChartPoint = ChartPoint(x: ChartAxisValueDouble(0), y: ChartAxisValueDouble(0)) - let yZeroGapLayer = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: [dummyZeroYChartPoint], viewGenerator: {(chartPointModel, layer, chart) -> UIView? in - let height: CGFloat = 2 - let v = UIView(frame: CGRect(x: chart.contentView.frame.origin.x + 2, y: chartPointModel.screenLoc.y - height / 2, width: chart.contentView.frame.origin.x + chart.contentView.frame.height, height: height)) - v.backgroundColor = UIColor.white - return v - }) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - barsLayer, - labelsLayer, - yZeroGapLayer, - lineLayer, - lineCirclesLayer - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } - -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/BarsPlusMinusWithGradientExample.swift b/Dependecies/SwiftCharts/Examples/Examples/BarsPlusMinusWithGradientExample.swift deleted file mode 100644 index cb8dedb24..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/BarsPlusMinusWithGradientExample.swift +++ /dev/null @@ -1,198 +0,0 @@ -// -// BarsPlusMinusWithGradientExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class BarsPlusMinusWithGradientExample: UIViewController { - - fileprivate var chart: Chart? // arc - - fileprivate let gradientPicker: GradientPicker? // to pick the colors of the bars - - override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { - gradientPicker = GradientPicker(width: 200) - super.init(nibName: nil, bundle: nil) - } - - required init(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override func viewDidLoad() { - - let vals: [(title: String, val: CGFloat)] = [ - ("U", -75), - ("T", -65), - ("S", -50), - ("R", -45), - ("Q", -40), - ("P", -30), - ("O", -20), - ("N", -10), - ("M", -5), - ("L", -0), - ("K", 10), - ("J", 15), - ("I", 20), - ("H", 30), - ("G", 35), - ("F", 40), - ("E", 50), - ("D", 60), - ("C", 65), - ("B", 70), - ("A", 75) - ] - - let (minVal, maxVal): (CGFloat, CGFloat) = vals.reduce((min: CGFloat(0), max: CGFloat(0))) {tuple, val in - (min: min(tuple.min, val.val), max: max(tuple.max, val.val)) - } - let length: CGFloat = maxVal - minVal - - let zero = ChartAxisValueDouble(0) - let bars: [ChartBarModel] = vals.enumerated().map {index, tuple in - let percentage = (tuple.val - minVal - 0.01) / length // FIXME without -0.01 bar with 1 (100 perc) is black - let color = gradientPicker?.colorForPercentage(percentage).withAlphaComponent(0.6) ?? {print("No gradient picker, defaulting to black"); return UIColor.black}() - return ChartBarModel(constant: ChartAxisValueDouble(Double(index)), axisValue1: zero, axisValue2: ChartAxisValueDouble(Double(tuple.val)), bgColor: color) - } - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let labelsGenerator = ChartAxisLabelsGeneratorFunc {scalar in - return ChartAxisLabel(text: "\(scalar)", settings: labelSettings) - } - let xGenerator = ChartAxisGeneratorMultiplier(20) - - let xModel = ChartAxisModel(firstModelValue: -80, lastModelValue: 80, axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: labelSettings)], axisValuesGenerator: xGenerator, labelsGenerator: labelsGenerator) - - let yValues = [ChartAxisValueString(order: -1)] + vals.enumerated().map {index, tuple in ChartAxisValueString(tuple.0, order: index, labelSettings: labelSettings)} + [ChartAxisValueString(order: vals.count)] - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - - // calculate coords space in the background to keep UI smooth - DispatchQueue.global(qos: .background).async { - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftTopSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - - DispatchQueue.main.async { - - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let barViewSettings = ChartBarViewSettings(animDuration: 0.5, selectionViewUpdater: ChartViewSelectorBrightness(selectedFactor: 0.5)) - let barsLayer = ChartBarsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, bars: bars, horizontal: true, barWidth: Env.iPad ? 40 : 16, settings: barViewSettings) - - let settings = ChartGuideLinesLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, axis: .x, settings: settings) - - // create x zero guideline as view to be in front of the bars - let dummyZeroXChartPoint = ChartPoint(x: ChartAxisValueDouble(0), y: ChartAxisValueDouble(0)) - let xZeroGuidelineLayer = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: [dummyZeroXChartPoint], viewGenerator: {(chartPointModel, layer, chart) -> UIView? in - let width: CGFloat = 2 - let v = UIView(frame: CGRect(x: chartPointModel.screenLoc.x - width / 2, y: chart.contentView.bounds.origin.y, width: width, height: innerFrame.size.height)) - v.backgroundColor = UIColor(red: 1, green: 69 / 255, blue: 0, alpha: 1) - return v - }) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - barsLayer, - xZeroGuidelineLayer - ] - ) - - self.view.addSubview(chart.view) - self.chart = chart - } - } - } - - fileprivate class GradientPicker { - - let gradientImg: UIImage - - lazy private(set) var imgData: UnsafePointer? = { - let pixelData = self.gradientImg.cgImage?.dataProvider?.data - return CFDataGetBytePtr(pixelData) - }() - - init?(width: CGFloat) { - - let gradient: CAGradientLayer = CAGradientLayer() - gradient.frame = CGRect(x: 0, y: 0, width: width, height: 1) - gradient.colors = [UIColor.red.cgColor, UIColor.yellow.cgColor, UIColor.cyan.cgColor, UIColor.blue.cgColor] - gradient.startPoint = CGPoint(x: 0, y: 0.5) - gradient.endPoint = CGPoint(x: 1.0, y: 0.5) - - let imgHeight = 1 - let imgWidth = Int(gradient.bounds.size.width) - - let bitmapBytesPerRow = imgWidth * 4 - - let colorSpace = CGColorSpaceCreateDeviceRGB() - let bitmapInfo = CGBitmapInfo(rawValue: CGImageAlphaInfo.premultipliedLast.rawValue).rawValue - - guard let context = CGContext(data: nil, - width: imgWidth, - height: imgHeight, - bitsPerComponent: 8, - bytesPerRow: bitmapBytesPerRow, - space: colorSpace, - bitmapInfo: bitmapInfo) else { - print("Couldn't create context") - return nil - } - - UIGraphicsBeginImageContext(gradient.bounds.size) - gradient.render(in: context) - - guard let gradientImg = (context.makeImage().map{UIImage(cgImage: $0)}) else { - print("Couldn't create image") - UIGraphicsEndImageContext() - return nil - } - - UIGraphicsEndImageContext() - self.gradientImg = gradientImg - } - - func colorForPercentage(_ percentage: CGFloat) -> UIColor { - guard let data = imgData else {print("Couldn't get imgData, returning black"); return UIColor.black} - - let xNotRounded = gradientImg.size.width * percentage - let x = 4 * (floor(abs(xNotRounded / 4))) - let pixelIndex = Int(x * 4) - - let color = UIColor( - red: CGFloat(data[pixelIndex + 0]) / 255.0, - green: CGFloat(data[pixelIndex + 1]) / 255.0, - blue: CGFloat(data[pixelIndex + 2]) / 255.0, - alpha: CGFloat(data[pixelIndex + 3]) / 255.0 - ) - return color - } - - required init(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - } -} - - - - - diff --git a/Dependecies/SwiftCharts/Examples/Examples/BubbleExample.swift b/Dependecies/SwiftCharts/Examples/Examples/BubbleExample.swift deleted file mode 100644 index ac522eafe..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/BubbleExample.swift +++ /dev/null @@ -1,232 +0,0 @@ -// -// ScatterExample.swift -// Examples -// -// Created by ischuetz on 16/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import CoreGraphics -import SwiftCharts - -class BubbleExample: UIViewController { - - fileprivate var chart: Chart? - - fileprivate let colorBarHeight: CGFloat = 50 - - fileprivate let useViewsLayer = true - - override func viewDidLoad() { - super.viewDidLoad() - - let frame = ExamplesDefaults.chartFrame(view.bounds) - let chartFrame = CGRect(x: frame.origin.x, y: frame.origin.y, width: frame.size.width, height: frame.size.height - colorBarHeight) - let colorBar = ColorBar(frame: CGRect(x: 0, y: chartFrame.origin.y + chartFrame.size.height, width: view.frame.size.width, height: colorBarHeight), c1: UIColor.red, c2: UIColor.green) - view.addSubview(colorBar) - - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - func toColor(_ percentage: Double) -> UIColor { - return colorBar.colorForPercentage(percentage).withAlphaComponent(0.6) - } - - let rawData: [(Double, Double, Double, UIColor)] = [ - (2, 2, 100, toColor(0)), - (2.1, 5, 250, toColor(0)), - (4, 4, 200, toColor(0.2)), - (2.3, 5, 150, toColor(0.7)), - (6, 7, 120, toColor(0.9)), - (8, 3, 50, toColor(1)), - (2, 4.5, 80, toColor(0.7)), - (2, 5.2, 50, toColor(0.4)), - (2, 4, 100, toColor(0.3)), - (2.7, 5.5, 200, toColor(0.5)), - (1.7, 2.8, 150, toColor(0.7)), - (4.4, 8, 120, toColor(0.9)), - (5, 6.3, 250, toColor(1)), - (6, 8, 100, toColor(0)), - (4, 8.5, 200, toColor(0.5)), - (8, 5, 200, toColor(0.6)), - (8.5, 10, 150, toColor(0.7)), - (9, 11, 120, toColor(0.6)), - (10, 6, 100, toColor(1)), - (11, 7, 100, toColor(0)), - (11, 4, 200, toColor(0.5)), - (11.5, 10, 150, toColor(0.7)), - (12, 7, 120, toColor(0.9)), - (12, 9, 250, toColor(0.8)) - ] - - let chartPoints: [ChartPointBubble] = rawData.map{ChartPointBubble(x: ChartAxisValueDouble($0, labelSettings: labelSettings), y: ChartAxisValueDouble($1), diameterScalar: $2, bgColor: $3)} - - let xValues = stride(from: -2, through: 14, by: 2).map {ChartAxisValueInt($0, labelSettings: labelSettings)} - let yValues = stride(from: -2, through: 12, by: 2).map {ChartAxisValueInt($0, labelSettings: labelSettings)} - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let bubbleLayer = bubblesLayer(xAxisLayer, yAxisLayer: yAxisLayer, chartInnerFrame: innerFrame, chartPoints: chartPoints) - - let guidelinesLayerSettings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: guidelinesLayerSettings) - - let guidelinesHighlightLayerSettings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.red, linesWidth: 1, dotWidth: 4, dotSpacing: 4) - let guidelinesHighlightLayer = ChartGuideLinesForValuesDottedLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, settings: guidelinesHighlightLayerSettings, axisValuesX: [ChartAxisValueDouble(0)], axisValuesY: [ChartAxisValueDouble(0)]) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - guidelinesHighlightLayer, - bubbleLayer - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } - - // We can use a view based layer for easy animation (or interactivity), in which case we use the default chart points layer with a generator to create bubble views. - // On the other side, if we don't need animation or want a better performance, we use ChartPointsBubbleLayer, which instead of creating views, renders directly to the chart's context. - fileprivate func bubblesLayer(_ xAxisLayer: ChartAxisLayer, yAxisLayer: ChartAxisLayer, chartInnerFrame: CGRect, chartPoints: [ChartPointBubble]) -> ChartLayer { - - let maxBubbleDiameter: Double = 30, minBubbleDiameter: Double = 2 - - if useViewsLayer == true { - - let (minDiameterScalar, maxDiameterScalar): (Double, Double) = chartPoints.reduce((min: 0, max: 0)) {tuple, chartPoint in - (min: min(tuple.min, chartPoint.diameterScalar), max: max(tuple.max, chartPoint.diameterScalar)) - } - - let diameterFactor = (maxBubbleDiameter - minBubbleDiameter) / (maxDiameterScalar - minDiameterScalar) - - return ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints, viewGenerator: {(chartPointModel, layer, chart) -> UIView? in - - let diameter = CGFloat(chartPointModel.chartPoint.diameterScalar * diameterFactor) - - let circleView = ChartPointEllipseView(center: chartPointModel.screenLoc, diameter: diameter) - circleView.fillColor = chartPointModel.chartPoint.bgColor - circleView.borderColor = UIColor.black.withAlphaComponent(0.6) - circleView.borderWidth = 1 - - circleView.animDelay = Float(chartPointModel.index) * 0.2 - circleView.animDuration = 1.2 - circleView.animDamping = 0.4 - circleView.animInitSpringVelocity = 0.5 - - return circleView - }) - - } else { - return ChartPointsBubbleLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints) - } - } - - class ColorBar: UIView { - - let dividers: [CGFloat] - - let gradientImg: UIImage - - lazy private(set) var imgData: UnsafePointer = { - let provider = self.gradientImg.cgImage!.dataProvider - let pixelData = provider!.data - return CFDataGetBytePtr(pixelData) - }() - - init(frame: CGRect, c1: UIColor, c2: UIColor) { - - let gradient: CAGradientLayer = CAGradientLayer() - gradient.frame = CGRect(x: 0, y: 0, width: frame.width, height: 30) - gradient.colors = [UIColor.blue.cgColor, UIColor.cyan.cgColor, UIColor.yellow.cgColor, UIColor.red.cgColor] - gradient.startPoint = CGPoint(x: 0, y: 0.5) - gradient.endPoint = CGPoint(x: 1.0, y: 0.5) - - - let imgHeight = 1 - let imgWidth = Int(gradient.bounds.size.width) - - let bitmapBytesPerRow = imgWidth * 4 - - let colorSpace = CGColorSpaceCreateDeviceRGB() - let bitmapInfo = CGBitmapInfo(rawValue: CGImageAlphaInfo.premultipliedLast.rawValue).rawValue - - let context = CGContext (data: nil, - width: imgWidth, - height: imgHeight, - bitsPerComponent: 8, - bytesPerRow: bitmapBytesPerRow, - space: colorSpace, - bitmapInfo: bitmapInfo) - - UIGraphicsBeginImageContext(gradient.bounds.size) - gradient.render(in: context!) - - let gradientImg = UIImage(cgImage: context!.makeImage()!) - - UIGraphicsEndImageContext() - self.gradientImg = gradientImg - - let segmentSize = gradient.frame.size.width / 6 - dividers = Array(stride(from: segmentSize, through: gradient.frame.size.width, by: segmentSize)) - - super.init(frame: frame) - - layer.insertSublayer(gradient, at: 0) - - let numberFormatter = NumberFormatter() - numberFormatter.maximumFractionDigits = 2 - - for x in stride(from: segmentSize, through: gradient.frame.size.width - 1, by: segmentSize) { - - let dividerW: CGFloat = 1 - let divider = UIView(frame: CGRect(x: x - dividerW / 2, y: 25, width: dividerW, height: 5)) - divider.backgroundColor = UIColor.black - addSubview(divider) - - let text = "\(numberFormatter.string(from: NSNumber(value: Float(x / gradient.frame.size.width)))!)" - let labelWidth = text.width(ExamplesDefaults.labelFont) - let label = UILabel() - label.center = CGPoint(x: x - labelWidth / 2, y: 30) - label.font = ExamplesDefaults.labelFont - label.text = text - label.sizeToFit() - - addSubview(label) - } - } - - func colorForPercentage(_ percentage: Double) -> UIColor { - - let data = imgData - - let xNotRounded = gradientImg.size.width * CGFloat(percentage) - let x = 4 * (floor(abs(xNotRounded / 4))) - let pixelIndex = Int(x * 4) - - let color = UIColor( - red: CGFloat(data[pixelIndex + 0]) / 255.0, - green: CGFloat(data[pixelIndex + 1]) / 255.0, - blue: CGFloat(data[pixelIndex + 2]) / 255.0, - alpha: CGFloat(data[pixelIndex + 3]) / 255.0 - ) - return color - } - - required init(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/CandleStickExample.swift b/Dependecies/SwiftCharts/Examples/Examples/CandleStickExample.swift deleted file mode 100644 index d4030d249..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/CandleStickExample.swift +++ /dev/null @@ -1,132 +0,0 @@ -// -// CandleStickExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class CandleStickExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - var readFormatter = DateFormatter() - readFormatter.dateFormat = "dd.MM.yyyy" - - var displayFormatter = DateFormatter() - displayFormatter.dateFormat = "MMM dd" - - let date = {(str: String) -> Date in - return readFormatter.date(from: str)! - } - - let calendar = Calendar.current - - let dateWithComponents = {(day: Int, month: Int, year: Int) -> Date in - var components = DateComponents() - components.day = day - components.month = month - components.year = year - return calendar.date(from: components)! - } - - func filler(_ date: Date) -> ChartAxisValueDate { - let filler = ChartAxisValueDate(date: date, formatter: displayFormatter) - filler.hidden = true - return filler - } - - let chartPoints = [ - ChartPointCandleStick(date: date("01.10.2015"), formatter: displayFormatter, high: 40, low: 37, open: 39.5, close: 39), - ChartPointCandleStick(date: date("02.10.2015"), formatter: displayFormatter, high: 39.8, low: 38, open: 39.5, close: 38.4), - ChartPointCandleStick(date: date("03.10.2015"), formatter: displayFormatter, high: 43, low: 39, open: 41.5, close: 42.5), - ChartPointCandleStick(date: date("04.10.2015"), formatter: displayFormatter, high: 48, low: 42, open: 44.6, close: 44.5), - ChartPointCandleStick(date: date("05.10.2015"), formatter: displayFormatter, high: 45, low: 41.6, open: 43, close: 44), - ChartPointCandleStick(date: date("06.10.2015"), formatter: displayFormatter, high: 46, low: 42.6, open: 44, close: 46), - ChartPointCandleStick(date: date("07.10.2015"), formatter: displayFormatter, high: 47.5, low: 41, open: 42, close: 45.5), - ChartPointCandleStick(date: date("08.10.2015"), formatter: displayFormatter, high: 50, low: 46, open: 46, close: 49), - ChartPointCandleStick(date: date("09.10.2015"), formatter: displayFormatter, high: 45, low: 41, open: 44, close: 43.5), - ChartPointCandleStick(date: date("11.10.2015"), formatter: displayFormatter, high: 47, low: 35, open: 45, close: 39), - ChartPointCandleStick(date: date("12.10.2015"), formatter: displayFormatter, high: 45, low: 33, open: 44, close: 40), - ChartPointCandleStick(date: date("13.10.2015"), formatter: displayFormatter, high: 43, low: 36, open: 41, close: 38), - ChartPointCandleStick(date: date("14.10.2015"), formatter: displayFormatter, high: 42, low: 31, open: 38, close: 39), - ChartPointCandleStick(date: date("15.10.2015"), formatter: displayFormatter, high: 39, low: 34, open: 37, close: 36), - ChartPointCandleStick(date: date("16.10.2015"), formatter: displayFormatter, high: 35, low: 32, open: 34, close: 33.5), - ChartPointCandleStick(date: date("17.10.2015"), formatter: displayFormatter, high: 32, low: 29, open: 31.5, close: 31), - ChartPointCandleStick(date: date("18.10.2015"), formatter: displayFormatter, high: 31, low: 29.5, open: 29.5, close: 30), - ChartPointCandleStick(date: date("19.10.2015"), formatter: displayFormatter, high: 29, low: 25, open: 25.5, close: 25), - ChartPointCandleStick(date: date("20.10.2015"), formatter: displayFormatter, high: 28, low: 24, open: 26.7, close: 27.5), - ChartPointCandleStick(date: date("21.10.2015"), formatter: displayFormatter, high: 28.5, low: 25.3, open: 26, close: 27), - ChartPointCandleStick(date: date("22.10.2015"), formatter: displayFormatter, high: 30, low: 28, open: 28, close: 30), - ChartPointCandleStick(date: date("25.10.2015"), formatter: displayFormatter, high: 31, low: 29, open: 31, close: 31), - ChartPointCandleStick(date: date("26.10.2015"), formatter: displayFormatter, high: 31.5, low: 29.2, open: 29.6, close: 29.6), - ChartPointCandleStick(date: date("27.10.2015"), formatter: displayFormatter, high: 30, low: 27, open: 29, close: 28.5), - ChartPointCandleStick(date: date("28.10.2015"), formatter: displayFormatter, high: 32, low: 30, open: 31, close: 30.6), - ChartPointCandleStick(date: date("29.10.2015"), formatter: displayFormatter, high: 35, low: 31, open: 31, close: 33) - ] - - let yValues = stride(from: 20, through: 55, by: 5).map {ChartAxisValueDouble(Double($0), labelSettings: labelSettings)} - - // Static x axis dates - alternative to using generators -// func generateDateAxisValues(month: Int, year: Int) -> [ChartAxisValueDate] { -// let date = dateWithComponents(1, month, year) -// let calendar = NSCalendar.currentCalendar() -// let monthDays = calendar.rangeOfUnit(.Day, inUnit: .Month, forDate: date) -// return Array(monthDays.toRange()!).map {day in -// let date = dateWithComponents(day, month, year) -// let axisValue = ChartAxisValueDate(date: date, formatter: displayFormatter, labelSettings: labelSettings) -// axisValue.hidden = !(day % 5 == 0) -// return axisValue -// } -// } -// let xValues = generateDateAxisValues(10, year: 2015) -// let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - - - let xGeneratorDate = ChartAxisValuesGeneratorDate(unit: .day, preferredDividers:2, minSpace: 1, maxTextSize: 12) - let xLabelGeneratorDate = ChartAxisLabelsGeneratorDate(labelSettings: labelSettings, formatter: displayFormatter) - let firstDate = date("01.10.2015") - let lastDate = date("31.10.2015") - let xModel = ChartAxisModel(firstModelValue: firstDate.timeIntervalSince1970, lastModelValue: lastDate.timeIntervalSince1970, axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: labelSettings)], axisValuesGenerator: xGeneratorDate, labelsGenerator: xLabelGeneratorDate) - - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - - let chartSettings = ExamplesDefaults.chartSettings // for now zoom & pan disabled, layer needs correct scaling mode. - - let coordsSpace = ChartCoordsSpaceRightBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let chartPointsLineLayer = ChartCandleStickLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints, itemWidth: Env.iPad ? 10 : 5, strokeWidth: Env.iPad ? 1 : 0.6, increasingColor: UIColor.green, decreasingColor: UIColor.red) - - let settings = ChartGuideLinesLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - let dividersSettings = ChartDividersLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth, start: Env.iPad ? 7 : 3, end: 0) - let dividersLayer = ChartDividersLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: dividersSettings) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - dividersLayer, - chartPointsLineLayer - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/CandleStickInteractiveExample.swift b/Dependecies/SwiftCharts/Examples/Examples/CandleStickInteractiveExample.swift deleted file mode 100644 index 82ac036eb..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/CandleStickInteractiveExample.swift +++ /dev/null @@ -1,322 +0,0 @@ -// -// CandleStickInteractiveExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class CandleStickInteractiveExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - var readFormatter = DateFormatter() - readFormatter.dateFormat = "dd.MM.yyyy" - - var displayFormatter = DateFormatter() - displayFormatter.dateFormat = "MMM dd" - - let date = {(str: String) -> Date in - return readFormatter.date(from: str)! - } - - let calendar = Calendar.current - - let dateWithComponents = {(day: Int, month: Int, year: Int) -> Date in - var components = DateComponents() - components.day = day - components.month = month - components.year = year - return calendar.date(from: components)! - } - - func filler(_ date: Date) -> ChartAxisValueDate { - let filler = ChartAxisValueDate(date: date, formatter: displayFormatter) - filler.hidden = true - return filler - } - - let chartPoints = [ - ChartPointCandleStick(date: date("01.10.2015"), formatter: displayFormatter, high: 40, low: 37, open: 39.5, close: 39), - ChartPointCandleStick(date: date("02.10.2015"), formatter: displayFormatter, high: 39.8, low: 38, open: 39.5, close: 38.4), - ChartPointCandleStick(date: date("03.10.2015"), formatter: displayFormatter, high: 43, low: 39, open: 41.5, close: 42.5), - ChartPointCandleStick(date: date("04.10.2015"), formatter: displayFormatter, high: 48, low: 42, open: 44.6, close: 44.5), - ChartPointCandleStick(date: date("05.10.2015"), formatter: displayFormatter, high: 45, low: 41.6, open: 43, close: 44), - ChartPointCandleStick(date: date("06.10.2015"), formatter: displayFormatter, high: 46, low: 42.6, open: 44, close: 46), - ChartPointCandleStick(date: date("07.10.2015"), formatter: displayFormatter, high: 47.5, low: 41, open: 42, close: 45.5), - ChartPointCandleStick(date: date("08.10.2015"), formatter: displayFormatter, high: 50, low: 46, open: 46, close: 49), - ChartPointCandleStick(date: date("09.10.2015"), formatter: displayFormatter, high: 45, low: 41, open: 44, close: 43.5), - ChartPointCandleStick(date: date("11.10.2015"), formatter: displayFormatter, high: 47, low: 35, open: 45, close: 39), - ChartPointCandleStick(date: date("12.10.2015"), formatter: displayFormatter, high: 45, low: 33, open: 44, close: 40), - ChartPointCandleStick(date: date("13.10.2015"), formatter: displayFormatter, high: 43, low: 36, open: 41, close: 38), - ChartPointCandleStick(date: date("14.10.2015"), formatter: displayFormatter, high: 42, low: 31, open: 38, close: 39), - ChartPointCandleStick(date: date("15.10.2015"), formatter: displayFormatter, high: 39, low: 34, open: 37, close: 36), - ChartPointCandleStick(date: date("16.10.2015"), formatter: displayFormatter, high: 35, low: 32, open: 34, close: 33.5), - ChartPointCandleStick(date: date("17.10.2015"), formatter: displayFormatter, high: 32, low: 29, open: 31.5, close: 31), - ChartPointCandleStick(date: date("18.10.2015"), formatter: displayFormatter, high: 31, low: 29.5, open: 29.5, close: 30), - ChartPointCandleStick(date: date("19.10.2015"), formatter: displayFormatter, high: 29, low: 25, open: 25.5, close: 25), - ChartPointCandleStick(date: date("20.10.2015"), formatter: displayFormatter, high: 28, low: 24, open: 26.7, close: 27.5), - ChartPointCandleStick(date: date("21.10.2015"), formatter: displayFormatter, high: 28.5, low: 25.3, open: 26, close: 27), - ChartPointCandleStick(date: date("22.10.2015"), formatter: displayFormatter, high: 30, low: 28, open: 28, close: 30), - ChartPointCandleStick(date: date("25.10.2015"), formatter: displayFormatter, high: 31, low: 29, open: 31, close: 31), - ChartPointCandleStick(date: date("26.10.2015"), formatter: displayFormatter, high: 31.5, low: 29.2, open: 29.6, close: 29.6), - ChartPointCandleStick(date: date("27.10.2015"), formatter: displayFormatter, high: 30, low: 27, open: 29, close: 28.5), - ChartPointCandleStick(date: date("28.10.2015"), formatter: displayFormatter, high: 32, low: 30, open: 31, close: 30.6), - ChartPointCandleStick(date: date("29.10.2015"), formatter: displayFormatter, high: 35, low: 31, open: 31, close: 33) - ] - - func generateDateAxisValues(_ month: Int, year: Int) -> [ChartAxisValueDate] { - let date = dateWithComponents(1, month, year) - let calendar = Calendar.current - let monthDays = calendar.range(of: .day, in: .month, for: date)! - - return monthDays.map {day in - let date = dateWithComponents(day, month, year) - let axisValue = ChartAxisValueDate(date: date, formatter: displayFormatter, labelSettings: labelSettings) - axisValue.hidden = !(day % 5 == 0) - return axisValue - } - } - - let xValues = generateDateAxisValues(10, year: 2015) - let yValues = stride(from: 20, through: 55, by: 5).map {ChartAxisValueDouble(Double($0), labelSettings: labelSettings)} - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - - let defaultChartFrame = ExamplesDefaults.chartFrame(view.bounds) - let infoViewHeight: CGFloat = 50 - let chartFrame = CGRect(x: defaultChartFrame.origin.x, y: defaultChartFrame.origin.y + infoViewHeight, width: defaultChartFrame.width, height: defaultChartFrame.height - infoViewHeight) - - let chartSettings = ExamplesDefaults.chartSettings - - let coordsSpace = ChartCoordsSpaceRightBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let viewGenerator = {(chartPointModel: ChartPointLayerModel, layer: ChartPointsViewsLayer, chart: Chart) -> ChartCandleStickView? in - let (chartPoint, screenLoc) = (chartPointModel.chartPoint, chartPointModel.screenLoc) - - let x = screenLoc.x - - let highScreenY = screenLoc.y - let lowScreenY = layer.modelLocToScreenLoc(x: Double(x), y: Double(chartPoint.low)).y - let openScreenY = layer.modelLocToScreenLoc(x: Double(x), y: Double(chartPoint.open)).y - let closeScreenY = layer.modelLocToScreenLoc(x: Double(x), y: Double(chartPoint.close)).y - - let (rectTop, rectBottom, fillColor) = closeScreenY < openScreenY ? (closeScreenY, openScreenY, UIColor.white) : (openScreenY, closeScreenY, UIColor.black) - let v = ChartCandleStickView(lineX: screenLoc.x, width: Env.iPad ? 10 : 5, top: highScreenY, bottom: lowScreenY, innerRectTop: rectTop, innerRectBottom: rectBottom, fillColor: fillColor, strokeWidth: Env.iPad ? 1 : 0.5) - v.isUserInteractionEnabled = false - return v - } - let candleStickLayer = ChartPointsCandleStickViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, innerFrame: innerFrame, chartPoints: chartPoints, viewGenerator: viewGenerator) - - - let infoView = InfoWithIntroView(frame: CGRect(x: 10, y: 70, width: view.frame.size.width, height: infoViewHeight)) - view.addSubview(infoView) - - let trackerLayer = ChartPointsTrackerLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints, locChangedFunc: {[weak candleStickLayer, weak infoView] screenLoc in - candleStickLayer?.highlightChartpointView(screenLoc: screenLoc) - if let chartPoint = candleStickLayer?.chartPointsForScreenLocX(screenLoc.x).first { - infoView?.showChartPoint(chartPoint) - } else { - infoView?.clear() - } - }, lineColor: UIColor.red, lineWidth: Env.iPad ? 1 : 0.6) - - - let settings = ChartGuideLinesLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - let dividersSettings = ChartDividersLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth, start: Env.iPad ? 7 : 3, end: 0) - let dividersLayer = ChartDividersLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: dividersSettings) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - dividersLayer, - candleStickLayer, - trackerLayer - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } - -} - - -private class InfoView: UIView { - - let statusView: UIView - - let dateLabel: UILabel - let lowTextLabel: UILabel - let highTextLabel: UILabel - let openTextLabel: UILabel - let closeTextLabel: UILabel - - let lowLabel: UILabel - let highLabel: UILabel - let openLabel: UILabel - let closeLabel: UILabel - - override init(frame: CGRect) { - - let itemHeight: CGFloat = 40 - let y = (frame.height - itemHeight) / CGFloat(2) - - statusView = UIView(frame: CGRect(x: 0, y: y, width: itemHeight, height: itemHeight)) - statusView.layer.borderColor = UIColor.black.cgColor - statusView.layer.borderWidth = 1 - statusView.layer.cornerRadius = Env.iPad ? 13 : 8 - - let font = ExamplesDefaults.labelFont - - dateLabel = UILabel() - dateLabel.font = font - - lowTextLabel = UILabel() - lowTextLabel.text = "Low:" - lowTextLabel.font = font - lowLabel = UILabel() - lowLabel.font = font - - highTextLabel = UILabel() - highTextLabel.text = "High:" - highTextLabel.font = font - highLabel = UILabel() - highLabel.font = font - - openTextLabel = UILabel() - openTextLabel.text = "Open:" - openTextLabel.font = font - openLabel = UILabel() - openLabel.font = font - - closeTextLabel = UILabel() - closeTextLabel.text = "Close:" - closeTextLabel.font = font - closeLabel = UILabel() - closeLabel.font = font - - super.init(frame: frame) - - addSubview(statusView) - addSubview(dateLabel) - addSubview(lowTextLabel) - addSubview(lowLabel) - addSubview(highTextLabel) - addSubview(highLabel) - addSubview(openTextLabel) - addSubview(openLabel) - addSubview(closeTextLabel) - addSubview(closeLabel) - } - - fileprivate override func didMoveToSuperview() { - - let views = [statusView, dateLabel, highTextLabel, highLabel, lowTextLabel, lowLabel, openTextLabel, openLabel, closeTextLabel, closeLabel] - for v in views { - v.translatesAutoresizingMaskIntoConstraints = false - } - - let namedViews = views.enumerated().map{index, view in - ("v\(index)", view) - } - - var viewsDict = Dictionary() - for namedView in namedViews { - viewsDict[namedView.0] = namedView.1 - } - - let circleDiameter: CGFloat = Env.iPad ? 26 : 15 - let labelsSpace: CGFloat = Env.iPad ? 10 : 5 - - let hConstraintStr = namedViews[1.. chartPoint.close ? UIColor.black : UIColor.white - statusView.backgroundColor = color - dateLabel.text = chartPoint.x.labels.first?.text ?? "" - lowLabel.text = "\(chartPoint.low)" - highLabel.text = "\(chartPoint.high)" - openLabel.text = "\(chartPoint.open)" - closeLabel.text = "\(chartPoint.close)" - } - - func clear() { - statusView.backgroundColor = UIColor.clear - } -} - - -private class InfoWithIntroView: UIView { - - var introView: UIView! - var infoView: InfoView! - - override init(frame: CGRect) { - super.init(frame: frame) - } - - fileprivate override func didMoveToSuperview() { - let label = UILabel(frame: CGRect(x: 0, y: bounds.origin.y, width: bounds.width, height: bounds.height)) - label.text = "Drag the line to see chartpoint data" - label.font = ExamplesDefaults.labelFont - label.backgroundColor = UIColor.white - introView = label - - infoView = InfoView(frame: bounds) - - addSubview(infoView) - addSubview(introView) - } - - required init(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - fileprivate func animateIntroAlpha(_ alpha: CGFloat) { - UIView.animate(withDuration: 0.1, animations: { - self.introView.alpha = alpha - }) - } - - func showChartPoint(_ chartPoint: ChartPointCandleStick) { - animateIntroAlpha(0) - infoView.showChartPoint(chartPoint) - } - - func clear() { - animateIntroAlpha(1) - infoView.clear() - } -} - diff --git a/Dependecies/SwiftCharts/Examples/Examples/Convenience/ConvenienceBarsExample.swift b/Dependecies/SwiftCharts/Examples/Examples/Convenience/ConvenienceBarsExample.swift deleted file mode 100644 index fe02b39ed..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/Convenience/ConvenienceBarsExample.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// ConvenienceBarsExample.swift -// Examples -// -// Created by ischuetz on 19/07/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class ConvenienceBarsExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let chartConfig = BarsChartConfig( - chartSettings: ExamplesDefaults.chartSettingsWithPanZoom, - valsAxisConfig: ChartAxisConfig(from: 0, to: 8, by: 2), - xAxisLabelSettings: ExamplesDefaults.labelSettings, - yAxisLabelSettings: ExamplesDefaults.labelSettings.defaultVertical() - ) - - let chart = BarsChart( - frame: ExamplesDefaults.chartFrame(view.bounds), - chartConfig: chartConfig, - xTitle: "X axis", - yTitle: "Y axis", - bars: [ - ("A", 2), - ("B", 4.5), - ("C", 3), - ("D", 5.4), - ("E", 6.8), - ("F", 0.5) - ], - color: UIColor.red, - barWidth: Env.iPad ? 40 : 20 - ) - - view.addSubview(chart.view) - self.chart = chart - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/Convenience/ConvenienceLinesExample.swift b/Dependecies/SwiftCharts/Examples/Examples/Convenience/ConvenienceLinesExample.swift deleted file mode 100644 index bc395be58..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/Convenience/ConvenienceLinesExample.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// ConvenienceLinesExample.swift -// Examples -// -// Created by ischuetz on 19/07/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class ConvenienceLinesExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let chartConfig = ChartConfigXY( - chartSettings: ExamplesDefaults.chartSettingsWithPanZoom, - xAxisConfig: ChartAxisConfig(from: 2, to: 14, by: 2), - yAxisConfig: ChartAxisConfig(from: 0, to: 14, by: 2), - xAxisLabelSettings: ExamplesDefaults.labelSettings, - yAxisLabelSettings: ExamplesDefaults.labelSettings.defaultVertical() - ) - - let chart = LineChart( - frame: ExamplesDefaults.chartFrame(view.bounds), - chartConfig: chartConfig, - xTitle: "X axis", - yTitle: "Y axis", - lines: [ - (chartPoints: [(2.0, 10.6), (4.2, 5.1), (7.3, 3.0), (8.1, 5.5), (14.0, 8.0)], color: UIColor.red), - (chartPoints: [(2.0, 2.6), (4.2, 4.1), (7.3, 1.0), (8.1, 11.5), (14.0, 3.0)], color: UIColor.blue) - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/CoordsExample.swift b/Dependecies/SwiftCharts/Examples/Examples/CoordsExample.swift deleted file mode 100644 index 5c45ae7e5..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/CoordsExample.swift +++ /dev/null @@ -1,127 +0,0 @@ -// -// CoordsExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class CoordsExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let chartPoints = [(2, 2), (3, 1), (5, 9), (6, 7), (8, 10), (9, 9), (10, 15), (13, 8), (15, 20), (16, 17)].map{ChartPoint(x: ChartAxisValueInt($0.0), y: ChartAxisValueInt($0.1))} - - let xValues = ChartAxisValuesStaticGenerator.generateXAxisValuesWithChartPoints(chartPoints, minSegmentCount: 7, maxSegmentCount: 7, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: labelSettings)}, addPaddingSegmentIfEdge: false) - let yValues = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: labelSettings)}, addPaddingSegmentIfEdge: true) - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - - var chartSettings = ExamplesDefaults.chartSettings // for now no zooming and panning here until ChartShowCoordsLinesLayer is improved to not scale the lines during zooming. - chartSettings.trailing = 20 - chartSettings.labelsToAxisSpacingX = 15 - chartSettings.labelsToAxisSpacingY = 15 - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - - let labelWidth: CGFloat = 70 - let labelHeight: CGFloat = 30 - - let showCoordsTextViewsGenerator = {(chartPointModel: ChartPointLayerModel, layer: ChartPointsLayer, chart: Chart) -> UIView? in - let (chartPoint, screenLoc) = (chartPointModel.chartPoint, chartPointModel.screenLoc) - let text = chartPoint.description - let font = ExamplesDefaults.labelFont - let x = min(screenLoc.x + 5, chart.bounds.width - text.width(font) - 5) - let view = UIView(frame: CGRect(x: x, y: screenLoc.y - labelHeight, width: labelWidth, height: labelHeight)) - let label = UILabel(frame: view.bounds) - label.text = text - label.font = ExamplesDefaults.labelFont - view.addSubview(label) - view.alpha = 0 - - UIView.animate(withDuration: 0.2, delay: 0, options: .curveEaseOut, animations: { - view.alpha = 1 - }, completion: nil) - - return view - } - - let showCoordsLinesLayer = ChartShowCoordsLinesLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints) - - let showCoordsTextLayer = ChartPointsSingleViewLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, innerFrame: innerFrame, chartPoints: chartPoints, viewGenerator: showCoordsTextViewsGenerator, mode: .custom, keepOnFront: true) - // To preserve the offset of the notification views from the chart point they represent, during transforms, we need to pass mode: .custom along with this custom transformer. - showCoordsTextLayer.customTransformer = {(model, view, layer) -> Void in - guard let chart = layer.chart else {return} - - let text = model.chartPoint.description - - let screenLoc = layer.modelLocToScreenLoc(x: model.chartPoint.x.scalar, y: model.chartPoint.y.scalar) - let x = min(screenLoc.x + 5, chart.bounds.width - text.width(ExamplesDefaults.labelFont) - 5) - - view.frame.origin = CGPoint(x: x, y: screenLoc.y - labelHeight) - } - - let touchViewsGenerator = {(chartPointModel: ChartPointLayerModel, layer: ChartPointsLayer, chart: Chart) -> UIView? in - let (chartPoint, screenLoc) = (chartPointModel.chartPoint, chartPointModel.screenLoc) - let s: CGFloat = 30 - let view = HandlingView(frame: CGRect(x: screenLoc.x - s/2, y: screenLoc.y - s/2, width: s, height: s)) - view.touchHandler = {[weak showCoordsLinesLayer, weak showCoordsTextLayer, weak chartPoint, weak chart] in - guard let chartPoint = chartPoint, let chart = chart else {return} - showCoordsLinesLayer?.showChartPointLines(chartPoint, chart: chart) - showCoordsTextLayer?.showView(chartPoint: chartPoint, chart: chart) - } - return view - } - - let touchLayer = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints, viewGenerator: touchViewsGenerator, mode: .translate, keepOnFront: true) - - let lineModel = ChartLineModel(chartPoints: chartPoints, lineColor: UIColor(red: 0.4, green: 0.4, blue: 1, alpha: 0.2), lineWidth: 3, animDuration: 0.7, animDelay: 0) - let chartPointsLineLayer = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [lineModel]) - - let circleViewGenerator = {(chartPointModel: ChartPointLayerModel, layer: ChartPointsLayer, chart: Chart) -> UIView? in - let circleView = ChartPointEllipseView(center: chartPointModel.screenLoc, diameter: 24) - circleView.animDuration = 1.5 - circleView.fillColor = UIColor.white - circleView.borderWidth = 5 - circleView.borderColor = UIColor.blue - return circleView - } - let chartPointsCircleLayer = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints, viewGenerator: circleViewGenerator, displayDelay: 0, delayBetweenItems: 0.05, mode: .translate) - - let settings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - showCoordsLinesLayer, - chartPointsLineLayer, - chartPointsCircleLayer, - showCoordsTextLayer, - touchLayer, - - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } - -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/CubicLinesExample.swift b/Dependecies/SwiftCharts/Examples/Examples/CubicLinesExample.swift deleted file mode 100644 index 47ff22e4e..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/CubicLinesExample.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// CubicLinesExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class CubicLinesExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let chartPoints = [(0, 0), (4, 4), (8, 11), (9, 2), (11, 10), (12, 3), (15, 18), (18, 10), (20, 15)].map{ChartPoint(x: ChartAxisValueInt($0.0, labelSettings: labelSettings), y: ChartAxisValueInt($0.1))} - - let xValues = chartPoints.map{$0.x} - let yValues = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: labelSettings)}, addPaddingSegmentIfEdge: false) - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let lineModel = ChartLineModel(chartPoints: chartPoints, lineColor: UIColor.purple, lineWidth: 2, animDuration: 1, animDelay: 0) - let chartPointsLineLayer = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [lineModel], pathGenerator: CatmullPathGenerator()) // || CubicLinePathGenerator - - let settings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - chartPointsLineLayer - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/CubicLinesWithGradientExample.swift b/Dependecies/SwiftCharts/Examples/Examples/CubicLinesWithGradientExample.swift deleted file mode 100644 index 9708f55c5..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/CubicLinesWithGradientExample.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// CubicLinesExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class CubicLinesWithGradientExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let chartPoints = [(0, 0), (4, 4), (8, 11), (9, 2), (11, 10), (12, 3), (15, 18), (18, 10), (20, 15)].map{ChartPoint(x: ChartAxisValueInt($0.0, labelSettings: labelSettings), y: ChartAxisValueInt($0.1))} - - let xValues = chartPoints.map{$0.x} - let yValues = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: labelSettings)}, addPaddingSegmentIfEdge: false) - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let lineModel = ChartLineModel(chartPoints: chartPoints, lineColors: [UIColor.yellow, UIColor.red], lineWidth: 2, animDuration: 1, animDelay: 0) - let chartPointsLineLayer = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [lineModel], pathGenerator: CatmullPathGenerator()) // || CubicLinePathGenerator - - let settings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - chartPointsLineLayer - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/CustomUnitsExample.swift b/Dependecies/SwiftCharts/Examples/Examples/CustomUnitsExample.swift deleted file mode 100644 index 7b31fa9a0..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/CustomUnitsExample.swift +++ /dev/null @@ -1,140 +0,0 @@ -// -// CustomUnitsExample.swift -// SwiftCharts -// -// Created by ischuetz on 05/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class CustomUnitsExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - var readFormatter = DateFormatter() - readFormatter.dateFormat = "dd.MM.yyyy" - - var displayFormatter = DateFormatter() - displayFormatter.dateFormat = "dd.MM.yyyy" - - let date = {(str: String) -> Date in - return readFormatter.date(from: str)! - } - - let calendar = Calendar.current - - let dateWithComponents = {(day: Int, month: Int, year: Int) -> Date in - var components = DateComponents() - components.day = day - components.month = month - components.year = year - return calendar.date(from: components)! - } - - func filler(_ date: Date) -> ChartAxisValueDate { - let filler = ChartAxisValueDate(date: date, formatter: displayFormatter) - filler.hidden = true - return filler - } - - let chartPoints = [ - createChartPoint(dateStr: "01.10.2015", percent: 5, readFormatter: readFormatter, displayFormatter: displayFormatter), - createChartPoint(dateStr: "04.10.2015", percent: 10, readFormatter: readFormatter, displayFormatter: displayFormatter), - createChartPoint(dateStr: "05.10.2015", percent: 30, readFormatter: readFormatter, displayFormatter: displayFormatter), - createChartPoint(dateStr: "06.10.2015", percent: 70, readFormatter: readFormatter, displayFormatter: displayFormatter), - createChartPoint(dateStr: "08.10.2015", percent: 79, readFormatter: readFormatter, displayFormatter: displayFormatter), - createChartPoint(dateStr: "10.10.2015", percent: 90, readFormatter: readFormatter, displayFormatter: displayFormatter), - createChartPoint(dateStr: "12.10.2015", percent: 47, readFormatter: readFormatter, displayFormatter: displayFormatter), - createChartPoint(dateStr: "14.10.2015", percent: 60, readFormatter: readFormatter, displayFormatter: displayFormatter), - createChartPoint(dateStr: "15.10.2015", percent: 70, readFormatter: readFormatter, displayFormatter: displayFormatter), - createChartPoint(dateStr: "16.10.2015", percent: 80, readFormatter: readFormatter, displayFormatter: displayFormatter), - createChartPoint(dateStr: "19.10.2015", percent: 90, readFormatter: readFormatter, displayFormatter: displayFormatter), - createChartPoint(dateStr: "21.10.2015", percent: 100, readFormatter: readFormatter, displayFormatter: displayFormatter) - ] - - let yValues = stride(from: 0, through: 100, by: 10).map {ChartAxisValuePercent($0, labelSettings: labelSettings)} - - let xValues = [ - createDateAxisValue("01.10.2015", readFormatter: readFormatter, displayFormatter: displayFormatter), - createDateAxisValue("03.10.2015", readFormatter: readFormatter, displayFormatter: displayFormatter), - createDateAxisValue("05.10.2015", readFormatter: readFormatter, displayFormatter: displayFormatter), - createDateAxisValue("07.10.2015", readFormatter: readFormatter, displayFormatter: displayFormatter), - createDateAxisValue("09.10.2015", readFormatter: readFormatter, displayFormatter: displayFormatter), - createDateAxisValue("11.10.2015", readFormatter: readFormatter, displayFormatter: displayFormatter), - createDateAxisValue("13.10.2015", readFormatter: readFormatter, displayFormatter: displayFormatter), - createDateAxisValue("15.10.2015", readFormatter: readFormatter, displayFormatter: displayFormatter), - createDateAxisValue("17.10.2015", readFormatter: readFormatter, displayFormatter: displayFormatter), - createDateAxisValue("19.10.2015", readFormatter: readFormatter, displayFormatter: displayFormatter), - createDateAxisValue("21.10.2015", readFormatter: readFormatter, displayFormatter: displayFormatter) - ] - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - var chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - chartSettings.trailing = 80 - - // Set a fixed (horizontal) scrollable area 2x than the original width, with zooming disabled. - chartSettings.zoomPan.maxZoomX = 2 - chartSettings.zoomPan.minZoomX = 2 - chartSettings.zoomPan.minZoomY = 1 - chartSettings.zoomPan.maxZoomY = 1 - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let lineModel = ChartLineModel(chartPoints: chartPoints, lineColor: UIColor.red, lineWidth: 2, animDuration: 1, animDelay: 0) - - // delayInit parameter is needed by some layers for initial zoom level to work correctly. Setting it to true allows to trigger drawing of layer manually (in this case, after the chart is initialized). This obviously needs improvement. For now it's necessary. - let chartPointsLineLayer = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [lineModel], delayInit: true) - - let guidelinesLayerSettings = ChartGuideLinesLayerSettings(linesColor: UIColor.black, linesWidth: 0.3) - let guidelinesLayer = ChartGuideLinesLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: guidelinesLayerSettings) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - chartPointsLineLayer] - ) - - view.addSubview(chart.view) - - - // Set scrollable area 2x than the original width, with zooming enabled. This can also be combined with e.g. minZoomX to allow only larger zooming levels. -// chart.zoom(scaleX: 2, scaleY: 1, centerX: 0, centerY: 0) - - // Now that the chart is zoomed (either with minZoom setting or programmatic zooming), trigger drawing of the line layer. Important: This requires delayInit paramter in line layer to be set to true. - chartPointsLineLayer.initScreenLines(chart) - - - self.chart = chart - } - - func createChartPoint(dateStr: String, percent: Double, readFormatter: DateFormatter, displayFormatter: DateFormatter) -> ChartPoint { - return ChartPoint(x: createDateAxisValue(dateStr, readFormatter: readFormatter, displayFormatter: displayFormatter), y: ChartAxisValuePercent(percent)) - } - - func createDateAxisValue(_ dateStr: String, readFormatter: DateFormatter, displayFormatter: DateFormatter) -> ChartAxisValue { - let date = readFormatter.date(from: dateStr)! - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont, rotation: 45, rotationKeep: .top) - return ChartAxisValueDate(date: date, formatter: displayFormatter, labelSettings: labelSettings) - } - - class ChartAxisValuePercent: ChartAxisValueDouble { - override var description: String { - return "\(formatter.string(from: NSNumber(value: scalar))!)%" - } - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/Env.swift b/Dependecies/SwiftCharts/Examples/Examples/Env.swift deleted file mode 100644 index 79eba1ef6..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/Env.swift +++ /dev/null @@ -1,16 +0,0 @@ -// -// Env.swift -// SwiftCharts -// -// Created by ischuetz on 07/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit - -class Env { - - static var iPad: Bool { - return UIDevice.current.userInterfaceIdiom == .pad - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/EqualSpacingExample.swift b/Dependecies/SwiftCharts/Examples/Examples/EqualSpacingExample.swift deleted file mode 100644 index 1133ed993..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/EqualSpacingExample.swift +++ /dev/null @@ -1,60 +0,0 @@ -// -// EqualSpacingExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class EqualSpacingExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let chartPoints = [ - ChartPoint(x: ChartAxisValueDoubleScreenLoc(screenLocDouble: 1, actualDouble: 2, labelSettings: labelSettings), y: ChartAxisValueDouble(2)), - ChartPoint(x: ChartAxisValueDoubleScreenLoc(screenLocDouble: 2, actualDouble: 100, labelSettings: labelSettings), y: ChartAxisValueDouble(5)), - ChartPoint(x: ChartAxisValueDoubleScreenLoc(screenLocDouble: 3, actualDouble: 100.1, labelSettings: labelSettings), y: ChartAxisValueDouble(1)), - ChartPoint(x: ChartAxisValueDoubleScreenLoc(screenLocDouble: 4, actualDouble: 900000, labelSettings: labelSettings), y: ChartAxisValueDouble(10)) - ] - - let xValues = chartPoints.map{$0.x} - let yValues = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: labelSettings)}, addPaddingSegmentIfEdge: false) - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - var chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - chartSettings.trailing = 40 - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let lineModel = ChartLineModel(chartPoints: chartPoints, lineColor: UIColor.red, animDuration: 1, animDelay: 0) - let chartPointsLineLayer = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [lineModel]) - - let settings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - chartPointsLineLayer - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/ExamplesDefaults.swift b/Dependecies/SwiftCharts/Examples/Examples/ExamplesDefaults.swift deleted file mode 100644 index 23eacb116..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/ExamplesDefaults.swift +++ /dev/null @@ -1,103 +0,0 @@ -// -// ExamplesDefaults.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -struct ExamplesDefaults { - - static var chartSettings: ChartSettings { - if Env.iPad { - return iPadChartSettings - } else { - return iPhoneChartSettings - } - } - - static var chartSettingsWithPanZoom: ChartSettings { - if Env.iPad { - return iPadChartSettingsWithPanZoom - } else { - return iPhoneChartSettingsWithPanZoom - } - } - - fileprivate static var iPadChartSettings: ChartSettings { - var chartSettings = ChartSettings() - chartSettings.leading = 20 - chartSettings.top = 20 - chartSettings.trailing = 20 - chartSettings.bottom = 20 - chartSettings.labelsToAxisSpacingX = 10 - chartSettings.labelsToAxisSpacingY = 10 - chartSettings.axisTitleLabelsToLabelsSpacing = 5 - chartSettings.axisStrokeWidth = 1 - chartSettings.spacingBetweenAxesX = 15 - chartSettings.spacingBetweenAxesY = 15 - chartSettings.labelsSpacing = 0 - return chartSettings - } - - fileprivate static var iPhoneChartSettings: ChartSettings { - var chartSettings = ChartSettings() - chartSettings.leading = 10 - chartSettings.top = 10 - chartSettings.trailing = 10 - chartSettings.bottom = 10 - chartSettings.labelsToAxisSpacingX = 5 - chartSettings.labelsToAxisSpacingY = 5 - chartSettings.axisTitleLabelsToLabelsSpacing = 4 - chartSettings.axisStrokeWidth = 0.2 - chartSettings.spacingBetweenAxesX = 8 - chartSettings.spacingBetweenAxesY = 8 - chartSettings.labelsSpacing = 0 - return chartSettings - } - - fileprivate static var iPadChartSettingsWithPanZoom: ChartSettings { - var chartSettings = iPadChartSettings - chartSettings.zoomPan.panEnabled = true - chartSettings.zoomPan.zoomEnabled = true - return chartSettings - } - - fileprivate static var iPhoneChartSettingsWithPanZoom: ChartSettings { - var chartSettings = iPhoneChartSettings - chartSettings.zoomPan.panEnabled = true - chartSettings.zoomPan.zoomEnabled = true - return chartSettings - } - - static func chartFrame(_ containerBounds: CGRect) -> CGRect { - return CGRect(x: 0, y: 70, width: containerBounds.size.width, height: containerBounds.size.height - 70) - } - - static var labelSettings: ChartLabelSettings { - return ChartLabelSettings(font: ExamplesDefaults.labelFont) - } - - static var labelFont: UIFont { - return ExamplesDefaults.fontWithSize(Env.iPad ? 14 : 11) - } - - static var labelFontSmall: UIFont { - return ExamplesDefaults.fontWithSize(Env.iPad ? 12 : 10) - } - - static func fontWithSize(_ size: CGFloat) -> UIFont { - return UIFont(name: "Helvetica", size: size) ?? UIFont.systemFont(ofSize: size) - } - - static var guidelinesWidth: CGFloat { - return Env.iPad ? 0.5 : 0.1 - } - - static var minBarSpacing: CGFloat { - return Env.iPad ? 10 : 5 - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/GroupedAndStackedBarsExample.swift b/Dependecies/SwiftCharts/Examples/Examples/GroupedAndStackedBarsExample.swift deleted file mode 100644 index af03c7852..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/GroupedAndStackedBarsExample.swift +++ /dev/null @@ -1,227 +0,0 @@ -// -// GroupedAndStackedBarsExample.swift -// Examples -// -// Created by ischuetz on 20/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class GroupedAndStackedBarsExample: UIViewController { - - fileprivate var chart: Chart? - - fileprivate let dirSelectorHeight: CGFloat = 50 - - fileprivate func barsChart(horizontal: Bool) -> Chart { - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let groupsData: [(title: String, bars: [(start: Double, quantities: [Double])])] = [ - ("A", [ - (0, - [-20, -5, -10] - ), - (0, - [10, 20, 30] - ), - (0, - [30, 14, 5] - ) - ]), - ("B", [ - (0, - [-10, -15, -5] - ), - (0, - [30, 25, 40] - ), - (0, - [25, 40, 10] - ) - ]), - ("C", [ - (0, - [-15, -30, -10] - ), - (0, - [-10, -10, -5] - ), - (0, - [15, 30, 10] - ) - ]), - ("D", [ - (0, - [-20, -10, -10] - ), - (0, - [30, 15, 27] - ), - (0, - [8, 10, 25] - ) - ]) - ] - - let frameColors = [UIColor.red.withAlphaComponent(0.6), UIColor.blue.withAlphaComponent(0.6), UIColor.green.withAlphaComponent(0.6)] - - let groups: [ChartPointsBarGroup] = groupsData.enumerated().map {index, entry in - let constant = ChartAxisValueDouble(Double(index)) - let bars: [ChartStackedBarModel] = entry.bars.enumerated().map {index, bars in - let items = bars.quantities.enumerated().map {index, quantity in - ChartStackedBarItemModel(quantity, frameColors[index]) - } - return ChartStackedBarModel(constant: constant, start: ChartAxisValueDouble(bars.start), items: items) - } - return ChartPointsBarGroup(constant: constant, bars: bars) - } - - let letterAxisValues = [ChartAxisValueString(order: -1)] + - groupsData.enumerated().map {index, tuple in ChartAxisValueString(tuple.0, order: index, labelSettings: labelSettings)} + - [ChartAxisValueString(order: groupsData.count)] - - - let numberAxisValuesGenerator = ChartAxisGeneratorMultiplier(20) - let numberAxisLabelsGenerator = ChartAxisLabelsGeneratorFunc {scalar in - return ChartAxisLabel(text: "\(scalar)", settings: labelSettings) - } - - let m1 = ChartAxisModel(firstModelValue: -60, lastModelValue: 100, axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: horizontal ? labelSettings : labelSettings.defaultVertical())], axisValuesGenerator: numberAxisValuesGenerator, labelsGenerator: numberAxisLabelsGenerator) - - let m2 = ChartAxisModel(axisValues: letterAxisValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: horizontal ? labelSettings.defaultVertical() : labelSettings)) - - let (xModel, yModel) = horizontal ? (m1, m2) : (m2, m1) - - - let frame = ExamplesDefaults.chartFrame(view.bounds) - let chartFrame = chart?.frame ?? CGRect(x: frame.origin.x, y: frame.origin.y, width: frame.size.width, height: frame.size.height - dirSelectorHeight) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let groupsLayer = ChartGroupedStackedBarsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, groups: groups, horizontal: horizontal, barSpacing: 2, groupSpacing: 30, settings: ChartBarViewSettings(animDuration: 0.5)) - - let settings = ChartGuideLinesLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, axis: horizontal ? .x : .y, settings: settings) - - let dummyZeroChartPoint = ChartPoint(x: ChartAxisValueDouble(0), y: ChartAxisValueDouble(0)) - let zeroGuidelineLayer = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: [dummyZeroChartPoint], viewGenerator: {(chartPointModel, layer, chart) -> UIView? in - let width: CGFloat = 2 - - let viewFrame: CGRect = { - if horizontal { - return CGRect(x: chartPointModel.screenLoc.x - width / 2, y: 0, width: width, height: layer.modelLocToScreenLoc(y: -1)) - } else { - return CGRect(x: 0, y: chartPointModel.screenLoc.y - width / 2, width: layer.modelLocToScreenLoc(x: Double(groups.count)), height: width) - } - }() - - let v = UIView(frame: viewFrame) - v.backgroundColor = UIColor.black - return v - }) - - return Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - groupsLayer, - zeroGuidelineLayer - ] - ) - } - - - fileprivate func showChart(horizontal: Bool) { - self.chart?.clearView() - - let chart = barsChart(horizontal: horizontal) - view.addSubview(chart.view) - self.chart = chart - } - - override func viewDidLoad() { - showChart(horizontal: false) - if let chart = chart { - let dirSelector = DirSelector(frame: CGRect(x: 0, y: chart.frame.origin.y + chart.frame.size.height, width: view.frame.size.width, height: dirSelectorHeight), controller: self) - view.addSubview(dirSelector) - } - } - - class DirSelector: UIView { - - let horizontal: UIButton - let vertical: UIButton - - weak var controller: GroupedAndStackedBarsExample? - - fileprivate let buttonDirs: [UIButton : Bool] - - init(frame: CGRect, controller: GroupedAndStackedBarsExample) { - - self.controller = controller - - horizontal = UIButton() - horizontal.setTitle("Horizontal", for: UIControl.State()) - vertical = UIButton() - vertical.setTitle("Vertical", for: UIControl.State()) - - buttonDirs = [horizontal: true, vertical: false] - - super.init(frame: frame) - - addSubview(horizontal) - addSubview(vertical) - - for button in [horizontal, vertical] { - button.titleLabel?.font = ExamplesDefaults.fontWithSize(14) - button.setTitleColor(UIColor.blue, for: UIControl.State()) - button.addTarget(self, action: #selector(DirSelector.buttonTapped(_:)), for: .touchUpInside) - } - } - - @objc func buttonTapped(_ sender: UIButton) { - let horizontal = sender == self.horizontal ? true : false - controller?.showChart(horizontal: horizontal) - } - - override func didMoveToSuperview() { - let views = [horizontal, vertical] - for v in views { - v.translatesAutoresizingMaskIntoConstraints = false - } - - let namedViews = views.enumerated().map{index, view in - ("v\(index)", view) - } - - var viewsDict = Dictionary() - for namedView in namedViews { - viewsDict[namedView.0] = namedView.1 - } - - let buttonsSpace: CGFloat = Env.iPad ? 20 : 10 - - let hConstraintStr = namedViews.reduce("H:|") {str, tuple in - "\(str)-(\(buttonsSpace))-[\(tuple.0)]" - } - - let vConstraits = namedViews.flatMap {NSLayoutConstraint.constraints(withVisualFormat: "V:|[\($0.0)]", options: NSLayoutConstraint.FormatOptions(), metrics: nil, views: viewsDict)} - - addConstraints(NSLayoutConstraint.constraints(withVisualFormat: hConstraintStr, options: NSLayoutConstraint.FormatOptions(), metrics: nil, views: viewsDict) - + vConstraits) - } - - required init(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/GroupedBarsExample.swift b/Dependecies/SwiftCharts/Examples/Examples/GroupedBarsExample.swift deleted file mode 100644 index f517a7ce2..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/GroupedBarsExample.swift +++ /dev/null @@ -1,208 +0,0 @@ -// -// GroupedBarsExample.swift -// Examples -// -// Created by ischuetz on 19/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class GroupedBarsExample: UIViewController { - - fileprivate var chart: Chart? - - fileprivate let dirSelectorHeight: CGFloat = 50 - - fileprivate func barsChart(horizontal: Bool) -> Chart { - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let groupsData: [(title: String, [(min: Double, max: Double)])] = [ - ("A", [ - (0, 40), - (0, 50), - (0, 35) - ]), - ("B", [ - (0, 20), - (0, 30), - (0, 25) - ]), - ("C", [ - (0, 30), - (0, 50), - (0, 5) - ]), - ("D", [ - (0, 55), - (0, 30), - (0, 25) - ]) - ] - - let groupColors = [UIColor.red.withAlphaComponent(0.6), UIColor.blue.withAlphaComponent(0.6), UIColor.green.withAlphaComponent(0.6)] - - let groups: [ChartPointsBarGroup] = groupsData.enumerated().map {index, entry in - let constant = ChartAxisValueDouble(index) - let bars = entry.1.enumerated().map {index, tuple in - ChartBarModel(constant: constant, axisValue1: ChartAxisValueDouble(tuple.min), axisValue2: ChartAxisValueDouble(tuple.max), bgColor: groupColors[index]) - } - return ChartPointsBarGroup(constant: constant, bars: bars) - } - - let (axisValues1, axisValues2): ([ChartAxisValue], [ChartAxisValue]) = ( - stride(from: 0, through: 60, by: 5).map {ChartAxisValueDouble(Double($0), labelSettings: labelSettings)}, - [ChartAxisValueString(order: -1)] + - groupsData.enumerated().map {index, tuple in ChartAxisValueString(tuple.0, order: index, labelSettings: labelSettings)} + - [ChartAxisValueString(order: groupsData.count)] - ) - let (xValues, yValues) = horizontal ? (axisValues1, axisValues2) : (axisValues2, axisValues1) - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - let frame = ExamplesDefaults.chartFrame(view.bounds) - let chartFrame = chart?.frame ?? CGRect(x: frame.origin.x, y: frame.origin.y, width: frame.size.width, height: frame.size.height - dirSelectorHeight) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let barViewSettings = ChartBarViewSettings(animDuration: 0.5, selectionViewUpdater: ChartViewSelectorBrightness(selectedFactor: 0.5)) - - let groupsLayer = ChartGroupedPlainBarsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, groups: groups, horizontal: horizontal, barSpacing: 2, groupSpacing: 25, settings: barViewSettings, tapHandler: { tappedGroupBar /*ChartTappedGroupBar*/ in - - let barPoint = horizontal ? CGPoint(x: tappedGroupBar.tappedBar.view.frame.maxX, y: tappedGroupBar.tappedBar.view.frame.midY) : CGPoint(x: tappedGroupBar.tappedBar.view.frame.midX, y: tappedGroupBar.tappedBar.view.frame.minY) - - guard let chart = self.chart, let chartViewPoint = tappedGroupBar.layer.contentToGlobalCoordinates(barPoint) else {return} - - let viewPoint = CGPoint(x: chartViewPoint.x, y: chartViewPoint.y) - - let infoBubble = InfoBubble(point: viewPoint, preferredSize: CGSize(width: 50, height: 40), superview: self.chart!.view, text: tappedGroupBar.tappedBar.model.axisValue2.description, font: ExamplesDefaults.labelFont, textColor: UIColor.white, bgColor: UIColor.black, horizontal: horizontal) - - let anchor: CGPoint = { - switch (horizontal, infoBubble.inverted(chart.view)) { - case (true, true): return CGPoint(x: 1, y: 0.5) - case (true, false): return CGPoint(x: 0, y: 0.5) - case (false, true): return CGPoint(x: 0.5, y: 0) - case (false, false): return CGPoint(x: 0.5, y: 1) - } - }() - - let animatorsSettings = ChartViewAnimatorsSettings(animInitSpringVelocity: 5) - let animators = ChartViewAnimators(view: infoBubble, animators: ChartViewGrowAnimator(anchor: anchor), settings: animatorsSettings, invertSettings: animatorsSettings.withoutDamping(), onFinishInverts: { - infoBubble.removeFromSuperview() - }) - - chart.view.addSubview(infoBubble) - - infoBubble.tapHandler = { - animators.invert() - } - - animators.animate() - }) - - let guidelinesSettings = ChartGuideLinesLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, axis: horizontal ? .x : .y, settings: guidelinesSettings) - - return Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - groupsLayer - ] - ) - } - - - fileprivate func showChart(horizontal: Bool) { - self.chart?.clearView() - - let chart = barsChart(horizontal: horizontal) - view.addSubview(chart.view) - self.chart = chart - } - - override func viewDidLoad() { - showChart(horizontal: false) - if let chart = chart { - let dirSelector = DirSelector(frame: CGRect(x: 0, y: chart.frame.origin.y + chart.frame.size.height, width: view.frame.size.width, height: dirSelectorHeight), controller: self) - view.addSubview(dirSelector) - } - } - - class DirSelector: UIView { - - let horizontal: UIButton - let vertical: UIButton - - weak var controller: GroupedBarsExample? - - fileprivate let buttonDirs: [UIButton : Bool] - - init(frame: CGRect, controller: GroupedBarsExample) { - - self.controller = controller - - horizontal = UIButton() - horizontal.setTitle("Horizontal", for: UIControl.State()) - vertical = UIButton() - vertical.setTitle("Vertical", for: UIControl.State()) - - buttonDirs = [horizontal : true, vertical : false] - - super.init(frame: frame) - - addSubview(horizontal) - addSubview(vertical) - - for button in [horizontal, vertical] { - button.titleLabel?.font = ExamplesDefaults.fontWithSize(14) - button.setTitleColor(UIColor.blue, for: UIControl.State()) - button.addTarget(self, action: #selector(DirSelector.buttonTapped(_:)), for: .touchUpInside) - } - } - - @objc func buttonTapped(_ sender: UIButton) { - let horizontal = sender == self.horizontal ? true : false - controller?.showChart(horizontal: horizontal) - } - - override func didMoveToSuperview() { - let views = [horizontal, vertical] - for v in views { - v.translatesAutoresizingMaskIntoConstraints = false - } - - let namedViews = views.enumerated().map{index, view in - ("v\(index)", view) - } - - var viewsDict = Dictionary() - for namedView in namedViews { - viewsDict[namedView.0] = namedView.1 - } - - let buttonsSpace: CGFloat = Env.iPad ? 20 : 10 - - let hConstraintStr = namedViews.reduce("H:|") {str, tuple in - "\(str)-(\(buttonsSpace))-[\(tuple.0)]" - } - - let vConstraits = namedViews.flatMap {NSLayoutConstraint.constraints(withVisualFormat: "V:|[\($0.0)]", options: NSLayoutConstraint.FormatOptions(), metrics: nil, views: viewsDict)} - - addConstraints(NSLayoutConstraint.constraints(withVisualFormat: hConstraintStr, options: NSLayoutConstraint.FormatOptions(), metrics: nil, views: viewsDict) - + vConstraits) - } - - required init(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/HelloWorld.swift b/Dependecies/SwiftCharts/Examples/Examples/HelloWorld.swift deleted file mode 100644 index a59bde26c..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/HelloWorld.swift +++ /dev/null @@ -1,78 +0,0 @@ -// -// HelloWorld.swift -// SwiftCharts -// -// Created by ischuetz on 05/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class HelloWorld: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - // map model data to chart points - let chartPoints: [ChartPoint] = [(2, 2), (4, 4), (6, 6), (8, 8), (8, 10), (15, 15)].map{ChartPoint(x: ChartAxisValueInt($0.0), y: ChartAxisValueInt($0.1))} - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let generator = ChartAxisGeneratorMultiplier(2) - let labelsGenerator = ChartAxisLabelsGeneratorFunc {scalar in - return ChartAxisLabel(text: "\(scalar)", settings: labelSettings) - } - - let xGenerator = ChartAxisGeneratorMultiplier(2) - - let xModel = ChartAxisModel(firstModelValue: 0, lastModelValue: 16, axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: labelSettings)], axisValuesGenerator: xGenerator, labelsGenerator: labelsGenerator) - - let yModel = ChartAxisModel(firstModelValue: 0, lastModelValue: 16, axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())], axisValuesGenerator: generator, labelsGenerator: labelsGenerator) - - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - // generate axes layers and calculate chart inner frame, based on the axis models - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - // create layer with guidelines - let guidelinesLayerSettings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: guidelinesLayerSettings) - - // view generator - this is a function that creates a view for each chartpoint - let viewGenerator = {(chartPointModel: ChartPointLayerModel, layer: ChartPointsViewsLayer, chart: Chart) -> UIView? in - let viewSize: CGFloat = Env.iPad ? 30 : 20 - let center = chartPointModel.screenLoc - let label = UILabel(frame: CGRect(x: center.x - viewSize / 2, y: center.y - viewSize / 2, width: viewSize, height: viewSize)) - label.backgroundColor = UIColor.green - label.textAlignment = NSTextAlignment.center - label.text = chartPointModel.chartPoint.y.description - label.font = ExamplesDefaults.labelFont - return label - } - - // create layer that uses viewGenerator to display chartpoints - let chartPointsLayer = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints, viewGenerator: viewGenerator, mode: .translate) - - // create chart instance with frame and layers - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - chartPointsLayer - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/MultiTrackerExample.swift b/Dependecies/SwiftCharts/Examples/Examples/MultiTrackerExample.swift deleted file mode 100644 index 85f50437b..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/MultiTrackerExample.swift +++ /dev/null @@ -1,439 +0,0 @@ -// -// MultiTrackerExample.swift -// SwiftCharts -// -// Created by Nate Racklyeft on 6/25/16. -// Copyright © 2016 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -// Configuration -private extension UIColor { - static let secondaryLabelColor = UIColor(red: 142 / 255, green: 142 / 255, blue: 147 / 255, alpha: 1) - - static let gridColor = UIColor(white: 193 / 255, alpha: 1) - - static let glucoseTintColor = UIColor(red: 96 / 255, green: 201 / 255, blue: 248 / 255, alpha: 1) - - static let IOBTintColor: UIColor = UIColor(red: 254 / 255, green: 149 / 255, blue: 38 / 255, alpha: 1) -} - -private let dateFormatter: DateFormatter = { - let timeFormatter = DateFormatter() - timeFormatter.dateStyle = .none - timeFormatter.timeStyle = .short - - return timeFormatter -}() - -private let localDateFormatter: DateFormatter = { - let dateFormatter = DateFormatter() - - dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss" - dateFormatter.locale = Locale(identifier: "en_US_POSIX") - - return dateFormatter -}() - -private let decimalFormatter: NumberFormatter = { - let numberFormatter = NumberFormatter() - numberFormatter.numberStyle = .decimal - numberFormatter.minimumFractionDigits = 2 - numberFormatter.maximumFractionDigits = 2 - - return numberFormatter -}() - -// MARK – Fixture data - -private let glucosePoints: [ChartPoint] = [("2016-02-28T07:26:38", 95), ("2016-02-28T07:31:38", 93), ("2016-02-28T07:41:39", 92), ("2016-02-28T07:51:42", 92), ("2016-02-28T07:56:38", 94), ("2016-02-28T08:01:39", 94), ("2016-02-28T08:06:38", 95), ("2016-02-28T08:11:37", 95), ("2016-02-28T08:16:40", 100), ("2016-02-28T08:21:39", 99), ("2016-02-28T08:26:39", 99), ("2016-02-28T08:31:38", 97), ("2016-02-28T08:51:43", 101), ("2016-02-28T08:56:39", 105), ("2016-02-28T09:01:43", 101), ("2016-02-28T09:06:37", 102), ("2016-02-28T09:11:37", 107), ("2016-02-28T09:16:38", 109), ("2016-02-28T09:21:37", 113), ("2016-02-28T09:26:41", 114), ("2016-02-28T09:31:37", 112), ("2016-02-28T09:36:39", 111), ("2016-02-28T09:41:40", 111), ("2016-02-28T09:46:43", 112), ("2016-02-28T09:51:38", 113), ("2016-02-28T09:56:43", 112), ("2016-02-28T10:01:38", 111), ("2016-02-28T10:06:42", 112), ("2016-02-28T10:11:37", 115), ("2016-02-28T10:16:42", 119), ("2016-02-28T10:21:42", 121), ("2016-02-28T10:26:38", 127), ("2016-02-28T10:31:36", 129), ("2016-02-28T10:36:37", 132), ("2016-02-28T10:41:38", 135), ("2016-02-28T10:46:37", 138), ("2016-02-28T10:51:36", 137), ("2016-02-28T10:56:38", 141), ("2016-02-28T11:01:37", 146), ("2016-02-28T11:06:40", 151), ("2016-02-28T11:16:37", 163), ("2016-02-28T11:21:36", 169), ("2016-02-28T11:26:37", 177), ("2016-02-28T11:31:37", 183), ("2016-02-28T11:36:37", 187), ("2016-02-28T11:41:36", 190), ("2016-02-28T11:46:36", 192), ("2016-02-28T11:51:36", 194), ("2016-02-28T11:56:36", 194), ("2016-02-28T12:01:37", 192), ("2016-02-28T12:06:41", 192), ("2016-02-28T12:11:36", 183), ("2016-02-28T12:16:38", 176), ("2016-02-28T12:21:39", 165), ("2016-02-28T12:26:38", 156), ("2016-02-28T12:31:37", 144), ("2016-02-28T12:36:36", 138), ("2016-02-28T12:41:37", 131), ("2016-02-28T12:46:37", 125), ("2016-02-28T12:51:36", 118), ("2016-02-28T13:01:43", 104), ("2016-02-28T13:06:45", 97), ("2016-02-28T13:11:39", 92), ("2016-02-28T13:16:37", 88), ("2016-02-28T13:21:36", 88)].map { - return ChartPoint( - x: ChartAxisValueDate(date: localDateFormatter.date(from: $0.0)!, formatter: dateFormatter), - y: ChartAxisValueInt($0.1) - ) -} - -private let predictedGlucosePoints: [ChartPoint] = [("2016-02-28T13:21:36", 88), ("2016-02-28T13:25:00", 87), ("2016-02-28T13:30:00", 85), ("2016-02-28T13:35:00", 83), ("2016-02-28T13:40:00", 81), ("2016-02-28T13:45:00", 81), ("2016-02-28T13:50:00", 81), ("2016-02-28T13:55:00", 83), ("2016-02-28T14:00:00", 84), ("2016-02-28T14:05:00", 87), ("2016-02-28T14:10:00", 90), ("2016-02-28T14:15:00", 93), ("2016-02-28T14:20:00", 97), ("2016-02-28T14:25:00", 102), ("2016-02-28T14:30:00", 107), ("2016-02-28T14:35:00", 113), ("2016-02-28T14:40:00", 120), ("2016-02-28T14:45:00", 128), ("2016-02-28T14:50:00", 136), ("2016-02-28T14:55:00", 145), ("2016-02-28T15:00:00", 154), ("2016-02-28T15:05:00", 163), ("2016-02-28T15:10:00", 172), ("2016-02-28T15:15:00", 179), ("2016-02-28T15:20:00", 187), ("2016-02-28T15:25:00", 194), ("2016-02-28T15:30:00", 200), ("2016-02-28T15:35:00", 206), ("2016-02-28T15:40:00", 211), ("2016-02-28T15:45:00", 215), ("2016-02-28T15:50:00", 219), ("2016-02-28T15:55:00", 223), ("2016-02-28T16:00:00", 226), ("2016-02-28T16:05:00", 228), ("2016-02-28T16:10:00", 230), ("2016-02-28T16:15:00", 231), ("2016-02-28T16:20:00", 231), ("2016-02-28T16:25:00", 231), ("2016-02-28T16:30:00", 230), ("2016-02-28T16:35:00", 230), ("2016-02-28T16:40:00", 229), ("2016-02-28T16:45:00", 228), ("2016-02-28T16:50:00", 227), ("2016-02-28T16:55:00", 226), ("2016-02-28T17:00:00", 225), ("2016-02-28T17:05:00", 224), ("2016-02-28T17:10:00", 224), ("2016-02-28T17:15:00", 223), ("2016-02-28T17:20:00", 222), ("2016-02-28T17:25:00", 221), ("2016-02-28T17:30:00", 221), ("2016-02-28T17:35:00", 220), ("2016-02-28T17:40:00", 219), ("2016-02-28T17:45:00", 219), ("2016-02-28T17:50:00", 218), ("2016-02-28T17:55:00", 218), ("2016-02-28T18:00:00", 218), ("2016-02-28T18:05:00", 218), ("2016-02-28T18:10:00", 218)].map { - return ChartPoint( - x: ChartAxisValueDate(date: localDateFormatter.date(from: $0.0)!, formatter: dateFormatter), - y: ChartAxisValueInt($0.1) - ) -} - -private let IOBPoints: [ChartPoint] = [("2016-02-28T07:25:00", 0.0), ("2016-02-28T07:30:00", 0.0036944444444472783), ("2016-02-28T07:35:00", -0.041666666666665263), ("2016-02-28T07:40:00", -0.11298963260090503), ("2016-02-28T07:45:00", -0.18364018193611475), ("2016-02-28T07:50:00", -0.17905627846292443), ("2016-02-28T07:55:00", -0.19834382681098695), ("2016-02-28T08:00:00", -0.19192177354344478), ("2016-02-28T08:05:00", -0.18546870465908208), ("2016-02-28T08:10:00", -0.17906574601611175), ("2016-02-28T08:15:00", -0.17135469795520025), ("2016-02-28T08:20:00", -0.16450124880944814), ("2016-02-28T08:25:00", -0.18095248614585058), ("2016-02-28T08:30:00", -0.17286981664792092), ("2016-02-28T08:35:00", -0.1649428517240436), ("2016-02-28T08:40:00", -0.15630024940346263), ("2016-02-28T08:45:00", -0.15564973761315049), ("2016-02-28T08:50:00", -0.15484465042603354), ("2016-02-28T08:55:00", -0.15385632304648592), ("2016-02-28T09:00:00", -0.14503406786881623), ("2016-02-28T09:05:00", -0.13560430142200144), ("2016-02-28T09:10:00", 4.1236760598368143), ("2016-02-28T09:15:00", 4.7580045858653408), ("2016-02-28T09:20:00", 4.797507610088223), ("2016-02-28T09:25:00", 4.7470649930859192), ("2016-02-28T09:30:00", 4.8073808321227238), ("2016-02-28T09:35:00", 4.7574313425927555), ("2016-02-28T09:40:00", 4.6956867789037213), ("2016-02-28T09:45:00", 4.6245111681877402), ("2016-02-28T09:50:00", 4.5433444176942741), ("2016-02-28T09:55:00", 4.431270599886326), ("2016-02-28T10:00:00", 4.3347991573984439), ("2016-02-28T10:05:00", 4.232130329715214), ("2016-02-28T10:10:00", 4.123473669887483), ("2016-02-28T10:15:00", 4.1849607740674131), ("2016-02-28T10:20:00", 4.2908357326261486), ("2016-02-28T10:25:00", 4.3923300950301805), ("2016-02-28T10:30:00", 4.4880804898394571), ("2016-02-28T10:35:00", 4.5795239011041415), ("2016-02-28T10:40:00", 4.6167066079119099), ("2016-02-28T10:45:00", 4.648763226113056), ("2016-02-28T10:50:00", 4.5757548336618656), ("2016-02-28T10:55:00", 4.5483941239244547), ("2016-02-28T11:00:00", 4.4669082248258229), ("2016-02-28T11:05:00", 4.3572781110626684), ("2016-02-28T11:10:00", 4.2448651414495249), ("2016-02-28T11:15:00", 4.1302836952228299), ("2016-02-28T11:20:00", 4.8644613141889321), ("2016-02-28T11:25:00", 4.7735479450092804), ("2016-02-28T11:30:00", 4.6763723172632066), ("2016-02-28T11:35:00", 4.6263678363933698), ("2016-02-28T11:40:00", 4.6252248376336471), ("2016-02-28T11:45:00", 4.6715820280965836), ("2016-02-28T11:50:00", 4.6657775819812244), ("2016-02-28T11:55:00", 4.6070572580733025), ("2016-02-28T12:00:00", 4.3991804144755005), ("2016-02-28T12:05:00", 4.2207285890562476), ("2016-02-28T12:10:00", 4.0174866626399064), ("2016-02-28T12:15:00", 3.8273922804263738), ("2016-02-28T12:20:00", 3.6385602030825925), ("2016-02-28T12:25:00", 3.3894133230689309), ("2016-02-28T12:30:00", 3.1420958613914309), ("2016-02-28T12:35:00", 2.8973159487084286), ("2016-02-28T12:40:00", 2.6562913087973756), ("2016-02-28T12:45:00", 2.4197470432113661), ("2016-02-28T12:50:00", 2.1866578462641546), ("2016-02-28T12:55:00", 1.9592879884763279), ("2016-02-28T13:00:00", 1.7368620414389135), ("2016-02-28T13:05:00", 1.5198636712336329), ("2016-02-28T13:10:00", 1.3089436183182606), ("2016-02-28T13:15:00", 1.1535104030437469), ("2016-02-28T13:20:00", 1.029259238414155), ("2016-02-28T13:25:00", 0.92424875183689581), ("2016-02-28T13:30:00", 1.0693214999513172), ("2016-02-28T13:35:00", 1.2179252372806773), ("2016-02-28T13:40:00", 1.3686107583250724), ("2016-02-28T13:45:00", 1.5216601122146722), ("2016-02-28T13:50:00", 1.6756373722393785), ("2016-02-28T13:55:00", 1.830049276750918), ("2016-02-28T14:00:00", 1.7552739393101593), ("2016-02-28T14:05:00", 1.6800326149026008), ("2016-02-28T14:10:00", 1.6045615612089266), ("2016-02-28T14:15:00", 1.529552685984469), ("2016-02-28T14:20:00", 1.4551922972209459), ("2016-02-28T14:25:00", 1.3816704659238352), ("2016-02-28T14:30:00", 1.3106997507187577), ("2016-02-28T14:35:00", 1.2427108235823778), ("2016-02-28T14:40:00", 1.1777114790667285), ("2016-02-28T14:45:00", 1.1156548582553669), ("2016-02-28T14:50:00", 1.0565416809216186), ("2016-02-28T14:55:00", 0.99991680907617442), ("2016-02-28T15:00:00", 0.94574181090268616), ("2016-02-28T15:05:00", 0.89311904821375931), ("2016-02-28T15:10:00", 0.84250915821388683), ("2016-02-28T15:15:00", 0.79345730299880946), ("2016-02-28T15:20:00", 0.74576518876929832), ("2016-02-28T15:25:00", 0.69945200554164288), ("2016-02-28T15:30:00", 0.65458567086334363), ("2016-02-28T15:35:00", 0.61866148080393324), ("2016-02-28T15:40:00", 0.58390071320767833), ("2016-02-28T15:45:00", 0.55029240045115302), ("2016-02-28T15:50:00", 0.51829806202973916), ("2016-02-28T15:55:00", 0.48838055766253852), ("2016-02-28T16:00:00", 0.46089759917798961), ("2016-02-28T16:05:00", 0.43533222555553236), ("2016-02-28T16:10:00", 0.41120094219970449), ("2016-02-28T16:15:00", 0.38717483135971792), ("2016-02-28T16:20:00", 0.36362072793021766), ("2016-02-28T16:25:00", 0.34038412512290156), ("2016-02-28T16:30:00", 0.31764547529085824), ("2016-02-28T16:35:00", 0.29545546750125873), ("2016-02-28T16:40:00", 0.27331799993023986), ("2016-02-28T16:45:00", 0.25131871047913684), ("2016-02-28T16:50:00", 0.22953602018938493), ("2016-02-28T16:55:00", 0.20804019837577364), ("2016-02-28T17:00:00", 0.18689329832809301), ("2016-02-28T17:05:00", 0.16615003800600928), ("2016-02-28T17:10:00", 0.14585543305215659), ("2016-02-28T17:15:00", 0.12604606271228064), ("2016-02-28T17:20:00", 0.10674921606115091), ("2016-02-28T17:25:00", 0.08799217115883326), ("2016-02-28T17:30:00", 0.070225506888435554), ("2016-02-28T17:35:00", 0.053631040821926462), ("2016-02-28T17:40:00", 0.037669241351902909), ("2016-02-28T17:45:00", 0.02475357068905246), ("2016-02-28T17:50:00", 0.014701054938544136), ("2016-02-28T17:55:00", 0.007335418533029334), ("2016-02-28T18:00:00", 0.0024882220451422584), ("2016-02-28T18:05:00", 0.0), ("2016-02-28T18:10:00", 0.0)].map { - return ChartPoint( - x: ChartAxisValueDate(date: localDateFormatter.date(from: $0.0)!, formatter: dateFormatter), - y: ChartAxisValueDouble($0.1, formatter: decimalFormatter) - ) -} - - -private let axisLabelSettings: ChartLabelSettings = ChartLabelSettings() - - -class MultiTrackerExample: UIViewController, UIGestureRecognizerDelegate { - - fileprivate var topChart: Chart? - - fileprivate var bottomChart: Chart? - - fileprivate lazy private(set) var chartLongPressGestureRecognizer = UILongPressGestureRecognizer() - - // MARK: – Chart configuration - - fileprivate lazy private(set) var chartSettings: ChartSettings = { - var chartSettings = ChartSettings() - chartSettings.top = 12 - chartSettings.bottom = 0 - chartSettings.trailing = 8 - chartSettings.axisTitleLabelsToLabelsSpacing = 0 - chartSettings.labelsToAxisSpacingX = 6 - chartSettings.clipInnerFrame = false - return chartSettings - }() - - private let guideLinesLayerSettings: ChartGuideLinesLayerSettings = ChartGuideLinesLayerSettings() - - fileprivate lazy private(set) var axisLineColor = UIColor.clear - - fileprivate var xAxisValues: [ChartAxisValue]? { - didSet { - if let xAxisValues = xAxisValues { - xAxisModel = ChartAxisModel(axisValues: xAxisValues, lineColor: axisLineColor, labelSpaceReservationMode: .fixed(20)) - } else { - xAxisModel = nil - } - } - } - - fileprivate var xAxisModel: ChartAxisModel? - - override func viewDidLoad() { - super.viewDidLoad() - - chartLongPressGestureRecognizer.delegate = self - chartLongPressGestureRecognizer.minimumPressDuration = 0.01 - view.addGestureRecognizer(chartLongPressGestureRecognizer) - - generateXAxisValues() - - let fullFrame = ExamplesDefaults.chartFrame(view.bounds) - let (topFrame, bottomFrame) = fullFrame.divided(atDistance: fullFrame.height / 2, from: .minYEdge) - - topChart = generateGlucoseChartWithFrame(topFrame) - bottomChart = generateIOBChartWithFrame(frame: bottomFrame) - - for chart in [topChart, bottomChart] { - if let view = chart?.view { - self.view.addSubview(view) - } - } - } - - fileprivate func generateXAxisValues() { - let points = glucosePoints + predictedGlucosePoints - - guard points.count > 1 else { - self.xAxisValues = [] - return - } - - let timeFormatter = DateFormatter() - timeFormatter.dateFormat = "h a" - - let xAxisValues = ChartAxisValuesStaticGenerator.generateXAxisValuesWithChartPoints(points, minSegmentCount: 5, maxSegmentCount: 10, multiple: TimeInterval(60 * 60), axisValueGenerator: { ChartAxisValueDate(date: ChartAxisValueDate.dateFromScalar($0), formatter: timeFormatter, labelSettings: axisLabelSettings) - }, addPaddingSegmentIfEdge: false) - xAxisValues.first?.hidden = true - xAxisValues.last?.hidden = true - - self.xAxisValues = xAxisValues - } - - fileprivate func generateGlucoseChartWithFrame(_ frame: CGRect) -> Chart? { - guard glucosePoints.count > 1, let xAxisValues = xAxisValues, let xAxisModel = xAxisModel else { - return nil - } - - let allPoints = glucosePoints + predictedGlucosePoints - - // TODO: The segment/multiple values are unit-specific - let yAxisValues = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(allPoints, minSegmentCount: 2, maxSegmentCount: 4, multiple: 25, axisValueGenerator: { ChartAxisValueDouble($0, labelSettings: axisLabelSettings)}, addPaddingSegmentIfEdge: true) - - let yAxisModel = ChartAxisModel(axisValues: yAxisValues, lineColor: axisLineColor, labelSpaceReservationMode: .fixed(30)) - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: frame, xModel: xAxisModel, yModel: yAxisModel) - - let (xAxisLayer, yAxisLayer) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer) - - let gridLayer = ChartGuideLinesForValuesLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, settings: guideLinesLayerSettings, axisValuesX: Array(xAxisValues.dropLast(1)), axisValuesY: []) - - let circles = ChartPointsScatterCirclesLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: glucosePoints, displayDelay: 0, itemSize: CGSize(width: 4, height: 4), itemFillColor: UIColor.glucoseTintColor) - - var prediction: ChartLayer? - - if predictedGlucosePoints.count > 1 { - let lineModel = ChartLineModel( - chartPoints: predictedGlucosePoints, - lineColor: UIColor.glucoseTintColor.withAlphaComponent(0.75), - lineWidth: 1, - animDuration: 0.0001, - animDelay: 0, - dashPattern: [6, 5] - ) - - prediction = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [lineModel]) - } - - let highlightLayer = ChartPointsTouchHighlightLayer( - xAxisLayer: xAxisLayer, - yAxisLayer: yAxisLayer, - chartPoints: allPoints, - tintColor: UIColor.glucoseTintColor, - labelCenterY: chartSettings.top, - gestureRecognizer: chartLongPressGestureRecognizer, - onCompleteHighlight: nil - ) - - let layers: [ChartLayer?] = [ - gridLayer, - xAxisLayer, - yAxisLayer, - highlightLayer, - prediction, - circles - ] - - return Chart(frame: frame, innerFrame: coordsSpace.chartInnerFrame, settings: chartSettings, layers: layers.compactMap { $0 }) - } - - private func generateIOBChartWithFrame(frame: CGRect) -> Chart? { - guard IOBPoints.count > 1, let xAxisValues = xAxisValues, let xAxisModel = xAxisModel else { - return nil - } - - var containerPoints = IOBPoints - - // Create a container line at 0 - if let first = IOBPoints.first { - containerPoints.insert(ChartPoint(x: first.x, y: ChartAxisValueInt(0)), at: 0) - } - - if let last = IOBPoints.last { - containerPoints.append(ChartPoint(x: last.x, y: ChartAxisValueInt(0))) - } - - let yAxisValues = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(IOBPoints, minSegmentCount: 2, maxSegmentCount: 3, multiple: 0.5, axisValueGenerator: { ChartAxisValueDouble($0, labelSettings: axisLabelSettings)}, addPaddingSegmentIfEdge: false) - - let yAxisModel = ChartAxisModel(axisValues: yAxisValues, lineColor: axisLineColor, labelSpaceReservationMode: .fixed(30)) - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: frame, xModel: xAxisModel, yModel: yAxisModel) - - let (xAxisLayer, yAxisLayer) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer) - let (xAxis, yAxis) = (xAxisLayer.axis, yAxisLayer.axis) - - // The IOB area - let lineModel = ChartLineModel(chartPoints: IOBPoints, lineColor: UIColor.IOBTintColor, lineWidth: 2, animDuration: 0, animDelay: 0) - let IOBLine = ChartPointsLineLayer(xAxis: xAxis, yAxis: yAxis, lineModels: [lineModel], pathGenerator: StraightLinePathGenerator()) - - let IOBArea = ChartPointsAreaLayer(xAxis: xAxis, yAxis: yAxis, chartPoints: containerPoints, areaColors: [UIColor.IOBTintColor.withAlphaComponent(0.75), UIColor.clear], animDuration: 0, animDelay: 0, addContainerPoints: false, pathGenerator: IOBLine.pathGenerator) - - // Grid lines - let gridLayer = ChartGuideLinesForValuesLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, settings: guideLinesLayerSettings, axisValuesX: Array(xAxisValues.dropLast(1)), axisValuesY: yAxisValues) - - // 0-line - let dummyZeroChartPoint = ChartPoint(x: ChartAxisValueDouble(0), y: ChartAxisValueDouble(0)) - let zeroGuidelineLayer = ChartPointsViewsLayer(xAxis: xAxis, yAxis: yAxis, chartPoints: [dummyZeroChartPoint], viewGenerator: {(chartPointModel, layer, chart) -> UIView? in - let width: CGFloat = 0.5 - let viewFrame = CGRect(x: chart.contentView.bounds.minX, y: chartPointModel.screenLoc.y - width / 2, width: chart.contentView.bounds.size.width, height: width) - - let v = UIView(frame: viewFrame) - v.backgroundColor = UIColor.IOBTintColor - return v - }) - - let highlightLayer = ChartPointsTouchHighlightLayer( - xAxisLayer: xAxisLayer, - yAxisLayer: yAxisLayer, - chartPoints: IOBPoints, - tintColor: UIColor.IOBTintColor, - labelCenterY: chartSettings.top, - gestureRecognizer: chartLongPressGestureRecognizer, - onCompleteHighlight: nil - ) - - let layers: [ChartLayer?] = [ - gridLayer, - xAxisLayer, - yAxisLayer, - zeroGuidelineLayer, - highlightLayer, - IOBArea, - IOBLine, - ] - - return Chart(frame: frame, innerFrame: coordsSpace.chartInnerFrame, settings: chartSettings, layers: layers.compactMap { $0 }) - } -} - - -/* - Here we extend ChartPointsTouchHighlightLayer to contain its initialization - */ -private extension ChartPointsTouchHighlightLayer { - - convenience init( - xAxisLayer: ChartAxisLayer, - yAxisLayer: ChartAxisLayer, - chartPoints: [T], - tintColor: UIColor, - labelCenterY: CGFloat = 0, - gestureRecognizer: UILongPressGestureRecognizer? = nil, - onCompleteHighlight: (()->Void)? = nil - ) { - self.init(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints, gestureRecognizer: gestureRecognizer, onCompleteHighlight: onCompleteHighlight, - modelFilter: { (screenLoc, chartPointModels) -> ChartPointLayerModel? in - if let index = chartPointModels.map({ $0.screenLoc.x }).findClosestElementIndexToValue(screenLoc.x) { - return chartPointModels[index] - } else { - return nil - } - }, - viewGenerator: { (chartPointModel, layer, chart) -> U? in - let containerView = U(frame: chart.contentView.bounds) - - let xAxisOverlayView = UIView(frame: CGRect(origin: CGPoint(x: 0, y: 3 + containerView.frame.size.height), size: xAxisLayer.frame.size)) - xAxisOverlayView.backgroundColor = UIColor.white - xAxisOverlayView.isOpaque = true - containerView.addSubview(xAxisOverlayView) - - let point = ChartPointEllipseView(center: chartPointModel.screenLoc, diameter: 16) - point.fillColor = tintColor.withAlphaComponent(0.5) - containerView.addSubview(point) - - if let text = chartPointModel.chartPoint.y.labels.first?.text { - let label = UILabel() - if #available(iOS 9.0, *) { - label.font = UIFont.monospacedDigitSystemFont(ofSize: 15, weight: .bold) - } else { - label.font = UIFont.systemFont(ofSize: 15) - } - - label.text = text - label.textColor = tintColor - label.textAlignment = .center - label.sizeToFit() - label.frame.size.height += 4 - label.frame.size.width += label.frame.size.height / 2 - label.center.y = containerView.frame.origin.y - label.center.x = chartPointModel.screenLoc.x - label.frame.origin.x = min(max(label.frame.origin.x, containerView.frame.origin.x), containerView.frame.maxX - label.frame.size.width) - label.frame.origin.makeIntegralInPlaceWithDisplayScale(chart.view.traitCollection.displayScale) - label.layer.borderColor = tintColor.cgColor - label.layer.borderWidth = 1 / chart.view.traitCollection.displayScale - label.layer.cornerRadius = label.frame.size.height / 2 - label.backgroundColor = UIColor.white - - containerView.addSubview(label) - } - - if let text = chartPointModel.chartPoint.x.labels.first?.text { - let label = UILabel() - label.font = axisLabelSettings.font - label.text = text - label.textColor = axisLabelSettings.fontColor - label.sizeToFit() - label.center = CGPoint(x: chartPointModel.screenLoc.x, y: xAxisOverlayView.center.y) - label.frame.origin.makeIntegralInPlaceWithDisplayScale(chart.view.traitCollection.displayScale) - - containerView.addSubview(label) - } - - return containerView - } - ) - } -} - - -private extension CGPoint { - /** - Rounds the coordinates to whole-pixel values - - - parameter scale: The display scale to use. Defaults to the main screen scale. - */ - mutating func makeIntegralInPlaceWithDisplayScale(_ scale: CGFloat = 0) { - var scale = scale - - // It's possible for scale values retrieved from traitCollection objects to be 0. - if scale == 0 { - scale = UIScreen.main.scale - } - x = round(x * scale) / scale - y = round(y * scale) / scale - } -} - - -private extension BidirectionalCollection where Index: Strideable, Iterator.Element: Comparable, Index.Stride == Int { - - /** - Returns the insertion index of a new value in a sorted collection - - Based on some helpful responses found at [StackOverflow](http://stackoverflow.com/a/33674192) - - - parameter value: The value to insert - - - returns: The appropriate insertion index, between `startIndex` and `endIndex` - */ - func findInsertionIndexForValue(_ value: Iterator.Element) -> Index { - var low = startIndex - var high = endIndex - - while low != high { - let mid = low.advanced(by: low.distance(to: high) / 2) - - if self[mid] < value { - low = mid.advanced(by: 1) - } else { - high = mid - } - } - - return low - } -} - - -private extension BidirectionalCollection where Index: Strideable, Iterator.Element: Strideable, Index.Stride == Int { - /** - Returns the index of the closest element to a specified value in a sorted collection - - - parameter value: The value to match - - - returns: The index of the closest element, or nil if the collection is empty - */ - func findClosestElementIndexToValue(_ value: Iterator.Element) -> Index? { - let upperBound = findInsertionIndexForValue(value) - - if upperBound == startIndex { - if upperBound == endIndex { - return nil - } - return upperBound - } - - let lowerBound = upperBound.advanced(by: -1) - - if upperBound == endIndex { - return lowerBound - } - - if value.distance(to: self[upperBound]) < self[lowerBound].distance(to: value) { - return upperBound - } - - return lowerBound - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/MultipleAxesExample.swift b/Dependecies/SwiftCharts/Examples/Examples/MultipleAxesExample.swift deleted file mode 100644 index 8d6c99d52..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/MultipleAxesExample.swift +++ /dev/null @@ -1,163 +0,0 @@ -// -// MultipleAxesExample.swift -// SwiftCharts -// -// Created by ischuetz on 05/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class MultipleAxesExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFontSmall) - - let bgColors = [UIColor.red, UIColor.blue, UIColor(red: 0, green: 0.7, blue: 0, alpha: 1), UIColor(red: 1, green: 0.5, blue: 0, alpha: 1)] - - func createChartPoints0(_ color: UIColor) -> [ChartPoint] { - return [ - createChartPoint(0, 0, color), - createChartPoint(2, 2, color), - createChartPoint(5, 2, color), - createChartPoint(8, 11, color), - createChartPoint(10, 2, color), - createChartPoint(12, 3, color), - createChartPoint(16, 22, color), - createChartPoint(20, 5, color) - ] - } - - func createChartPoints1(_ color: UIColor) -> [ChartPoint] { - return [ - createChartPoint(0, 7, color), - createChartPoint(1, 10, color), - createChartPoint(3, 9, color), - createChartPoint(9, 2, color), - createChartPoint(10, -5, color), - createChartPoint(13, -12, color) - ] - } - - func createChartPoints2(_ color: UIColor) -> [ChartPoint] { - return [ - createChartPoint(-200, -10, color), - createChartPoint(-160, -30, color), - createChartPoint(-110, -10, color), - createChartPoint(-40, -80, color), - createChartPoint(-10, -50, color), - createChartPoint(20, 10, color) - ] - } - - func createChartPoints3(_ color: UIColor) -> [ChartPoint] { - return [ - createChartPoint(10000, 70, color), - createChartPoint(20000, 100, color), - createChartPoint(30000, 160, color) - ] - } - - let chartPoints0 = createChartPoints0(bgColors[0]) - let chartPoints1 = createChartPoints1(bgColors[1]) - let chartPoints2 = createChartPoints2(bgColors[2]) - let chartPoints3 = createChartPoints3(bgColors[3]) - - let xValues0 = chartPoints0.map{$0.x} - let xValues1 = chartPoints1.map{$0.x} - let xValues2 = chartPoints2.map{$0.x} - let xValues3 = chartPoints3.map{$0.x} - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - - let top: CGFloat = 80 - let viewFrame = CGRect(x: 0, y: top, width: view.frame.size.width, height: view.frame.size.height - top - 10) - - let yValues1 = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints0, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: ChartLabelSettings(font: ExamplesDefaults.labelFontSmall, fontColor: bgColors[0]))}, addPaddingSegmentIfEdge: false) - - let yValues2 = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints1, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: ChartLabelSettings(font: ExamplesDefaults.labelFontSmall, fontColor: bgColors[1]))}, addPaddingSegmentIfEdge: false) - - let yValues4 = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints2, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: ChartLabelSettings(font: ExamplesDefaults.labelFontSmall, fontColor: bgColors[2]))}, addPaddingSegmentIfEdge: false) - - let yValues5 = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints3, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: ChartLabelSettings(font: ExamplesDefaults.labelFontSmall, fontColor: bgColors[3]))}, addPaddingSegmentIfEdge: false) - - let axisTitleFont = ExamplesDefaults.labelFontSmall - - let yLowModels: [ChartAxisModel] = [ - ChartAxisModel(axisValues: yValues2, lineColor: bgColors[1], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[1]).defaultVertical())]), - ChartAxisModel(axisValues: yValues1, lineColor: bgColors[0], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[0]).defaultVertical())]) - ] - let yHighModels: [ChartAxisModel] = [ - ChartAxisModel(axisValues: yValues4, lineColor: bgColors[2], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[2]).defaultVertical())]), - ChartAxisModel(axisValues: yValues5, lineColor: bgColors[3], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[3]).defaultVertical())]) - ] - let xLowModels: [ChartAxisModel] = [ - ChartAxisModel(axisValues: xValues0, lineColor: bgColors[0], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[0]))]), - ChartAxisModel(axisValues: xValues1, lineColor: bgColors[1], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[1]))]) - ] - let xHighModels: [ChartAxisModel] = [ - ChartAxisModel(axisValues: xValues3, lineColor: bgColors[3], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[3]))]), - ChartAxisModel(axisValues: xValues2, lineColor: bgColors[2], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[2]))]) - ] - - // calculate coords space in the background to keep UI smooth - DispatchQueue.global(qos: .background).async { - - let coordsSpace = ChartCoordsSpace(chartSettings: chartSettings, chartSize: viewFrame.size, yLowModels: yLowModels, yHighModels: yHighModels, xLowModels: xLowModels, xHighModels: xHighModels) - - DispatchQueue.main.async { - - let chartInnerFrame = coordsSpace.chartInnerFrame - - // create axes - let yLowAxes = coordsSpace.yLowAxesLayers - let yHighAxes = coordsSpace.yHighAxesLayers - let xLowAxes = coordsSpace.xLowAxesLayers - let xHighAxes = coordsSpace.xHighAxesLayers - - // create layers with references to axes - let lineModel0 = ChartLineModel(chartPoints: chartPoints0, lineColor: bgColors[0], animDuration: 1, animDelay: 0) - let lineModel1 = ChartLineModel(chartPoints: chartPoints1, lineColor: bgColors[1], animDuration: 1, animDelay: 0) - let lineModel2 = ChartLineModel(chartPoints: chartPoints2, lineColor: bgColors[2], animDuration: 1, animDelay: 0) - let lineModel3 = ChartLineModel(chartPoints: chartPoints3, lineColor: bgColors[3], animDuration: 1, animDelay: 0) - - let chartPointsLineLayer0 = ChartPointsLineLayer(xAxis: xLowAxes[0].axis, yAxis: yLowAxes[1].axis, lineModels: [lineModel0]) - let chartPointsLineLayer1 = ChartPointsLineLayer(xAxis: xLowAxes[1].axis, yAxis: yLowAxes[0].axis, lineModels: [lineModel1]) - let chartPointsLineLayer3 = ChartPointsLineLayer(xAxis: xHighAxes[1].axis, yAxis: yHighAxes[0].axis, lineModels: [lineModel2]) - let chartPointsLineLayer4 = ChartPointsLineLayer(xAxis: xHighAxes[0].axis, yAxis: yHighAxes[1].axis, lineModels: [lineModel3]) - - let lineLayers = [chartPointsLineLayer0, chartPointsLineLayer1, chartPointsLineLayer3, chartPointsLineLayer4] - - let layers: [ChartLayer] = [ - yLowAxes[1], xLowAxes[0], lineLayers[0], - yLowAxes[0], xLowAxes[1], lineLayers[1], - yHighAxes[0], xHighAxes[1], lineLayers[2], - yHighAxes[1], xHighAxes[0], lineLayers[3], - ] - - let chart = Chart( - frame: viewFrame, - innerFrame: chartInnerFrame, - settings: chartSettings, - layers: layers - ) - - self.view.addSubview(chart.view) - self.chart = chart - - } - } - - } - - fileprivate func createChartPoint(_ x: Double, _ y: Double, _ labelColor: UIColor) -> ChartPoint { - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFontSmall, fontColor: labelColor) - return ChartPoint(x: ChartAxisValueDouble(x, labelSettings: labelSettings), y: ChartAxisValueDouble(y, labelSettings: labelSettings)) - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/MultipleAxesInteractiveExample.swift b/Dependecies/SwiftCharts/Examples/Examples/MultipleAxesInteractiveExample.swift deleted file mode 100644 index de5f506db..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/MultipleAxesInteractiveExample.swift +++ /dev/null @@ -1,292 +0,0 @@ -// -// MultipleAxesInteractiveExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class MultipleAxesInteractiveExample: UIViewController { - - fileprivate var chart: Chart? - - let bgColors = [UIColor.red, UIColor.blue, UIColor(red: 0, green: 0.7, blue: 0, alpha: 1), UIColor(red: 1, green: 0.5, blue: 0, alpha: 1)] - - fileprivate var showGuides: Bool = false - fileprivate var selectedLayersFlags = [true, true, true, true] - - fileprivate let chartPoints0: [ChartPoint] - fileprivate let chartPoints1: [ChartPoint] - fileprivate let chartPoints2: [ChartPoint] - fileprivate let chartPoints3: [ChartPoint] - - fileprivate var viewFrame: CGRect! - fileprivate var chartInnerFrame: CGRect! - - fileprivate var yLowAxesLayers: [ChartAxisLayer]! - fileprivate var yHighAxesLayers: [ChartAxisLayer]! - fileprivate var xLowAxesLayers: [ChartAxisLayer]! - fileprivate var xHighAxesLayers: [ChartAxisLayer]! - - fileprivate var guideLinesLayer0: ChartLayer! - fileprivate var guideLinesLayer1: ChartLayer! - fileprivate var guideLinesLayer2: ChartLayer! - fileprivate var guideLinesLayer3: ChartLayer! - - fileprivate let selectionViewH: CGFloat = 100 - fileprivate let showGuidesViewH: CGFloat = 50 - - init() { - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFontSmall) - - func createChartPoint(x: Double, y: Double, labelColor: UIColor) -> ChartPoint { - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFontSmall, fontColor: labelColor) - return ChartPoint(x: ChartAxisValueDouble(x, labelSettings: labelSettings), y: ChartAxisValueDouble(y, labelSettings: labelSettings)) - } - - func createChartPoints0(_ color: UIColor) -> [ChartPoint] { - return [ - createChartPoint(x: 0, y: 0, labelColor: color), - createChartPoint(x: 2, y: 2, labelColor: color), - createChartPoint(x: 5, y: 2, labelColor: color), - createChartPoint(x: 8, y: 11, labelColor: color), - createChartPoint(x: 10, y: 2, labelColor: color), - createChartPoint(x: 12, y: 3, labelColor: color), - createChartPoint(x: 16, y: 22, labelColor: color), - createChartPoint(x: 20, y: 5, labelColor: color) - ] - } - - func createChartPoints1(_ color: UIColor) -> [ChartPoint] { - return [ - createChartPoint(x: 0, y: 7, labelColor: color), - createChartPoint(x: 1, y: 10, labelColor: color), - createChartPoint(x: 3, y: 9, labelColor: color), - createChartPoint(x: 9, y: 2, labelColor: color), - createChartPoint(x: 10, y: -5, labelColor: color), - createChartPoint(x: 13, y: -12, labelColor: color) - ] - } - - func createChartPoints2(_ color: UIColor) -> [ChartPoint] { - return [ - createChartPoint(x: -200, y: -10, labelColor: color), - createChartPoint(x: -160, y: -30, labelColor: color), - createChartPoint(x: -110, y: -10, labelColor: color), - createChartPoint(x: -40, y: -80, labelColor: color), - createChartPoint(x: -10, y: -50, labelColor: color), - createChartPoint(x: 20, y: 10, labelColor: color) - ] - } - - func createChartPoints3(_ color: UIColor) -> [ChartPoint] { - return [ - createChartPoint(x: 10000, y: 70, labelColor: color), - createChartPoint(x: 20000, y: 100, labelColor: color), - createChartPoint(x: 30000, y: 160, labelColor: color) - ] - } - - chartPoints0 = createChartPoints0(bgColors[0]) - chartPoints1 = createChartPoints1(bgColors[1]) - chartPoints2 = createChartPoints2(bgColors[2]) - chartPoints3 = createChartPoints3(bgColors[3]) - - - super.init(nibName: nil, bundle: nil) - - } - - required init(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override func viewDidLoad() { - super.viewDidLoad() - - let xValues0 = chartPoints0.map{$0.x} - let xValues1 = chartPoints1.map{$0.x} - let xValues2 = chartPoints2.map{$0.x} - let xValues3 = chartPoints3.map{$0.x} - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let top: CGFloat = 80 - - viewFrame = CGRect(x: 0, y: top, width: view.frame.size.width, height: view.frame.size.height - selectionViewH - showGuidesViewH - top - 10) - - let yValues0 = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints0, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: ChartLabelSettings(font: ExamplesDefaults.labelFontSmall, fontColor: bgColors[0]))}, addPaddingSegmentIfEdge: false) - - let yValues1 = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints1, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: ChartLabelSettings(font: ExamplesDefaults.labelFontSmall, fontColor: bgColors[1]))}, addPaddingSegmentIfEdge: false) - - let yValues2 = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints2, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: ChartLabelSettings(font: ExamplesDefaults.labelFontSmall, fontColor: bgColors[2]))}, addPaddingSegmentIfEdge: false) - - let yValues3 = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints3, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: ChartLabelSettings(font: ExamplesDefaults.labelFontSmall, fontColor: bgColors[3]))}, addPaddingSegmentIfEdge: false) - - let axisTitleFont = ExamplesDefaults.labelFontSmall - - let yLowModels: [ChartAxisModel] = [ - ChartAxisModel(axisValues: yValues1, lineColor: bgColors[1], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[1]).defaultVertical())]), - ChartAxisModel(axisValues: yValues0, lineColor: bgColors[0], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[0]).defaultVertical())]) - ] - let yHighModels: [ChartAxisModel] = [ - ChartAxisModel(axisValues: yValues2, lineColor: bgColors[2], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[2]).defaultVertical())]), - ChartAxisModel(axisValues: yValues3, lineColor: bgColors[3], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[3]).defaultVertical())]) - ] - let xLowModels: [ChartAxisModel] = [ - ChartAxisModel(axisValues: xValues0, lineColor: bgColors[0], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[0]))]), - ChartAxisModel(axisValues: xValues1, lineColor: bgColors[1], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[1]))]) - ] - let xHighModels: [ChartAxisModel] = [ - ChartAxisModel(axisValues: xValues3, lineColor: bgColors[3], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[3]))]), - ChartAxisModel(axisValues: xValues2, lineColor: bgColors[2], axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: ChartLabelSettings(font: axisTitleFont, fontColor: bgColors[2]))]) - ] - - // calculate coords space in the background to keep UI smooth - DispatchQueue.global(qos: .background).async { - - let coordsSpace = ChartCoordsSpace(chartSettings: chartSettings, chartSize: self.viewFrame.size, yLowModels: yLowModels, yHighModels: yHighModels, xLowModels: xLowModels, xHighModels: xHighModels) - - DispatchQueue.main.async { - - self.chartInnerFrame = coordsSpace.chartInnerFrame - - // create axes - self.yLowAxesLayers = coordsSpace.yLowAxesLayers - self.yHighAxesLayers = coordsSpace.yHighAxesLayers - self.xLowAxesLayers = coordsSpace.xLowAxesLayers - self.xHighAxesLayers = coordsSpace.xHighAxesLayers - - // create layers with references to axes - let guideLinesLayer0Settings = ChartGuideLinesDottedLayerSettings(linesColor: self.bgColors[0], linesWidth: ExamplesDefaults.guidelinesWidth) - self.guideLinesLayer0 = ChartGuideLinesDottedLayer(xAxisLayer: self.xLowAxesLayers[0], yAxisLayer: self.yLowAxesLayers[1], settings: guideLinesLayer0Settings) - let guideLinesLayer1Settings = ChartGuideLinesDottedLayerSettings(linesColor: self.bgColors[1], linesWidth: ExamplesDefaults.guidelinesWidth) - self.guideLinesLayer1 = ChartGuideLinesDottedLayer(xAxisLayer: self.xLowAxesLayers[1], yAxisLayer: self.yLowAxesLayers[0], settings: guideLinesLayer1Settings) - let guideLinesLayer3Settings = ChartGuideLinesDottedLayerSettings(linesColor: self.bgColors[2], linesWidth: ExamplesDefaults.guidelinesWidth) - self.guideLinesLayer2 = ChartGuideLinesDottedLayer(xAxisLayer: self.xHighAxesLayers[1], yAxisLayer: self.yHighAxesLayers[0], settings: guideLinesLayer3Settings) - let guideLinesLayer4Settings = ChartGuideLinesDottedLayerSettings(linesColor: self.bgColors[3], linesWidth: ExamplesDefaults.guidelinesWidth) - self.guideLinesLayer3 = ChartGuideLinesDottedLayer(xAxisLayer: self.xHighAxesLayers[0], yAxisLayer: self.yHighAxesLayers[1], settings: guideLinesLayer4Settings) - - self.showChart(chartSettings, lineAnimDuration: 1) - } - } - - - view.addSubview(createSelectionView(chartSettings)) - view.addSubview(createShowGuidesView(chartSettings)) - } - - fileprivate func createLineLayers(animDuration: Float) -> [ChartPointsLineLayer] { - let lineModel0 = ChartLineModel(chartPoints: chartPoints0, lineColor: bgColors[0], animDuration: animDuration, animDelay: 0) - let lineModel1 = ChartLineModel(chartPoints: chartPoints1, lineColor: bgColors[1], animDuration: animDuration, animDelay: 0) - let lineModel2 = ChartLineModel(chartPoints: chartPoints2, lineColor: bgColors[2], animDuration: animDuration, animDelay: 0) - let lineModel3 = ChartLineModel(chartPoints: chartPoints3, lineColor: bgColors[3], animDuration: animDuration, animDelay: 0) - - let chartPointsLineLayer0 = ChartPointsLineLayer(xAxis: xLowAxesLayers[0].axis, yAxis: yLowAxesLayers[1].axis, lineModels: [lineModel0]) - let chartPointsLineLayer1 = ChartPointsLineLayer(xAxis: xLowAxesLayers[1].axis, yAxis: yLowAxesLayers[0].axis, lineModels: [lineModel1]) - let chartPointsLineLayer2 = ChartPointsLineLayer(xAxis: xHighAxesLayers[1].axis, yAxis: yHighAxesLayers[0].axis, lineModels: [lineModel2]) - let chartPointsLineLayer3 = ChartPointsLineLayer(xAxis: xHighAxesLayers[0].axis, yAxis: yHighAxesLayers[1].axis, lineModels: [lineModel3]) - - return [chartPointsLineLayer0, chartPointsLineLayer1, chartPointsLineLayer2, chartPointsLineLayer3] - } - - - fileprivate func createLayers(selectedLayersFlags: [Bool], showGuides: Bool, lineAnimDuration: Float) -> ([ChartLayer]) { - - var axisLayers: [ChartLayer] = [] - var itemsLayers: [ChartLayer] = [] - - let lineLayers = createLineLayers(animDuration: lineAnimDuration) - - func group(xAxis: ChartAxisLayer, yAxis: ChartAxisLayer, lineLayer: ChartLayer, guideLayer: ChartLayer) -> [ChartLayer] { - return [xAxis, yAxis, lineLayer] + (showGuides ? [guideLayer] : []) - } - - let layers: [[ChartLayer]] = [ - group(xAxis: xLowAxesLayers[0], yAxis: yLowAxesLayers[1], lineLayer: lineLayers[0], guideLayer: guideLinesLayer0), - group(xAxis: xLowAxesLayers[1], yAxis: yLowAxesLayers[0], lineLayer: lineLayers[1], guideLayer: guideLinesLayer1), - group(xAxis: xHighAxesLayers[1], yAxis: yHighAxesLayers[0], lineLayer: lineLayers[2], guideLayer: guideLinesLayer2), - group(xAxis: xHighAxesLayers[0], yAxis: yHighAxesLayers[1], lineLayer: lineLayers[3], guideLayer: guideLinesLayer3) - ] - - return selectedLayersFlags.enumerated().reduce(Array()) {selectedLayers, inTuple in - - let index = inTuple.0 - let selected = inTuple.1 - - if selected { - return selectedLayers + layers[index] - } - return selectedLayers - } - } - - fileprivate func showChart(_ chartSettings: ChartSettings, lineAnimDuration: Float) -> () { - - self.chart?.clearView() - - let layers = createLayers(selectedLayersFlags: selectedLayersFlags, showGuides: showGuides, lineAnimDuration: lineAnimDuration) - - let view = ChartBaseView(frame: viewFrame) - let chart = Chart( - view: view, - innerFrame: chartInnerFrame, - settings: chartSettings, - layers: layers - ) - - self.view.addSubview(chart.view) - self.chart = chart - - chartInnerFrame = chart.containerView.frame - } - - fileprivate func createSelectionView(_ chartSettings: ChartSettings) -> UIView { - let v = UIView(frame: CGRect(x: 0, y: view.frame.height - selectionViewH - showGuidesViewH, width: view.frame.width, height: selectionViewH)) - v.backgroundColor = UIColor.white - v.isUserInteractionEnabled = true - - let selectorSize: CGFloat = 50 - for index in 0...3 { - - let x = CGFloat(index) * (selectorSize + 10) - let y: CGFloat = (selectionViewH - selectorSize) / 2 - - let selectorView = HandlingView(frame: CGRect(x: x, y: y, width: selectorSize, height: selectorSize)) - selectorView.backgroundColor = bgColors[index] - weak var selectorViewWeak = selectorView - selectorView.touchHandler = {[weak self] in guard let weakSelf = self else {return} - weakSelf.selectedLayersFlags[index] = !weakSelf.selectedLayersFlags[index] - selectorViewWeak?.backgroundColor = weakSelf.selectedLayersFlags[index] ? weakSelf.bgColors[index] : UIColor.gray - weakSelf.showChart(chartSettings, lineAnimDuration: 0) - } - - v.addSubview(selectorView) - } - return v - } - - fileprivate func createShowGuidesView(_ chartSettings: ChartSettings) -> UIView { - let v = HandlingView(frame: CGRect(x: 0, y: view.frame.height - showGuidesViewH, width: view.frame.width, height: showGuidesViewH)) - v.backgroundColor = UIColor.green - v.isUserInteractionEnabled = true - let label = UILabel(frame: CGRect(x: 10, y: 0, width: view.frame.width, height: showGuidesViewH)) - label.text = "Show guidelines" - v.addSubview(label) - - v.touchHandler = {[weak self] in - self!.showGuides = !self!.showGuides - label.text = self!.showGuides ? "Hide guidelines" : "Show guidelines" - self!.showChart(chartSettings, lineAnimDuration: 0) - } - return v - } - - fileprivate func createChartPoint(_ x: Double, _ y: Double, _ labelColor: UIColor) -> ChartPoint { - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFontSmall, fontColor: labelColor) - return ChartPoint(x: ChartAxisValueDouble(x, labelSettings: labelSettings), y: ChartAxisValueDouble(y, labelSettings: labelSettings)) - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/MultipleLabelsExample.swift b/Dependecies/SwiftCharts/Examples/Examples/MultipleLabelsExample.swift deleted file mode 100644 index 799652a89..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/MultipleLabelsExample.swift +++ /dev/null @@ -1,81 +0,0 @@ -// -// MultipleLabelsExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class MultipleLabelsExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let cp1 = ChartPoint(x: MyMultiLabelAxisValue(myVal: 2), y: ChartAxisValueDouble(2)) - let cp2 = ChartPoint(x: MyMultiLabelAxisValue(myVal: 4), y: ChartAxisValueDouble(6)) - let cp3 = ChartPoint(x: MyMultiLabelAxisValue(myVal: 5), y: ChartAxisValueDouble(12)) - let cp4 = ChartPoint(x: MyMultiLabelAxisValue(myVal: 8), y: ChartAxisValueDouble(4)) - - let chartPoints = [cp1, cp2, cp3, cp4] - - let xValues = chartPoints.map{$0.x} - let yValues = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: labelSettings)}, addPaddingSegmentIfEdge: false) - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - var chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - chartSettings.trailing = 20 - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let lineModel = ChartLineModel(chartPoints: chartPoints, lineColor: UIColor.red, lineWidth: 1, animDuration: 1, animDelay: 0) - let chartPointsLineLayer = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [lineModel]) - - let settings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - chartPointsLineLayer - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } -} - -private class MyMultiLabelAxisValue: ChartAxisValue { - - fileprivate let myVal: Int - fileprivate let derivedVal: Double - - init(myVal: Int) { - self.myVal = myVal - self.derivedVal = Double(myVal) / 5.0 - super.init(scalar: Double(myVal)) - } - - override var labels:[ChartAxisLabel] { - return [ - ChartAxisLabel(text: "\(myVal)", settings: ChartLabelSettings(font: UIFont.systemFont(ofSize: 18), fontColor: UIColor.black)), - ChartAxisLabel(text: "blabla", settings: ChartLabelSettings(font: UIFont.systemFont(ofSize: 10), fontColor: UIColor.blue)), - ChartAxisLabel(text: "\(derivedVal)", settings: ChartLabelSettings(font: UIFont.systemFont(ofSize: 14), fontColor: UIColor.purple)) - ] - } -} - diff --git a/Dependecies/SwiftCharts/Examples/Examples/NotNumericExample.swift b/Dependecies/SwiftCharts/Examples/Examples/NotNumericExample.swift deleted file mode 100644 index ee942f969..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/NotNumericExample.swift +++ /dev/null @@ -1,116 +0,0 @@ -// -// NotNumericExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class NotNumericExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let quantityVeryLow = MyQuantity(number: 0, text: "Very low") - let quantityLow = MyQuantity(number: 1, text: "low") - let quantityAverage = MyQuantity(number: 2, text: "Average") - let quantityHigh = MyQuantity(number: 3, text: "High") - let quantityVeryHigh = MyQuantity(number: 4, text: "Very high") - - - let item0 = MyItem(name: "Fruits", quantity: quantityHigh) - let item1 = MyItem(name: "Vegetables", quantity: quantityVeryHigh) - let item2 = MyItem(name: "Fish", quantity: quantityAverage) - let item3 = MyItem(name: "Red meat", quantity: quantityAverage) - let item4 = MyItem(name: "Cereals", quantity: quantityLow) - - - let chartPoints: [ChartPoint] = [item0, item1, item2, item3, item4].enumerated().map {index, item in - let xLabelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont, rotation: 45, rotationKeep: .top) - let x = ChartAxisValueString(item.name, order: index, labelSettings: xLabelSettings) - let y = ChartAxisValueString(item.quantity.text, order: item.quantity.number, labelSettings: labelSettings) - return ChartPoint(x: x, y: y) - } - - let xValues = [ChartAxisValueString("", order: -1)] + chartPoints.map{$0.x} + [ChartAxisValueString("", order: 5)] - - func toYValue(_ quantity: MyQuantity) -> ChartAxisValue { - return ChartAxisValueString(quantity.text, order: quantity.number, labelSettings: labelSettings) - } - - let yValues = [toYValue(quantityVeryLow), toYValue(quantityLow), toYValue(quantityAverage), toYValue(quantityHigh), toYValue(quantityVeryHigh)] - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let minBarSpacing: CGFloat = ExamplesDefaults.minBarSpacing + 16 - - let generator = {(chartPointModel: ChartPointLayerModel, layer: ChartPointsLayer, chart: Chart) -> UIView? in - let bottomLeft = layer.modelLocToScreenLoc(x: -1, y: 0) - - let barWidth = layer.minXScreenSpace - minBarSpacing - - let barViewSettings = ChartBarViewSettings(animDuration: 0.5) - let (p1, p2): (CGPoint, CGPoint) = (CGPoint(x: chartPointModel.screenLoc.x, y: bottomLeft.y), CGPoint(x: chartPointModel.screenLoc.x, y: chartPointModel.screenLoc.y)) - return ChartPointViewBar(p1: p1, p2: p2, width: barWidth, bgColor: UIColor.blue.withAlphaComponent(0.6), settings: barViewSettings) - } - - let chartPointsLayer = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints, viewGenerator: generator) - - let settings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - let dividersSettings = ChartDividersLayerSettings(linesColor: UIColor.black, linesWidth: Env.iPad ? 1 : 0.2, start: Env.iPad ? 7 : 3, end: 0) - let dividersLayer = ChartDividersLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: dividersSettings) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - dividersLayer, - chartPointsLayer - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } -} - - -private struct MyQuantity { - let number: Int - let text: String - - init(number: Int, text: String) { - self.number = number - self.text = text - } -} - -private struct MyItem { - let name: String - let quantity: MyQuantity - - init(name: String, quantity: MyQuantity) { - self.name = name - self.quantity = quantity - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/NotificationsExample.swift b/Dependecies/SwiftCharts/Examples/Examples/NotificationsExample.swift deleted file mode 100644 index d26718287..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/NotificationsExample.swift +++ /dev/null @@ -1,115 +0,0 @@ -// -// NotificationsExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class NotificationsExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let chartPoints: [ChartPoint] = [(1, 3), (2, 4), (4, 1), (5, 6), (6, 4), (7, 9), (8, 0), (10, 4), (12, 2)].map{ChartPoint(x: ChartAxisValueInt($0.0, labelSettings: labelSettings), y: ChartAxisValueInt($0.1))} - - let xValues = chartPoints.map{$0.x} - let yValues = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: labelSettings)}, addPaddingSegmentIfEdge: false) - - let lineModel = ChartLineModel(chartPoints: chartPoints, lineColor: UIColor.red, animDuration: 1, animDelay: 0) - - let notificationViewWidth: CGFloat = Env.iPad ? 30 : 20 - let notificationViewHeight: CGFloat = Env.iPad ? 30 : 20 - - let notificationGenerator = {[weak self] (chartPointModel: ChartPointLayerModel, layer: ChartPointsLayer, chart: Chart) -> UIView? in - let (chartPoint, screenLoc) = (chartPointModel.chartPoint, chartPointModel.screenLoc) - - if chartPoint.y.scalar <= 1 { - - let chartPointView = HandlingView(frame: CGRect(x: screenLoc.x + 5, y: screenLoc.y - notificationViewHeight - 5, width: notificationViewWidth, height: notificationViewHeight)) - let label = UILabel(frame: chartPointView.bounds) - label.layer.cornerRadius = Env.iPad ? 15 : 10 - label.clipsToBounds = true - label.backgroundColor = UIColor.red - label.textColor = UIColor.white - label.textAlignment = NSTextAlignment.center - label.font = UIFont.boldSystemFont(ofSize: Env.iPad ? 22 : 18) - label.text = "!" - chartPointView.addSubview(label) - label.transform = CGAffineTransform(scaleX: 0, y: 0) - - chartPointView.movedToSuperViewHandler = { - UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 0.6, initialSpringVelocity: 0, options: UIView.AnimationOptions(), animations: { - label.transform = CGAffineTransform(scaleX: 1, y: 1) - }, completion: nil) - } - - chartPointView.touchHandler = { - - let title = "Lorem" - let message = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." - let ok = "Ok" - - if #available(iOS 8.0, *) { - let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert) - alert.addAction(UIAlertAction(title: ok, style: UIAlertAction.Style.default, handler: nil)) - self!.present(alert, animated: true, completion: nil) - - } else { - let alert = UIAlertView() - alert.title = title - alert.message = message - alert.addButton(withTitle: ok) - alert.show() - } - } - - return chartPointView - } - return nil - } - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let chartPointsNotificationsLayer = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints, viewGenerator: notificationGenerator, displayDelay: 1, mode: .custom) - // To preserve the offset of the notification views from the chart point they represent, during transforms, we need to pass mode: .custom along with this custom transformer. - chartPointsNotificationsLayer.customTransformer = {(model, view, layer) -> Void in - let screenLoc = layer.modelLocToScreenLoc(x: model.chartPoint.x.scalar, y: model.chartPoint.y.scalar) - view.frame.origin = CGPoint(x: screenLoc.x + 5, y: screenLoc.y - notificationViewHeight - 5) - } - - let chartPointsLineLayer = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [lineModel]) - - let settings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - chartPointsLineLayer, - chartPointsNotificationsLayer] - ) - - view.addSubview(chart.view) - self.chart = chart - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/RangedAxisExample.swift b/Dependecies/SwiftCharts/Examples/Examples/RangedAxisExample.swift deleted file mode 100644 index 6daef9ac7..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/RangedAxisExample.swift +++ /dev/null @@ -1,262 +0,0 @@ -// -// RangedAxisExample.swift -// SwiftCharts -// -// Created by Ivan Schuetz on 17/02/2017. -// Copyright © 2017 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class RangedAxisExample: UIViewController { - - fileprivate var chart: Chart? // arc - - private var didLayout: Bool = false - - fileprivate var lastOrientation: UIInterfaceOrientation? - - override func viewDidLoad() { - super.viewDidLoad() - - view.backgroundColor = UIColor.black - - NotificationCenter.default.addObserver(self, selector: #selector(rotated), name: UIDevice.orientationDidChangeNotification, object: nil) - } - - private func initChart() { - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont, fontColor: UIColor.white) - - let firstYear: Double = 1980 - let lastYear: Double = 2020 - - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - // 1st x-axis model: Has an axis value (tick) for each year. We use this for the small x-axis dividers. - - let xValuesGenerator = ChartAxisGeneratorMultiplier(1) - - var labCopy = labelSettings - labCopy.fontColor = UIColor.red - let xEmptyLabelsGenerator = ChartAxisLabelsGeneratorFunc {value in return - ChartAxisLabel(text: "", settings: labCopy) - } - - let xModel = ChartAxisModel(lineColor: UIColor.white, firstModelValue: firstYear, lastModelValue: lastYear, axisTitleLabels: [], axisValuesGenerator: xValuesGenerator, labelsGenerator: - xEmptyLabelsGenerator) - - - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - // 2nd x-axis model: Has an axis value (tick) for each /2 years. We use this to show the x-axis labels - - let rangeSize: Double = view.frame.width < view.frame.height ? 12 : 6 // adjust intervals for orientation - let rangedMult: Double = rangeSize / 2 - - let formatter = NumberFormatter() - formatter.maximumFractionDigits = 0 - - let xRangedLabelsGenerator = ChartAxisLabelsGeneratorFunc {value -> ChartAxisLabel in - if value < lastYear && value.truncatingRemainder(dividingBy: rangedMult) == 0 && value.truncatingRemainder(dividingBy: rangeSize) != 0 { - let val1 = value - rangedMult - let val2 = value + rangedMult - return ChartAxisLabel(text: "\(String(format: "%.0f", val1)) - \(String(format: "%.0f", val2))", settings: labelSettings) - } else { - return ChartAxisLabel(text: "", settings: labelSettings) - } - } - - let xValuesRangedGenerator = ChartAxisGeneratorMultiplier(rangedMult) - - let xModelForRanges = ChartAxisModel(lineColor: UIColor.white, firstModelValue: firstYear, lastModelValue: lastYear, axisTitleLabels: [], axisValuesGenerator: xValuesRangedGenerator, labelsGenerator: xRangedLabelsGenerator) - - - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - // 3rd x-axis model: Has an axis value (tick) for each years. We use this to show the x-axis guidelines and long dividers - - let xValuesGuidelineGenerator = ChartAxisGeneratorMultiplier(rangeSize) - let xModelForGuidelines = ChartAxisModel(lineColor: UIColor.white, firstModelValue: firstYear, lastModelValue: lastYear, axisTitleLabels: [], axisValuesGenerator: xValuesGuidelineGenerator, labelsGenerator: xEmptyLabelsGenerator) - - - //////////////////////////////////////////////////////////////////////////////////// - // y-axis model: Has an axis value (tick) for each 2 units. We use this to show the y-axis dividers, labels and guidelines. - - let generator = ChartAxisGeneratorMultiplier(2) - let labelsGenerator = ChartAxisLabelsGeneratorFunc {scalar in - return ChartAxisLabel(text: "\(scalar)", settings: labelSettings) - } - - let yModel = ChartAxisModel(lineColor: UIColor.white, firstModelValue: 0, lastModelValue: 16, axisTitleLabels: [], axisValuesGenerator: generator, labelsGenerator: labelsGenerator) - - - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Chart frame, settings - - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - - var chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - chartSettings.axisStrokeWidth = 0.5 - chartSettings.labelsToAxisSpacingX = 10 - chartSettings.leading = -1 - chartSettings.trailing = 40 - - - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - // In order to transform the axis models into axis layers, and get the chart inner frame size, we need to use ChartCoordsSpace. - // Note that in the case of the x-axes we need to use ChartCoordsSpace multiple times - each of these axes represent essentially the same x-axis, so we can't use multi-axes functionality (i.e. pass an array of x-axes to ChartCoordsSpace). - - let coordsSpace = ChartCoordsSpaceRightBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let coordsSpaceForRanges = ChartCoordsSpaceRightBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModelForRanges, yModel: yModel) - let coordsSpaceForGuidelines = ChartCoordsSpaceRightBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModelForGuidelines, yModel: yModel) - - var (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - var (xRangedAxisLayer, _, _) = (coordsSpaceForRanges.xAxisLayer, coordsSpaceForRanges.yAxisLayer, coordsSpaceForRanges.chartInnerFrame) - let (xGuidelinesAxisLayer, _, _) = (coordsSpaceForGuidelines.xAxisLayer, coordsSpaceForGuidelines.yAxisLayer, coordsSpaceForGuidelines.chartInnerFrame) - - - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Lines layer - - let line1ChartPoints = line1ModelData.map{ChartPoint(x: ChartAxisValueDouble($0.0), y: ChartAxisValueDouble($0.1))} - let line1Model = ChartLineModel(chartPoints: line1ChartPoints, lineColor: UIColor.white, lineWidth: 2, animDuration: 1, animDelay: 0) - - let line2ChartPoints = line2ModelData.map{ChartPoint(x: ChartAxisValueDouble($0.0), y: ChartAxisValueDouble($0.1))} - let line2Model = ChartLineModel(chartPoints: line2ChartPoints, lineColor: UIColor(hexString: "1F82DF"), lineWidth: 2, animDuration: 1, animDelay: 0) - - let line3ChartPoints = line3ModelData.map{ChartPoint(x: ChartAxisValueDouble($0.0), y: ChartAxisValueDouble($0.1))} - let line3Model = ChartLineModel(chartPoints: line3ChartPoints, lineColor: UIColor(hexString: "CE7CFA"), lineWidth: 2, animDuration: 1, animDelay: 0) - - let chartPointsLineLayer = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [line1Model, line2Model, line3Model], pathGenerator: CubicLinePathGenerator(tension1: 0.2, tension2: 0.2)) - - - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Markers for the last chart points in each line, shown next to the right y-axis - - let viewGenerator = {(chartPointModel: ChartPointLayerModel, layer: ChartPointsViewsLayer, chart: Chart) -> UIView? in - let h: CGFloat = Env.iPad ? 30 : 20 - let w: CGFloat = Env.iPad ? 60 : 50 - - let center = chartPointModel.screenLoc - let label = UILabel(frame: CGRect(x: chart.containerView.frame.maxX, y: center.y - h / 2, width: w, height: h)) - label.backgroundColor = { - return chartPointsLineLayer.lineModels[chartPointModel.index].lineColors.first ?? UIColor.white - }() - - label.textAlignment = NSTextAlignment.center - label.text = chartPointModel.chartPoint.y.description - label.font = ExamplesDefaults.labelFont - - let shape = CAShapeLayer() - let path = UIBezierPath() - path.move(to: CGPoint(x: 0, y: h / 2)) - path.addLine(to: CGPoint(x: 20, y: 0)) - path.addLine(to: CGPoint(x: w, y: 0)) - path.addLine(to: CGPoint(x: w, y: h)) - path.addLine(to: CGPoint(x: 20, y: h)) - path.close() - shape.path = path.cgPath - label.layer.mask = shape - - return label - } - - // Create layer with markers for last chart points. - let chartPointsLayer = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: [line1ChartPoints.last!, line2ChartPoints.last!, line3ChartPoints.last!], viewGenerator: viewGenerator, mode: .custom, clipViews: false) - - // In order for the x-position of the markers to remain fixed at the right y-axis during zooming and panning, we pass a custom transformer, which updates only the y-position of the markers. - chartPointsLayer.customTransformer = {(model, view, layer) -> Void in - var model = model - model.screenLoc = layer.modelLocToScreenLoc(x: model.chartPoint.x.scalar, y: model.chartPoint.y.scalar) - view.frame.origin = CGPoint(x: layer.chart?.containerView.frame.maxX ?? 0, y: model.screenLoc.y - 20 / 2) - } - - // Finally we set a custom clip rect for the view where we display the markers, in order to not show them outside of the chart's boundaries, during zooming and panning. For now the size is hardcoded. This should be improved. Until then you can calculate the exact frame using the spacing settings and label (string) sizes. - chartSettings.customClipRect = CGRect(x: 0, y: chartSettings.top, width: view.frame.width, height: view.frame.height - 120) - - - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Guidelines layer. Note how we pass the x-axis layer we created specifically for the guidelines. - - let guidelinesLayerSettings = ChartGuideLinesLayerSettings(linesColor: UIColor.white, linesWidth: 0.3) - let guidelinesLayer = ChartGuideLinesLayer(xAxisLayer: xGuidelinesAxisLayer, yAxisLayer: yAxisLayer, settings: guidelinesLayerSettings) - - - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Dividers layer with small lines. This is used both in x and y axes - - let dividersSettings = ChartDividersLayerSettings(linesColor: UIColor.white, linesWidth: 1, start: 2, end: 0) - let dividersLayer = ChartDividersLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, axis: .xAndY, settings: dividersSettings) - - - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Dividers layer with long lines. This is used only in the x axis. Note how we pass the same axis layer we passed to the guidelines - we want to use the same intervals. - - let dividersSettings2 = ChartDividersLayerSettings(linesColor: UIColor.white, linesWidth: 0.5, start: 30, end: 0) - let dividersLayer2 = ChartDividersLayer(xAxisLayer: xGuidelinesAxisLayer, yAxisLayer: yAxisLayer, axis: .x, settings: dividersSettings2) - - - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Disable frame updates for 2 of the 3 x-axis layers. This way the space will not be reserved multiple times. We need this only because the 3 layers represent the same x-axis (for a multi-axis chart this would not be necessary). Note that it's important to pass all 3 layers to the chart, although only one is actually visible, because otherwise the layers will not receive inner frame updates, which results in any layers that reference these layers not being positioned correctly. - xRangedAxisLayer.canChangeFrameSize = false - xAxisLayer.canChangeFrameSize = false - - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - // create chart instance with frame and layers - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - xRangedAxisLayer, - xGuidelinesAxisLayer, - yAxisLayer, - guidelinesLayer, - chartPointsLayer, - chartPointsLineLayer, - dividersLayer, - dividersLayer2 - ] - ) - - view.addSubview(chart.view) - self.chart = chart - - } - - fileprivate let line1ModelData: [(Double, Double)] = [(1980.47, 9.47), (1980.85, 10.23), (1981.12, 10.93), (1982.09, 6.51), (1982.35, 8.37), (1982.91, 6.76), (1983.70, 9.30), (1984.31, 8.30), (1985.04, 10.00), (1985.22, 8.73), (1985.37, 5.75), (1985.92, 6.42), (1986.13, 5.30), (1987.08, 6.30), (1987.27, 4.95), (1988.46, 8.40), (1988.90, 7.78), (1989.93, 10.45), (1990.80, 9.21), (1991.60, 12.24), (1992.08, 9.78), (1992.64, 11.47), (1993.28, 9.54), (1994.64, 6.99), (1995.65, 9.07), (1997.01, 4.56), (1998.02, 7.61), (1998.29, 5.88), (1998.99, 6.69), (1999.28, 5.35), (2000.23, 5.92), (2000.77, 4.33), (2001.28, 6.28), (2001.82, 4.70), (2002.30, 8.38), (2003.21, 5.35), (2004.51, 10.47), (2005.48, 8.83), (2005.64, 12.54), (2006.61, 10.99), (2007.36, 12.64), (2007.95, 11.54), (2008.37, 11.85), (2008.66, 10.42), (2009.36, 12.12), (2009.73, 11.26), (2010.25, 12.43), (2010.76, 11.18), (2011.65, 13.91), (2012.37, 12.26), (2013.73, 13.97), (2014.42, 12.73), (2015.12, 13.62), (2015.78, 12.67), (2016.01, 11.83), (2016.65, 12.79), (2017.24, 11.59), (2017.68, 13.26), (2018.69, 9.64)] - fileprivate let line2ModelData: [(Double, Double)] = [(1980.47, 12.47), (1980.85, 9.23), (1981.12, 12.93), (1982.09, 4.51), (1982.35, 10.37), (1982.91, 8.76), (1983.70, 12.30), (1984.31, 9.30), (1985.04, 11.00), (1985.22, 11.73), (1985.37, 7.75), (1985.92, 7.42), (1986.13, 6.30), (1987.08, 7.30), (1987.27, 5.95), (1988.46, 10.40), (1988.90, 8.78), (1989.93, 12.45), (1990.80, 10.21), (1991.60, 14.24), (1992.08, 9.78), (1992.64, 11.47), (1993.28, 12.54), (1994.64, 7.99), (1995.65, 12.07), (1997.01, 7.56), (1998.02, 8.61), (1998.29, 6.88), (1998.99, 7.69), (1999.28, 6.35), (2000.23, 6.92), (2000.77, 5.33), (2001.28, 8.28), (2001.82, 6.70), (2002.30, 8.38), (2003.21, 5.35), (2004.51, 9.47), (2005.48, 6.83), (2005.64, 10.54), (2006.61, 9.99), (2007.36, 10.64), (2007.95, 10.54), (2008.37, 9.85), (2008.66, 12.42), (2009.36, 14.12), (2009.73, 13.26), (2010.25, 14.43), (2010.76, 12.18), (2011.65, 14.91), (2012.37, 13.26), (2013.73, 15.97), (2014.42, 14.73), (2015.12, 12.62), (2015.78, 11.67), (2016.01, 12.83), (2016.65, 10.79), (2017.24, 8.59), (2017.68, 8.26), (2018.69, 10.64)] - fileprivate let line3ModelData: [(Double, Double)] = [(1980.47, 2.47), (1980.85, 4.23), (1981.12, 5.93), (1982.09, 4.51), (1982.35, 7.37), (1982.91, 5.76), (1983.70, 4.30), (1984.31, 6.30), (1985.04, 5.00), (1985.22, 6.73), (1985.37, 2.75), (1985.92, 3.42), (1986.13, 1.30), (1987.08, 6.30), (1987.27, 3.95), (1988.46, 7.40), (1988.90, 5.78), (1989.93, 8.45), (1990.80, 5.21), (1991.60, 10.24), (1992.08, 6.78), (1992.64, 8.47), (1993.28, 6.54), (1994.64, 4.99), (1995.65, 7.07), (1997.01, 3.56), (1998.02, 6.61), (1998.29, 2.88), (1998.99, 4.69), (1999.28, 3.35), (2000.23, 2.92), (2000.77, 1.33), (2001.28, 2.28), (2001.82, 2.70), (2002.30, 7.38), (2003.21, 2.35), (2004.51, 9.47), (2005.48, 3.83), (2005.64, 7.54), (2006.61, 5.99), (2007.36, 6.64), (2007.95, 7.54), (2008.37, 5.85), (2008.66, 8.42), (2009.36, 11.12), (2009.73, 10.26), (2010.25, 10.43), (2010.76, 8.18), (2011.65, 9.91), (2012.37, 6.26), (2013.73, 8.97), (2014.42, 5.73), (2015.12, 9.62), (2015.78, 8.67), (2016.01, 5.83), (2016.65, 7.79), (2017.24, 6.59), (2017.68, 9.26), (2018.69, 6.64)] - - override func viewDidLayoutSubviews() { - super.viewDidLayoutSubviews() - - if !self.didLayout { - self.didLayout = true - self.initChart() - } - } - - - @objc func rotated() { - let orientation = UIApplication.shared.statusBarOrientation - guard (lastOrientation.map{$0.rawValue != orientation.rawValue} ?? true) else {return} - - lastOrientation = orientation - - guard let chart = chart else {return} - for view in chart.view.subviews { - view.removeFromSuperview() - } - self.initChart() - chart.view.setNeedsDisplay() - - } - - - deinit { - NotificationCenter.default.removeObserver(self) - } - -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/ScatterExample.swift b/Dependecies/SwiftCharts/Examples/Examples/ScatterExample.swift deleted file mode 100644 index 7aebab208..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/ScatterExample.swift +++ /dev/null @@ -1,109 +0,0 @@ -// -// ScatterExample.swift -// Examples -// -// Created by ischuetz on 17/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -private enum MyExampleModelDataType { - case type0, type1, type2, type3 -} - -private enum Shape { - case triangle, square, circle, cross -} - -class ScatterExample: UIViewController { - - fileprivate var chart: Chart? - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let models: [(x: Double, y: Double, type: MyExampleModelDataType)] = [ - (246.56, 138.98, .type1), (218.33, 132.71, .type0), (187.79, 127.48, .type0), (150.63, 135.5, .type0), (185.05, 152.57, .type3), (213.15, 155.71, .type1), (252.79, 158.85, .type2), (315.77, 150.62, .type0), (220.55, 149.57, .type3), (233.05, 163.08, .type1), (203.91, 179.46, .type2), (190.41, 158.73, .type2), (157.78, 137.16, .type3), (126.15, 147.57, .type3), (155.34, 172.28, .type1), (206.58, 151.36, .type0), (257.59, 127.41, .type1), (303.95, 126.36, .type1), (332.95, 141.86, .type0), (295.7, 156.5, .type2), (259.54, 169.05, .type2), (286.38, 177.41, .type1), (328.75, 165.96, .type3), (361.47, 137.07, .type1), (361.47, 137.07, .type3), (409.39, 128.71, .type3), (420.54, 180.41, .type2), (350.85, 187.73, .type2), (274.35, 205.86, .type2), (216.48, 180.76, .type3), (196.01, 210, .type1), (128.64, 151.85, .type2), (81.67, 83.32, .type0), (72.26, 48.12, .type0), (149.29, 59.62, .type3), (162.89, 105.28, .type3), (194.91, 74, .type2), (217.91, 101.89, .type3), (173.27, 103.98, .type1), (211.96, 141.62, .type2), (225.51, 127.07, .type2), (271.52, 95.7, .type0), (306.89, 123.66, .type2), (242.15, 144.57, .type2), (255.74, 177.34, .type2), (290.25, 163.75, .type0), (313.07, 123.89, .type1), (320.34, 94.05, .type0), (221.19, 119.15, .type3), (170.43, 83.68, .type1), (150.57, 133.79, .type1), (106.53, 176.61, .type3), (154.98, 158.84, .type2), (226.9, 156.84, .type1), (272.82, 136.62, .type1), (310.81, 121.98, .type0), (346.14, 134.44, .type2), (337.82, 155.17, .type0), (314.34, 155.17, .type3), (218.14, 145.76, .type3), (152.07, 159.21, .type3), (164.62, 187.1, .type2), (243.72, 187.1, .type3), (285.72, 188.14, .type3), (340.29, 158.09, .type0), (348.65, 112.62, .type1), (401.29, 65.21, .type2), (436.49, 42.21, .type1), (409.44, 92.17, .type3), (338.17, 138.39, .type1), (204.67, 112.25, .type2), (229.77, 82.27, .type1), (316.59, 78.32, .type3), (324.95, 49.74, .type0), (355.18, 69.17, .type2), (265.83, 89.99, .type1), (156.42, 62.89, .type0), (80.14, 92.68, .type2), (123.58, 126.8, .type0), (38.06, 92.38, .type1), (86.07, 121.48, .type3), (37.62, 167.49, .type2), (71.95, 147.62, .type1), (112.89, 150.76, .type1), (67.2, 166.4, .type3), (157.02, 165.79, .type2), (195.58, 176.25, .type2), (165.25, 128.5, .type3), (235.13, 85.62, .type2), (224.77, 138.54, .type0), (179.33, 129.83, .type0), (212.57, 159.67, .type3), (267.76, 117.84, .type0), (349.88, 81.29, .type2), (388.57, 137.62, .type0), (291.43, 155.39, .type3), (239.5, 149.12, .type0), (145.38, 159.23, .type3), (114.02, 195.48, .type2), (162.87, 195.48, .type1), (215.16, 190.25, .type1), (272.32, 206.98, .type1), (332.27, 205.93, .type3), (309.27, 169.68, .type1), (237.81, 152.95, .type1), (165.12, 159.14, .type2), (81.83, 146.63, .type0), (56.73, 76.22, .type3), (38.95, 50.43, .type0), (125.56, 96.3, .type1), (142.29, 51.61, .type1), (200.02, 98.27, .type0), (134.64, 81.59, .type2), (169.96, 126.1, .type0), (230.27, 94.73, .type0), (279.49, 95.77, .type3), (172.06, 125.49, .type2), (215.7, 149.36, .type0), (263.67, 122.26, .type2), (353.09, 136.9, .type3), (277.11, 135.86, .type1), (219.69, 146.31, .type1), (212.37, 164.79, .type3), (285.06, 161.7, .type0), (339.21, 174.11, .type3), (241.1, 166.79, .type3), (229.94, 168.88, .type0), (152.39, 176.89, .type1), (113.98, 183.12, .type0), (80.61, 194.62, .type3), (143.52, 202.99, .type0), (223.44, 187.45, .type2), (287.61, 198.95, .type2), (346.43, 208.27, .type2), (319.73, 176.64, .type2), (363.46, 135.95, .type1), (308.39, 154.42, .type2), (321.89, 170.71, .type0), (374.53, 180.82, .type1), (399.75, 213.87, .type1), (303.51, 212.13, .type3), (188.84, 227.12, .type2), (235.83, 248.01, .type3), (320.18, 219.78, .type0), (401.52, 198.87, .type3), (376.46, 152.99, .type3), (410.62, 109.07, .type3), (428.13, 119.7, .type3), (414.54, 164.31, .type2), (435.36, 200.47, .type2), (437.45, 234.63, .type3), (328.83, 193.85, .type3), (372.57, 191.76, .type3), (430.04, 213.62, .type3), (323.72, 158.2, .type0), (213.23, 109.06, .type2), (133.06, 111.15, .type2), (193.13, 98.6, .type3), (250.3, 93.37, .type0), (319.13, 97.55, .type1), (350.32, 134.62, .type1), (176.52, 122.07, .type1), (92.23, 100.9, .type1), (68.93, 88.05, .type2), (124.21, 158.23, .type3), (280.26, 172.13, .type3), (175.21, 172.96, .type2), (203.27, 186.51, .type3), (206.4, 95.68, .type2), (239.33, 79.04, .type1), (285.34, 80.08, .type3), (303.12, 109.01, .type2), (202.87, 138.29, .type2), (152.03, 102.74, .type1), (130.41, 160.11, .type3), (164.57, 137.11, .type3), (203.13, 145.47, .type2), (225.91, 168.2, .type2), (251, 142.41, .type1), (298.57, 140.32, .type2), (264.8, 199.57, .type2), (307.27, 207.85, .type1), (212.13, 219, .type2), (78.6, 213.77, .type2), (31.68, 244.1, .type1), (218.34, 116.63, .type0), (343.47, 65.39, .type1), (410.68, 44.62, .type0), (427.37, 73.81, .type2), (436.43, 204.17, .type3), (45.53, 32.38, .type2), (106.04, 67.79, .type2), (156.57, 108.6, .type1), (195.98, 71.18, .type0), (240.23, 93.96, .type2), (203.91, 112.65, .type2), (236.4, 126.15, .type2), (255.13, 92.91, .type0), (283.27, 111.6, .type2), (256.36, 159.82, .type3), (217.94, 134.86, .type1), (166.14, 158.21, .type2), (202.33, 182.73, .type3), (259.57, 183.69, .type1), (259.57, 183.69, .type2), (259.57, 135.82, .type1), (120.49, 152.9, .type0), (119.45, 112.34, .type0), (106.9, 172.64, .type1), (201.43, 221.75, .type2), (300.62, 182.24, .type3), (357.11, 173.88, .type2), (390.3, 173.88, .type3), (372.88, 219.19, .type1), (309.44, 171.09, .type2), (258.12, 95.89, .type1), (339.37, 108.43, .type2), (358.91, 122.5, .type2), (377.74, 137.84, .type1), (326, 140.97, .type2), (243.04, 115.53, .type1), (220.62, 99.98, .type0), (96.91, 150.9, .type0), (188.97, 163.4, .type1), (317.27, 193.54, .type2), (398.83, 234.32, .type0), (105.38, 179.99, .type3), (205.45, 105.63, .type1), (286.34, 126.18, .type2), (284.95, 140.47, .type1), (374.53, 122.69, .type0), (231.85, 159.27, .type1), (213.73, 195.17, .type2), (208.54, 153.53, .type0), (153.61, 151.39, .type3), (151.52, 119.38, .type2), (193.59, 110.37, .type2), (248.66, 113.5, .type1), (303.85, 122.91, .type2), (264.16, 155.29, .type3), (218.24, 128.19, .type1), (133.54, 115.29, .type3), (150.18, 162.03, .type3), (135.68, 173.44, .type3), (142.86, 180.23, .type2), (168.65, 175, .type2), (168.65, 175, .type0), (205.12, 172.91, .type2), (153.02, 180.23, .type3), (123.04, 166.63, .type1), (112.63, 135.96, .type1), (191.46, 140.1, .type2), (157.04, 155.79, .type2), (185.28, 124.46, .type1), (212.33, 129.64, .type1), (232.11, 158.43, .type0), (257.11, 129.34, .type1), (298.48, 106.52, .type1), (345.19, 131.96, .type2), (289.86, 151.83, .type0), (211.08, 190.87, .type1), (154.27, 241.06, .type2), (73.49, 226.42, .type0), (276.36, 75.29, .type3), (219.12, 119.98, .type3), (185.24, 83.17, .type3), (76.46, 51.45, .type0), (37.77, 37.51, .type3), (176.36, 124.21, .type0), (234.57, 126.3, .type0), (188.88, 137.71, .type1), (281.23, 149.21, .type1), (325.62, 151.3, .type1), (345.83, 152.35, .type2), (253.27, 153.35, .type3), (253.27, 153.35, .type2), (191.8, 174.21, .type0), (229.02, 179.31, .type1), (271.75, 174.08, .type1), (330.66, 163.62, .type1), (207.65, 165.71, .type0), (135.87, 179.26, .type0), (85.55, 136.22, .type3), (155.27, 137.27, .type1), (128.61, 108.78, .type3), (206.35, 111.91, .type0), (206.35, 111.91, .type0), (206.35, 111.91, .type2), (144.84, 147.33, .type2), (171.75, 135.92, .type1), (236.93, 117.1, .type2), (201.97, 135, .type3), (265.41, 80.62, .type3), (312.42, 96.21, .type1), (232, 141.18, .type0), (348.75, 132.65, .type1), (325.05, 108.6, .type0), (360.6, 137.79, .type2), (322.05, 162.88, .type0), (236.83, 179.57, .type0), (164.33, 119.96, .type2), (113.44, 107.41, .type1), (139.45, 136.46, .type0), (191.73, 136.46, .type2), (254.92, 130.23, .type2), (297.17, 142.09, .type3), (258.57, 150.45, .type2), (189.91, 168.23, .type1), (133.58, 168.23, .type1), (342.5, 166.09, .type3), (150.75, 127.58, .type3), (167.44, 192.93, .type1), (245.92, 197.81, .type1), (280.43, 149.01, .type3), (280.43, 149.01, .type1), (319.89, 131.37, .type3), (204.96, 128.33, .type3), (125.83, 111.25, .type0), (344.74, 136.65, .type0) - ] - - let layerSpecifications: [MyExampleModelDataType : (shape: Shape, color: UIColor)] = [ - .type0 : (.triangle, UIColor.red), - .type1 : (.square, UIColor.blue), - .type2 : (.circle, UIColor.green), - .type3 : (.cross, UIColor.black) - ] - - - let xValues = stride(from: 0, through: 450, by: 50).map {ChartAxisValueInt($0, labelSettings: labelSettings)} - let yValues = stride(from: 0, through: 300, by: 50).map {ChartAxisValueInt($0, labelSettings: labelSettings)} - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let scatterLayers = toLayers(models, layerSpecifications: layerSpecifications, xAxis: xAxisLayer, yAxis: yAxisLayer, chartInnerFrame: innerFrame) - - let guidelinesLayerSettings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: guidelinesLayerSettings) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer - ] + scatterLayers - ) - - view.addSubview(chart.view) - self.chart = chart - } - - fileprivate func toLayers(_ models: [(x: Double, y: Double, type: MyExampleModelDataType)], layerSpecifications: [MyExampleModelDataType : (shape: Shape, color: UIColor)], xAxis: ChartAxisLayer, yAxis: ChartAxisLayer, chartInnerFrame: CGRect) -> [ChartLayer] { - - // group chartpoints by type - var groupedChartPoints: Dictionary = [:] - for model in models { - let chartPoint = ChartPoint(x: ChartAxisValueDouble(model.x), y: ChartAxisValueDouble(model.y)) - if groupedChartPoints[model.type] != nil { - groupedChartPoints[model.type]!.append(chartPoint) - - } else { - groupedChartPoints[model.type] = [chartPoint] - } - } - - let tapSettings = ChartPointsTapSettings() - - // create layer for each group - let dim: CGFloat = Env.iPad ? 14 : 7 - let size = CGSize(width: dim, height: dim) - let layers: [ChartLayer] = groupedChartPoints.map {(type, chartPoints) in - let layerSpecification = layerSpecifications[type]! - switch layerSpecification.shape { - case .triangle: - return ChartPointsScatterTrianglesLayer(xAxis: xAxis.axis, yAxis: yAxis.axis, chartPoints: chartPoints, itemSize: size, itemFillColor: layerSpecification.color, tapSettings: tapSettings) - case .square: - return ChartPointsScatterSquaresLayer(xAxis: xAxis.axis, yAxis: yAxis.axis, chartPoints: chartPoints, itemSize: size, itemFillColor: layerSpecification.color, tapSettings: tapSettings) - case .circle: - return ChartPointsScatterCirclesLayer(xAxis: xAxis.axis, yAxis: yAxis.axis, chartPoints: chartPoints, itemSize: size, itemFillColor: layerSpecification.color, tapSettings: tapSettings) - case .cross: - return ChartPointsScatterCrossesLayer(xAxis: xAxis.axis, yAxis: yAxis.axis, chartPoints: chartPoints, itemSize: size, itemFillColor: layerSpecification.color, tapSettings: tapSettings) - } - } - - return layers - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/StackedBarsExample.swift b/Dependecies/SwiftCharts/Examples/Examples/StackedBarsExample.swift deleted file mode 100644 index 21ed829a7..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/StackedBarsExample.swift +++ /dev/null @@ -1,188 +0,0 @@ -// -// StackedBarsExample.swift -// Examples -// -// Created by ischuetz on 15/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class StackedBarsExample: UIViewController { - - fileprivate var chart: Chart? // arc - - let sideSelectorHeight: CGFloat = 50 - - fileprivate func chart(horizontal: Bool) -> Chart { - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let alpha: CGFloat = 0.6 - - let color0 = UIColor.gray.withAlphaComponent(alpha) - let color1 = UIColor.blue.withAlphaComponent(alpha) - let color2 = UIColor.red.withAlphaComponent(alpha) - let color3 = UIColor.green.withAlphaComponent(alpha) - - let zero = ChartAxisValueDouble(0) - let barModels = [ - ChartStackedBarModel(constant: ChartAxisValueString("A", order: 1, labelSettings: labelSettings), start: zero, items: [ - ChartStackedBarItemModel(quantity: 20, bgColor: color0), - ChartStackedBarItemModel(quantity: 60, bgColor: color1), - ChartStackedBarItemModel(quantity: 30, bgColor: color2), - ChartStackedBarItemModel(quantity: 20, bgColor: color3) - ]), - ChartStackedBarModel(constant: ChartAxisValueString("B", order: 2, labelSettings: labelSettings), start: zero, items: [ - ChartStackedBarItemModel(quantity: 40, bgColor: color0), - ChartStackedBarItemModel(quantity: 30, bgColor: color1), - ChartStackedBarItemModel(quantity: 10, bgColor: color2), - ChartStackedBarItemModel(quantity: 30, bgColor: color3) - ]), - ChartStackedBarModel(constant: ChartAxisValueString("C", order: 3, labelSettings: labelSettings), start: zero, items: [ - ChartStackedBarItemModel(quantity: 30, bgColor: color0), - ChartStackedBarItemModel(quantity: 50, bgColor: color1), - ChartStackedBarItemModel(quantity: 20, bgColor: color2), - ChartStackedBarItemModel(quantity: 10, bgColor: color3) - ]), - ChartStackedBarModel(constant: ChartAxisValueString("D", order: 4, labelSettings: labelSettings), start: zero, items: [ - ChartStackedBarItemModel(quantity: 10, bgColor: color0), - ChartStackedBarItemModel(quantity: 30, bgColor: color1), - ChartStackedBarItemModel(quantity: 50, bgColor: color2), - ChartStackedBarItemModel(quantity: 5, bgColor: color3) - ]) - ] - - let (axisValues1, axisValues2) = ( - stride(from: 0, through: 150, by: 20).map {ChartAxisValueDouble(Double($0), labelSettings: labelSettings)}, - [ChartAxisValueString("", order: 0, labelSettings: labelSettings)] + barModels.map{$0.constant} + [ChartAxisValueString("", order: 5, labelSettings: labelSettings)] - ) - let (xValues, yValues) = horizontal ? (axisValues1, axisValues2) : (axisValues2, axisValues1) - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - - let frame = ExamplesDefaults.chartFrame(view.bounds) - let chartFrame = chart?.frame ?? CGRect(x: frame.origin.x, y: frame.origin.y, width: frame.size.width, height: frame.size.height - sideSelectorHeight) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let barViewSettings = ChartBarViewSettings(animDuration: 0.5) - let chartStackedBarsLayer = ChartStackedBarsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, innerFrame: innerFrame, barModels: barModels, horizontal: horizontal, barWidth: 40, settings: barViewSettings, stackFrameSelectionViewUpdater: ChartViewSelectorAlpha(selectedAlpha: 1, deselectedAlpha: alpha)) {tappedBar in - - guard let stackFrameData = tappedBar.stackFrameData else {return} - - let chartViewPoint = tappedBar.layer.contentToGlobalCoordinates(CGPoint(x: tappedBar.barView.frame.midX, y: stackFrameData.stackedItemViewFrameRelativeToBarParent.minY))! - let viewPoint = CGPoint(x: chartViewPoint.x, y: chartViewPoint.y + 70) - let infoBubble = InfoBubble(point: viewPoint, preferredSize: CGSize(width: 50, height: 40), superview: self.view, text: "\(stackFrameData.stackedItemModel.quantity)", font: ExamplesDefaults.labelFont, textColor: UIColor.white, bgColor: UIColor.black) - infoBubble.tapHandler = { - infoBubble.removeFromSuperview() - } - self.view.addSubview(infoBubble) - } - - let settings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - return Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - chartStackedBarsLayer - ] - ) - } - - fileprivate func showChart(horizontal: Bool) { - self.chart?.clearView() - - let chart = self.chart(horizontal: horizontal) - view.addSubview(chart.view) - self.chart = chart - } - - override func viewDidLoad() { - super.viewDidLoad() - showChart(horizontal: true) - if let chart = chart { - let sideSelector = DirSelector(frame: CGRect(x: 0, y: chart.frame.origin.y + chart.frame.size.height, width: view.frame.size.width, height: sideSelectorHeight), controller: self) - view.addSubview(sideSelector) - } - } - - class DirSelector: UIView { - - let horizontal: UIButton - let vertical: UIButton - - weak var controller: StackedBarsExample? - - fileprivate let buttonDirs: [UIButton : Bool] - - init(frame: CGRect, controller: StackedBarsExample) { - - self.controller = controller - - self.horizontal = UIButton() - self.horizontal.setTitle("Horizontal", for: UIControl.State()) - self.vertical = UIButton() - self.vertical.setTitle("Vertical", for: UIControl.State()) - - self.buttonDirs = [horizontal: true, vertical: false] - - super.init(frame: frame) - - addSubview(horizontal) - addSubview(vertical) - - for button in [horizontal, vertical] { - button.titleLabel?.font = ExamplesDefaults.fontWithSize(14) - button.setTitleColor(UIColor.blue, for: UIControl.State()) - button.addTarget(self, action: #selector(DirSelector.buttonTapped(_:)), for: .touchUpInside) - } - } - - @objc func buttonTapped(_ sender: UIButton) { - let horizontal = sender == self.horizontal ? true : false - controller?.showChart(horizontal: horizontal) - } - - override func didMoveToSuperview() { - let views = [horizontal, vertical] - for v in views { - v.translatesAutoresizingMaskIntoConstraints = false - } - - let namedViews = views.enumerated().map{index, view in - ("v\(index)", view) - } - - var viewsDict = Dictionary() - for namedView in namedViews { - viewsDict[namedView.0] = namedView.1 - } - - let buttonsSpace: CGFloat = Env.iPad ? 20 : 10 - - let hConstraintStr = namedViews.reduce("H:|") {str, tuple in - "\(str)-(\(buttonsSpace))-[\(tuple.0)]" - } - - let vConstraits = namedViews.flatMap {NSLayoutConstraint.constraints(withVisualFormat: "V:|[\($0.0)]", options: NSLayoutConstraint.FormatOptions(), metrics: nil, views: viewsDict)} - - addConstraints(NSLayoutConstraint.constraints(withVisualFormat: hConstraintStr, options: NSLayoutConstraint.FormatOptions(), metrics: nil, views: viewsDict) - + vConstraits) - } - - required init(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/TargetExample.swift b/Dependecies/SwiftCharts/Examples/Examples/TargetExample.swift deleted file mode 100644 index 08149ba6c..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/TargetExample.swift +++ /dev/null @@ -1,68 +0,0 @@ -// -// TargetExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class TargetExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let chartPoints: [ChartPoint] = [(2, 2), (4, 4), (7, 1), (8, 11), (12, 3)].map{ChartPoint(x: ChartAxisValueInt($0.0, labelSettings: labelSettings), y: ChartAxisValueInt($0.1))} - - let xValues = chartPoints.map{$0.x} - - let yValues = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: labelSettings)}, addPaddingSegmentIfEdge: false) - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let lineModel = ChartLineModel(chartPoints: chartPoints, lineColor: UIColor.red, animDuration: 0.5, animDelay: 0) - - let targetGenerator = {(chartPointModel: ChartPointLayerModel, layer: ChartPointsLayer, chart: Chart) -> UIView? in - if chartPointModel.index != 3 { - return nil - } - return ChartPointTargetingView(chartPoint: chartPointModel.chartPoint, screenLoc: chartPointModel.screenLoc, animDuration: 0.5, animDelay: 1, layer: layer, chart: chart) - } - - let chartPointsTargetLayer = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints, viewGenerator: targetGenerator) - - let chartPointsLineLayer = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [lineModel]) - - let settings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - chartPointsLineLayer, - chartPointsTargetLayer - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/TrackerExample.swift b/Dependecies/SwiftCharts/Examples/Examples/TrackerExample.swift deleted file mode 100644 index b415e04aa..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/TrackerExample.swift +++ /dev/null @@ -1,86 +0,0 @@ -// -// TrackerExample.swift -// SwiftCharts -// -// Created by ischuetz on 04/05/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class TrackerExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let chartPoints = [(2, 2), (4, 4), (7, 1), (8, 11), (12, 3)].map{ChartPoint(x: ChartAxisValueDouble($0.0, labelSettings: labelSettings), y: ChartAxisValueDouble($0.1))} - - let chartPoints2 = [(2, 3), (3, 1), (5, 6), (7, 2), (8, 14), (12, 6)].map{ChartPoint(x: ChartAxisValueDouble($0.0, labelSettings: labelSettings), y: ChartAxisValueDouble($0.1))} - - let xValues = chartPoints.map{$0.x} - - let yValues = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: labelSettings)}, addPaddingSegmentIfEdge: false) - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let lineModel = ChartLineModel(chartPoints: chartPoints, lineColor: UIColor.red, animDuration: 1, animDelay: 0) - let lineModel2 = ChartLineModel(chartPoints: chartPoints2, lineColor: UIColor.blue, animDuration: 1, animDelay: 0) - let chartPointsLineLayer = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [lineModel, lineModel2], useView: false) - - let thumbSettings = ChartPointsLineTrackerLayerThumbSettings(thumbSize: Env.iPad ? 20 : 10, thumbBorderWidth: Env.iPad ? 4 : 2) - let trackerLayerSettings = ChartPointsLineTrackerLayerSettings(thumbSettings: thumbSettings) - - var currentPositionLabels: [UILabel] = [] - - let chartPointsTrackerLayer = ChartPointsLineTrackerLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lines: [chartPoints, chartPoints2], lineColor: UIColor.black, animDuration: 1, animDelay: 2, settings: trackerLayerSettings) {chartPointsWithScreenLoc in - - currentPositionLabels.forEach{$0.removeFromSuperview()} - - for (index, chartPointWithScreenLoc) in chartPointsWithScreenLoc.enumerated() { - - let label = UILabel() - label.text = chartPointWithScreenLoc.chartPoint.description - label.sizeToFit() - label.center = CGPoint(x: chartPointWithScreenLoc.screenLoc.x + label.frame.width / 2, y: chartPointWithScreenLoc.screenLoc.y + chartFrame.minY - label.frame.height / 2) - - label.backgroundColor = index == 0 ? UIColor.red : UIColor.blue - label.textColor = UIColor.white - - currentPositionLabels.append(label) - self.view.addSubview(label) - } - } - - let settings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - chartPointsLineLayer, - chartPointsTrackerLayer - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } - -} diff --git a/Dependecies/SwiftCharts/Examples/Examples/TrendlineExample.swift b/Dependecies/SwiftCharts/Examples/Examples/TrendlineExample.swift deleted file mode 100644 index 1169e5391..000000000 --- a/Dependecies/SwiftCharts/Examples/Examples/TrendlineExample.swift +++ /dev/null @@ -1,62 +0,0 @@ -// -// TrendlineExample.swift -// Examples -// -// Created by ischuetz on 03/08/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit -import SwiftCharts - -class TrendlineExample: UIViewController { - - fileprivate var chart: Chart? // arc - - override func viewDidLoad() { - super.viewDidLoad() - - let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - - let chartPoints: [ChartPoint] = [(1, 3), (2, 5), (3, 7.5), (4, 10), (5, 6), (6, 12)].map{ChartPoint(x: ChartAxisValueDouble($0.0, labelSettings: labelSettings), y: ChartAxisValueDouble($0.1))} - - let xValues = chartPoints.map{$0.x} - let yValues = ChartAxisValuesStaticGenerator.generateYAxisValuesWithChartPoints(chartPoints, minSegmentCount: 10, maxSegmentCount: 20, multiple: 2, axisValueGenerator: {ChartAxisValueDouble($0, labelSettings: labelSettings)}, addPaddingSegmentIfEdge: false) - - let lineModel = ChartLineModel(chartPoints: chartPoints, lineColor: UIColor.red, animDuration: 1, animDelay: 0) - - let trendLineModel = ChartLineModel(chartPoints: TrendlineGenerator.trendline(chartPoints), lineColor: UIColor.blue, animDuration: 0.5, animDelay: 1) - - let xModel = ChartAxisModel(axisValues: xValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings)) - let yModel = ChartAxisModel(axisValues: yValues, axisTitleLabel: ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())) - let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - - let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - - let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) - let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - - let chartPointsLineLayer = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [lineModel]) - - let trendLineLayer = ChartPointsLineLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, lineModels: [trendLineModel]) - - let settings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) - let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: settings) - - let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - chartPointsLineLayer, - trendLineLayer - ] - ) - - view.addSubview(chart.view) - self.chart = chart - } -} diff --git a/Dependecies/SwiftCharts/Examples/HorizontalGuide.swift b/Dependecies/SwiftCharts/Examples/HorizontalGuide.swift deleted file mode 100644 index 9f1de1bf9..000000000 --- a/Dependecies/SwiftCharts/Examples/HorizontalGuide.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// HorizontalGuide.swift -// SwiftCharts -// -// Created by ischuetz on 14/08/16. -// Copyright © 2016 ivanschuetz. All rights reserved. -// - -import UIKit - -/// Debug helper -class HorizontalGuide: UIView { - - init(_ location: CGFloat, color: UIColor = UIColor.red) { - super.init(frame: CGRect(x: -10000000, y: location, width: 100000000, height: 1)) - backgroundColor = color - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } -} \ No newline at end of file diff --git a/Dependecies/SwiftCharts/Examples/Interface/Base.lproj/LaunchScreen.xib b/Dependecies/SwiftCharts/Examples/Interface/Base.lproj/LaunchScreen.xib deleted file mode 100644 index 1dda869f5..000000000 --- a/Dependecies/SwiftCharts/Examples/Interface/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Dependecies/SwiftCharts/Examples/Interface/Base.lproj/Main.storyboard b/Dependecies/SwiftCharts/Examples/Interface/Base.lproj/Main.storyboard deleted file mode 100755 index 027b813d4..000000000 --- a/Dependecies/SwiftCharts/Examples/Interface/Base.lproj/Main.storyboard +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Dependecies/SwiftCharts/Examples/Interface/Base.lproj/Main_iPhone.storyboard b/Dependecies/SwiftCharts/Examples/Interface/Base.lproj/Main_iPhone.storyboard deleted file mode 100755 index 3ff258158..000000000 --- a/Dependecies/SwiftCharts/Examples/Interface/Base.lproj/Main_iPhone.storyboard +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Contents.json b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index c8477e67f..000000000 --- a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,158 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - }, - "images" : [ - { - "filename" : "Icon-40.png", - "size" : "40x40", - "idiom" : "ipad", - "scale" : "1x" - }, - { - "filename" : "Icon-40@2x.png", - "size" : "40x40", - "idiom" : "ipad", - "scale" : "2x" - }, - { - "filename" : "Icon-60@2x.png", - "size" : "60x60", - "idiom" : "iphone", - "scale" : "2x" - }, - { - "filename" : "Icon-72.png", - "size" : "72x72", - "idiom" : "ipad", - "scale" : "1x" - }, - { - "filename" : "Icon-72@2x.png", - "size" : "72x72", - "idiom" : "ipad", - "scale" : "2x" - }, - { - "filename" : "Icon-76.png", - "size" : "76x76", - "idiom" : "ipad", - "scale" : "1x" - }, - { - "filename" : "Icon-76@2x.png", - "size" : "76x76", - "idiom" : "ipad", - "scale" : "2x" - }, - { - "filename" : "Icon-Small-50.png", - "size" : "50x50", - "idiom" : "ipad", - "scale" : "1x" - }, - { - "filename" : "Icon-Small-50@2x.png", - "size" : "50x50", - "idiom" : "ipad", - "scale" : "2x" - }, - { - "filename" : "Icon-Small.png", - "size" : "29x29", - "idiom" : "iphone", - "scale" : "1x" - }, - { - "filename" : "Icon-Small@2x.png", - "size" : "29x29", - "idiom" : "iphone", - "scale" : "2x" - }, - { - "filename" : "Icon.png", - "size" : "57x57", - "idiom" : "iphone", - "scale" : "1x" - }, - { - "filename" : "Icon@2x.png", - "size" : "57x57", - "idiom" : "iphone", - "scale" : "2x" - }, - { - "filename" : "Icon-Small@3x.png", - "size" : "29x29", - "idiom" : "iphone", - "scale" : "3x" - }, - { - "filename" : "Icon-40@3x.png", - "size" : "40x40", - "idiom" : "iphone", - "scale" : "3x" - }, - { - "filename" : "Icon-60@3x.png", - "size" : "60x60", - "idiom" : "iphone", - "scale" : "3x" - }, - { - "filename" : "Icon-40@2x.png", - "size" : "40x40", - "idiom" : "iphone", - "scale" : "2x" - }, - { - "filename" : "Icon-Small.png", - "size" : "29x29", - "idiom" : "ipad", - "scale" : "1x" - }, - { - "filename" : "Icon-Small@2x.png", - "size" : "29x29", - "idiom" : "ipad", - "scale" : "2x" - }, - { - "filename" : "Icon-83.5@2x.png", - "size" : "83.5x83.5", - "idiom" : "ipad", - "scale" : "2x" - }, - { - "filename" : "NotificationIcon@2x.png", - "size" : "20x20", - "idiom" : "iphone", - "scale" : "2x" - }, - { - "filename" : "NotificationIcon@3x.png", - "size" : "20x20", - "idiom" : "iphone", - "scale" : "3x" - }, - { - "filename" : "NotificationIcon~ipad.png", - "size" : "20x20", - "idiom" : "ipad", - "scale" : "1x" - }, - { - "filename" : "NotificationIcon~ipad@2x.png", - "size" : "20x20", - "idiom" : "ipad", - "scale" : "2x" - }, - { - "filename" : "ios-marketing.png", - "size" : "1024x1024", - "idiom" : "ios-marketing", - "scale" : "1x" - } - ] -} \ No newline at end of file diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-40.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-40.png deleted file mode 100644 index fd47a0df8..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-40.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png deleted file mode 100644 index def1f7fae..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png deleted file mode 100644 index 7f38f6346..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png deleted file mode 100644 index 7f38f6346..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png deleted file mode 100644 index 27f706500..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-72.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-72.png deleted file mode 100644 index b5555b960..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-72.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png deleted file mode 100644 index 6a5ced449..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-76.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-76.png deleted file mode 100644 index 693fd211a..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-76.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png deleted file mode 100644 index c1af987ea..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png deleted file mode 100644 index 9c44cf373..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small-50.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small-50.png deleted file mode 100644 index e337a55b5..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small-50.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png deleted file mode 100644 index 758fbfe17..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small.png deleted file mode 100644 index 1f6037e58..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png deleted file mode 100644 index c16b320ba..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png deleted file mode 100644 index 81fef981d..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon.png deleted file mode 100644 index a6f2c4039..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon@2x.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon@2x.png deleted file mode 100644 index 0a1d8ce48..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/Icon@2x.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/NotificationIcon@2x.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/NotificationIcon@2x.png deleted file mode 100644 index fd47a0df8..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/NotificationIcon@2x.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/NotificationIcon@3x.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/NotificationIcon@3x.png deleted file mode 100644 index eb27226a9..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/NotificationIcon@3x.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/NotificationIcon~ipad.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/NotificationIcon~ipad.png deleted file mode 100644 index f3c49cc57..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/NotificationIcon~ipad.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/NotificationIcon~ipad@2x.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/NotificationIcon~ipad@2x.png deleted file mode 100644 index fd47a0df8..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/NotificationIcon~ipad@2x.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/ios-marketing.png b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/ios-marketing.png deleted file mode 100644 index 6f11a0694..000000000 Binary files a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/AppIcon.appiconset/ios-marketing.png and /dev/null differ diff --git a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/LaunchImage.launchimage/Contents.json b/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index 3dd8aa5b6..000000000 --- a/Dependecies/SwiftCharts/Examples/Interface/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "8.0", - "subtype" : "736h", - "scale" : "3x" - }, - { - "orientation" : "landscape", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "8.0", - "subtype" : "736h", - "scale" : "3x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "8.0", - "subtype" : "667h", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Dependecies/SwiftCharts/Examples/MasterViewController.swift b/Dependecies/SwiftCharts/Examples/MasterViewController.swift deleted file mode 100644 index 71c936167..000000000 --- a/Dependecies/SwiftCharts/Examples/MasterViewController.swift +++ /dev/null @@ -1,128 +0,0 @@ -// -// MasterViewController.swift -// SwiftCharts -// -// Created by ischuetz on 20/04/15. -// Copyright (c) 2015 ivanschuetz. All rights reserved. -// - -import UIKit - - -enum Example { - case helloWorld, bars, stackedBars, barsPlusMinus, groupedBars, barsStackedGrouped, scatter, areas, rangedAxis, bubble, coords, target, multival, notifications, combination, equalSpacing, tracker, multiTracker, multiAxis, multiAxisInteractive, candleStick, cubiclines, cubiclinesWithGradient, notNumeric, candleStickInteractive, customUnits, trendline -} - -class MasterViewController: UITableViewController { - - var detailViewController: DetailViewController? = nil - var examples: [(Example, String)] = [ - (.helloWorld, "Hello World"), - (.bars, "Bars"), - (.stackedBars, "Stacked bars"), - (.barsPlusMinus, "+/- bars with dynamic gradient"), - (.groupedBars, "Grouped bars"), - (.barsStackedGrouped, "Stacked, grouped bars"), - (.combination, "+/- bars and line"), - (.scatter, "Scatter"), - (.notifications, "Notifications (interactive)"), - (.target, "Target point animation"), - (.areas, "Areas, lines, circles (interactive)"), - (.rangedAxis, "Ranged axis, rotation"), - (.bubble, "Bubble, gradient bar mapping"), - (.notNumeric, "Not numeric values"), - (.coords, "Show touch coords (interactive)"), - (.tracker, "Track touch (interactive)"), - (.multiTracker, "Multi-chart touch tracking"), - (.equalSpacing, "Fixed axis spacing"), - (.customUnits, "Custom units, scrollable"), - (.multival, "Multiple axis labels"), - (.multiAxis, "Multiple axes"), - (.multiAxisInteractive, "Multiple axes (interactive)"), - (.candleStick, "Candlestick"), - (.candleStickInteractive, "Candlestick (tracker, custom views)"), - (.cubiclines, "Cubic lines"), - (.cubiclinesWithGradient, "Cubic lines with gradient"), - (.trendline, "Trendline") - ] - - override func awakeFromNib() { - super.awakeFromNib() - if UIDevice.current.userInterfaceIdiom == .pad { - clearsSelectionOnViewWillAppear = false - preferredContentSize = CGSize(width: 320.0, height: 600.0) - } - } - - override func viewDidLoad() { - super.viewDidLoad() - - navigationController?.navigationBar.titleTextAttributes = [.font : ExamplesDefaults.fontWithSize(22)] - UIBarButtonItem.appearance().setTitleTextAttributes([.font : ExamplesDefaults.fontWithSize(22)], - for: UIControl.State()) - - if let split = splitViewController { - - let controllers = split.viewControllers - - detailViewController = (controllers[controllers.count-1] as! UINavigationController).topViewController as? DetailViewController - - let example = examples[1] - detailViewController?.detailItem = example.0 - detailViewController?.title = example.1 - } - - if (UIDevice.current.userInterfaceIdiom != .pad) { - performSegue(withIdentifier: "showDetail", sender: self) - } - } - - // MARK: - Segues - - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - if segue.identifier == "showDetail" { - - func showExample(_ index: Int) { - let example = examples[index] - let controller = segue.destination as! DetailViewController - controller.detailItem = example.0 - controller.title = example.1 - - } - - if let indexPath = tableView.indexPathForSelectedRow { - showExample((indexPath as NSIndexPath).row) - } else { - showExample(11) - } - } - } - - override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - if UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.pad { - let example = examples[indexPath.row] - detailViewController?.detailItem = example.0 - detailViewController?.title = example.1 - - splitViewController?.toggleMasterView() - } - } - - // MARK: - Table View - - override func numberOfSections(in tableView: UITableView) -> Int { - return 1 - } - - override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return examples.count - } - - override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as UITableViewCell - cell.textLabel!.text = examples[indexPath.row].1 - cell.textLabel!.font = ExamplesDefaults.fontWithSize(Env.iPad ? 22 : 16) - return cell - } -} - diff --git a/Dependecies/SwiftCharts/Examples/PointGuide.swift b/Dependecies/SwiftCharts/Examples/PointGuide.swift deleted file mode 100644 index fdd4cc1a8..000000000 --- a/Dependecies/SwiftCharts/Examples/PointGuide.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// PointGuide.swift -// SwiftCharts -// -// Created by ischuetz on 19/08/16. -// Copyright © 2016 ivanschuetz. All rights reserved. -// - -import UIKit - -/// Debug helper -class PointGuide: UIView { - - let size: CGFloat = 5 - - init(_ location: CGPoint, color: UIColor = UIColor.red) { - super.init(frame: CGRect(x: location.x - size / 2, y: location.y - size / 2, width: size, height: size)) - backgroundColor = color - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } -} diff --git a/Dependecies/SwiftCharts/Examples/String.swift b/Dependecies/SwiftCharts/Examples/String.swift deleted file mode 100644 index 48f3021c6..000000000 --- a/Dependecies/SwiftCharts/Examples/String.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// String.swift -// SwiftCharts -// -// Created by ischuetz on 13/08/16. -// Copyright © 2016 ivanschuetz. All rights reserved. -// - -import UIKit - -extension String { - - func size(_ font: UIFont) -> CGSize { - return NSAttributedString(string: self, attributes: [.font: font]).size() - } - - func width(_ font: UIFont) -> CGFloat { - return size(font).width - } - - func height(_ font: UIFont) -> CGFloat { - return size(font).height - } -} diff --git a/Dependecies/SwiftCharts/Examples/Supporting Files/Info.plist b/Dependecies/SwiftCharts/Examples/Supporting Files/Info.plist deleted file mode 100755 index 635e71828..000000000 --- a/Dependecies/SwiftCharts/Examples/Supporting Files/Info.plist +++ /dev/null @@ -1,62 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - SwiftCharts - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIMainStoryboardFile~iphone - Main_iPhone - UIRequiredDeviceCapabilities - - armv7 - - UIStatusBarTintParameters - - UINavigationBar - - Style - UIBarStyleDefault - Translucent - - - - UISupportedInterfaceOrientations - - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/Dependecies/SwiftCharts/Examples/UIColor.swift b/Dependecies/SwiftCharts/Examples/UIColor.swift deleted file mode 100644 index 19b57e635..000000000 --- a/Dependecies/SwiftCharts/Examples/UIColor.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// UIColor.swift -// SwiftCharts -// -// Created by Ivan Schuetz on 17/02/2017. -// Copyright © 2017 ivanschuetz. All rights reserved. -// - -import UIKit - -extension UIColor { - - public convenience init(hexString: String) { - let hexString = hexString.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines) as String - let scanner = Scanner(string: hexString) - - if (hexString.hasPrefix("#")) { - scanner.scanLocation = 1 - } - - var color: UInt32 = 0 - scanner.scanHexInt32(&color) - - let mask = 0x000000FF - let r = Int(color >> 16) & mask - let g = Int(color >> 8) & mask - let b = Int(color) & mask - - let red = CGFloat(r) / 255.0 - let green = CGFloat(g) / 255.0 - let blue = CGFloat(b) / 255.0 - - self.init(red:red, green:green, blue:blue, alpha:1) - } - -} diff --git a/Dependecies/SwiftCharts/Examples/VerticalGuide.swift b/Dependecies/SwiftCharts/Examples/VerticalGuide.swift deleted file mode 100644 index a67c4a900..000000000 --- a/Dependecies/SwiftCharts/Examples/VerticalGuide.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// VerticalGuide.swift -// SwiftCharts -// -// Created by ischuetz on 14/08/16. -// Copyright © 2016 ivanschuetz. All rights reserved. -// - -import UIKit - -/// Debug helper -class VerticalGuide: UIView { - - init(_ location: CGFloat, color: UIColor = UIColor.red) { - super.init(frame: CGRect(x: location, y: -10000000, width: 1, height: 100000000)) - backgroundColor = color - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } -} \ No newline at end of file diff --git a/Dependecies/SwiftCharts/Issue_template.md b/Dependecies/SwiftCharts/Issue_template.md deleted file mode 100644 index 95b023bcf..000000000 --- a/Dependecies/SwiftCharts/Issue_template.md +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/Dependecies/SwiftCharts/LICENSE b/Dependecies/SwiftCharts/LICENSE deleted file mode 100644 index 442a12d1a..000000000 --- a/Dependecies/SwiftCharts/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2015 Ivan Schütz - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/Dependecies/SwiftCharts/README.md b/Dependecies/SwiftCharts/README.md deleted file mode 100644 index b177be4b6..000000000 --- a/Dependecies/SwiftCharts/README.md +++ /dev/null @@ -1,276 +0,0 @@ -# SwiftCharts - -[![Version](https://img.shields.io/cocoapods/v/SwiftCharts.svg?style=flat)](http://cocoadocs.org/docsets/SwiftCharts) -[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) -[![License](https://img.shields.io/cocoapods/l/SwiftCharts.svg?style=flat)](http://cocoadocs.org/docsets/SwiftCharts) - -Easy to use and highly customizable charts library for iOS - -## Features: -- Bars - plain, stacked, grouped, horizontal, vertical -- Scatter -- Lines (straight/cubic/custom path generator) -- Areas -- Bubble -- Multiple axes -- Candlestick -- Multiple labels per value (x axis) -- Everything is customizable - colors, views, units, labels, animations, interactions, axes, etc. -- Easy creation of arbitrary markers, overlays, info views, etc., using simple UIViews! -- Modular architecture, which allows to easily create new chart types or add effects to existing types externally (without library changes). -- Charts can be combined with each other. -- [Pie chart*](https://github.com/i-schuetz/PieCharts) -- [Legends*](https://github.com/i-schuetz/ChartLegends) -- Zooming & panning, lockable to x/y axis, max delta or both. Elastic effect. (unreleased) -- Extensible axis values and label generators for numbers, dates, etc, with customizable zooming handling (nice numbers, divide in half, etc). (unreleased). - -*These are separate repos for better focus and reusability. - -iOS 7+ - -[Video](https://www.youtube.com/watch?v=bD6uDF-KckM) - -[Documentation](https://github.com/i-schuetz/SwiftCharts/wiki) - - -![ScreenShot](Screenshots/IMG_0102.jpeg) -![ScreenShot](Screenshots/IMG_0022.jpeg) -![ScreenShot](Screenshots/IMG_0023.jpeg) -![ScreenShot of Multi-chart touch tracking](Screenshots/multi-chart-touch.jpg) - -![ScreenShot](Screenshots/IMG_1328.PNG) - -![ScreenShot](Screenshots/IMG_0026.jpeg) -![ScreenShot](Screenshots/IMG_0101.jpeg) -![ScreenShot](Screenshots/IMG_0027.jpeg) -![ScreenShot](Screenshots/IMG_1330.PNG) -![ScreenShot](Screenshots/IMG_0029.jpeg) -![ScreenShot](Screenshots/IMG_1332.PNG) -![ScreenShot](Screenshots/IMG_0033.jpeg) -![ScreenShot](Screenshots/IMG_0034.jpeg) -![ScreenShot](Screenshots/IMG_0037.jpeg) -![ScreenShot](Screenshots/IMG_1334.PNG) -![ScreenShot](Screenshots/IMG_0039.jpeg) -![ScreenShot](Screenshots/IMG_0040.jpeg) -![ScreenShot](Screenshots/IMG_0041.jpeg) - - -## Installation - -### CocoaPods - -Add to your Podfile: - -```ruby -use_frameworks! -pod 'SwiftCharts', '~> 0.6.5' -``` - - -To use master directly: -```ruby -pod 'SwiftCharts', :git => 'https://github.com/i-schuetz/SwiftCharts.git' -``` - -And then: -```ruby -pod install -``` - -Import the framework in your code: -```swift -import SwiftCharts -``` - -### Carthage - -Add to your Cartfile: - -``` -github "i-schuetz/SwiftCharts" ~> 0.6.5 -``` - -## Contribute - -Contributions are highly appreciated! To submit one: - -1. Fork -2. Commit changes to a branch in your fork -3. Push your code and make a pull request - -## Quick start - -Multiline chart: - -```swift -let chartConfig = ChartConfigXY( - xAxisConfig: ChartAxisConfig(from: 2, to: 14, by: 2), - yAxisConfig: ChartAxisConfig(from: 0, to: 14, by: 2) -) - -let frame = CGRect(x: 0, y: 70, width: 300, height: 500) - -let chart = LineChart( - frame: frame, - chartConfig: chartConfig, - xTitle: "X axis", - yTitle: "Y axis", - lines: [ - (chartPoints: [(2.0, 10.6), (4.2, 5.1), (7.3, 3.0), (8.1, 5.5), (14.0, 8.0)], color: UIColor.red), - (chartPoints: [(2.0, 2.6), (4.2, 4.1), (7.3, 1.0), (8.1, 11.5), (14.0, 3.0)], color: UIColor.blue) - ] -) - -self.view.addSubview(chart.view) -``` - -Bars chart: - -```swift -let chartConfig = BarsChartConfig( - valsAxisConfig: ChartAxisConfig(from: 0, to: 8, by: 2) -) - -let frame = CGRect(x: 0, y: 70, width: 300, height: 500) - -let chart = BarsChart( - frame: frame, - chartConfig: chartConfig, - xTitle: "X axis", - yTitle: "Y axis", - bars: [ - ("A", 2), - ("B", 4.5), - ("C", 3), - ("D", 5.4), - ("E", 6.8), - ("F", 0.5) - ], - color: UIColor.red, - barWidth: 20 -) - -self.view.addSubview(chart.view) -self.chart = chart -``` - -## Concept: - -- Layer architecture, which makes it extremely easy to customize charts, create new types, combine existing ones and add interactive elements. - -- Creation of views via a generator function, which makes it easy to use custom views in any layer. - -### Main Components: - -#### 1. Layers: - -A chart is the result of composing layers together. Everything is a layer - axis, guidelines, dividers, line, circles, etc. The idea is to have losely coupled components that can be easily changed and combined. This is for example the structure of a basic chart, which shows a line with circles: - -![ScreenShot](Screenshots/layers.png) - - -Following a more low level example, to provide an insight into the layer system. Note that most examples are written like this, in order to provider maximal flexibility. - -```swift -let chartPoints: [ChartPoint] = [(2, 2), (4, 4), (6, 6), (8, 8), (8, 10), (15, 15)].map{ChartPoint(x: ChartAxisValueInt($0.0), y: ChartAxisValueInt($0.1))} - -let labelSettings = ChartLabelSettings(font: ExamplesDefaults.labelFont) - -let generator = ChartAxisGeneratorMultiplier(2) -let labelsGenerator = ChartAxisLabelsGeneratorFunc {scalar in - return ChartAxisLabel(text: "\(scalar)", settings: labelSettings) -} - -let xGenerator = ChartAxisGeneratorMultiplier(2) - -let xModel = ChartAxisModel(firstModelValue: 0, lastModelValue: 16, axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: labelSettings)], axisValuesGenerator: xGenerator, labelsGenerator: labelsGenerator) - -let yModel = ChartAxisModel(firstModelValue: 0, lastModelValue: 16, axisTitleLabels: [ChartAxisLabel(text: "Axis title", settings: labelSettings.defaultVertical())], axisValuesGenerator: generator, labelsGenerator: labelsGenerator) - -let chartFrame = ExamplesDefaults.chartFrame(view.bounds) - -let chartSettings = ExamplesDefaults.chartSettingsWithPanZoom - -// generate axes layers and calculate chart inner frame, based on the axis models -let coordsSpace = ChartCoordsSpaceLeftBottomSingleAxis(chartSettings: chartSettings, chartFrame: chartFrame, xModel: xModel, yModel: yModel) -let (xAxisLayer, yAxisLayer, innerFrame) = (coordsSpace.xAxisLayer, coordsSpace.yAxisLayer, coordsSpace.chartInnerFrame) - -// create layer with guidelines -let guidelinesLayerSettings = ChartGuideLinesDottedLayerSettings(linesColor: UIColor.black, linesWidth: ExamplesDefaults.guidelinesWidth) -let guidelinesLayer = ChartGuideLinesDottedLayer(xAxisLayer: xAxisLayer, yAxisLayer: yAxisLayer, settings: guidelinesLayerSettings) - -// view generator - this is a function that creates a view for each chartpoint -let viewGenerator = {(chartPointModel: ChartPointLayerModel, layer: ChartPointsViewsLayer, chart: Chart) -> UIView? in - let viewSize: CGFloat = Env.iPad ? 30 : 20 - let center = chartPointModel.screenLoc - let label = UILabel(frame: CGRect(x: center.x - viewSize / 2, y: center.y - viewSize / 2, width: viewSize, height: viewSize)) - label.backgroundColor = UIColor.green - label.textAlignment = NSTextAlignment.center - label.text = chartPointModel.chartPoint.y.description - label.font = ExamplesDefaults.labelFont - return label -} - -// create layer that uses viewGenerator to display chartpoints -let chartPointsLayer = ChartPointsViewsLayer(xAxis: xAxisLayer.axis, yAxis: yAxisLayer.axis, chartPoints: chartPoints, viewGenerator: viewGenerator, mode: .translate) - -// create chart instance with frame and layers -let chart = Chart( - frame: chartFrame, - innerFrame: innerFrame, - settings: chartSettings, - layers: [ - xAxisLayer, - yAxisLayer, - guidelinesLayer, - chartPointsLayer - ] -) - -view.addSubview(chart.view) -self.chart = chart -``` - -Layers decide how to present their data - this can be done adding subviews, (CA)layers, with core graphics, etc. - -#### 2. View generators: - -View based layers will use a generator function to generate chart point views. This function receives the complete state of each chartpoint (model data, screen location) and produces an UIView, allowing any type of customization. - -### Hello world: - -There's a [hello world](Examples/Examples/HelloWorld.swift) included in the examples, similar to the above code, with a bit more explanations. Change some properties of the generated views, copy paste the chartPointsLineLayer used in the snippet above, and pass it to the chart's layers, to display a line behind the views, and you have already mastered the main concepts! - -#### Important! - -* Don't forget to always keep a strong reference to the chart instance or it will be released, which leads to axis & labels not showing. - -* If you have a lot of axis labels in your chart it may be necessary to do the calculation of the coordinate space in the background, to avoid possible delays which are noticeable during transitions or scrolling. See ScrollExample or MultipleAxesExample example for this. - -## Tasks - -SwiftCharts has got now some [projects](https://github.com/i-schuetz/SwiftCharts/projects) to plan features and improvements. Feel free to grab any of these topics even if it's just to add feedback. You can open an issue for this. Other options like opening a Slack channel are possible. - -## Created By: - -Ivan Schütz - -If you need something special or are just short of time, I'm also available for [hire](http://www.ivanschuetz.com/contact-impressum.php) - -## Credits: - -A big thank you to the awesome [grafiti.io](https://grafiti.io/) for having been sponsoring this project in the last months, and of course also to all the [contributors](https://github.com/i-schuetz/SwiftCharts/graphs/contributors)! - -## License - -SwiftCharts is Copyright (c) 2015 Ivan Schütz and released as open source under the attached [Apache 2.0 license](LICENSE). - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -This is a port to Swift and (massively improved) continuation of an obj-c project which I did while working at eGym GmbH https://github.com/egymgmbh/ios-charts diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_0022.jpeg b/Dependecies/SwiftCharts/Screenshots/IMG_0022.jpeg deleted file mode 100644 index dbadc707d..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_0022.jpeg and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_0023.jpeg b/Dependecies/SwiftCharts/Screenshots/IMG_0023.jpeg deleted file mode 100644 index c3d82431b..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_0023.jpeg and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_0024.jpeg b/Dependecies/SwiftCharts/Screenshots/IMG_0024.jpeg deleted file mode 100644 index 6bf083a73..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_0024.jpeg and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_0026.jpeg b/Dependecies/SwiftCharts/Screenshots/IMG_0026.jpeg deleted file mode 100644 index 0bbae7d41..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_0026.jpeg and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_0027.jpeg b/Dependecies/SwiftCharts/Screenshots/IMG_0027.jpeg deleted file mode 100644 index 860b6a18a..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_0027.jpeg and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_0029.jpeg b/Dependecies/SwiftCharts/Screenshots/IMG_0029.jpeg deleted file mode 100644 index 89992c3a9..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_0029.jpeg and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_0033.jpeg b/Dependecies/SwiftCharts/Screenshots/IMG_0033.jpeg deleted file mode 100644 index 5516fa416..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_0033.jpeg and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_0034.jpeg b/Dependecies/SwiftCharts/Screenshots/IMG_0034.jpeg deleted file mode 100644 index 394588349..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_0034.jpeg and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_0037.jpeg b/Dependecies/SwiftCharts/Screenshots/IMG_0037.jpeg deleted file mode 100644 index 630972723..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_0037.jpeg and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_0039.jpeg b/Dependecies/SwiftCharts/Screenshots/IMG_0039.jpeg deleted file mode 100644 index 025744755..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_0039.jpeg and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_0040.jpeg b/Dependecies/SwiftCharts/Screenshots/IMG_0040.jpeg deleted file mode 100644 index 59b5bc432..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_0040.jpeg and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_0041.jpeg b/Dependecies/SwiftCharts/Screenshots/IMG_0041.jpeg deleted file mode 100644 index 61fc9ce97..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_0041.jpeg and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_0101.jpeg b/Dependecies/SwiftCharts/Screenshots/IMG_0101.jpeg deleted file mode 100644 index f990c3754..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_0101.jpeg and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_0102.jpeg b/Dependecies/SwiftCharts/Screenshots/IMG_0102.jpeg deleted file mode 100644 index d039c2054..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_0102.jpeg and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_1328.PNG b/Dependecies/SwiftCharts/Screenshots/IMG_1328.PNG deleted file mode 100755 index 91a30d538..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_1328.PNG and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_1330.PNG b/Dependecies/SwiftCharts/Screenshots/IMG_1330.PNG deleted file mode 100755 index 0ed5574a2..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_1330.PNG and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_1332.PNG b/Dependecies/SwiftCharts/Screenshots/IMG_1332.PNG deleted file mode 100755 index 4e3bf7437..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_1332.PNG and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/IMG_1334.PNG b/Dependecies/SwiftCharts/Screenshots/IMG_1334.PNG deleted file mode 100755 index 3c684a306..000000000 Binary files a/Dependecies/SwiftCharts/Screenshots/IMG_1334.PNG and /dev/null differ diff --git a/Dependecies/SwiftCharts/Screenshots/index.html b/Dependecies/SwiftCharts/Screenshots/index.html deleted file mode 100644 index cd6322f95..000000000 --- a/Dependecies/SwiftCharts/Screenshots/index.html +++ /dev/null @@ -1,498 +0,0 @@ - - - - - - - - - - - - - -Portfolio - - - -