Browse Source

XCode 7.2

master
Marco Schmickler 10 years ago
parent
commit
54f4fb229c
  1. 4
      .idea/encodings.xml
  2. 447
      .idea/kplayer.iml
  3. 4
      .idea/misc.xml
  4. 9
      Podfile
  5. 96
      kplayer.xcodeproj/project.pbxproj
  6. 57
      kplayer/AppDelegate.swift
  7. 15
      kplayer/Base.lproj/Main.storyboard
  8. 7
      kplayer/Info.plist
  9. 28
      kplayer/core/ItemModel.swift
  10. 54
      kplayer/core/MediaItem.swift
  11. 341
      kplayer/core/NetworkManager.swift
  12. 159
      kplayer/detail/DetailViewController.swift
  13. 2
      kplayer/detail/HeaderCell.swift
  14. 2
      kplayer/detail/ItemCell.swift
  15. 40
      kplayer/detail/VideoPlayerController.swift
  16. 1419
      kplayer/exswift/Array.swift
  17. 18
      kplayer/exswift/Bool.swift
  18. 21
      kplayer/exswift/Character.swift
  19. 421
      kplayer/exswift/Dictionary.swift
  20. 93
      kplayer/exswift/Double.swift
  21. 19
      kplayer/exswift/ExSwift.h
  22. 282
      kplayer/exswift/ExSwift.swift
  23. 83
      kplayer/exswift/Float.swift
  24. 256
      kplayer/exswift/Int.swift
  25. 64
      kplayer/exswift/NSArray.swift
  26. 318
      kplayer/exswift/NSDate.swift
  27. 80
      kplayer/exswift/Range.swift
  28. 244
      kplayer/exswift/Sequence.swift
  29. 403
      kplayer/exswift/String.swift
  30. 153
      kplayer/master/MasterViewController.swift
  31. 144
      kplayer/photo/MediaPhotoController.swift
  32. 19
      kplayer/util/ImageLoadOperation.swift
  33. 14
      kplayer/util/LayoutTools.swift
  34. 4
      kplayer/util/NetData.swift
  35. 4
      kplayer/util/UploadOperation.swift
  36. 67
      kplayer/util/ViewControllerExtensions.swift
  37. 38
      kplayer/util/alamoimage.swift
  38. 48
      kplayer/util/alamojson.swift
  39. 16
      kplayer/util/stringutil.swift
  40. 2
      kplayerTests/Info.plist
  41. 9
      kplayerTests/kplayerTests.swift

4
.idea/encodings.xml

@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

447
.idea/kplayer.iml

@ -1,8 +1,451 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="CIDR_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/kplayerTests/kplayerTests.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayerTests/Info.plist" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Podfile" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/detail/VideoPlayerController.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/detail/HeaderCell.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/detail/ItemCell.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/detail/DetailViewController.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/Info.plist" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/AppDelegate.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/Images.xcassets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/Kirschkeks-256x256.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/photo/MediaPhotoController.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/util/NetData.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/util/ImageLoadOperation.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/util/DataLoadOperation.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/util/HanekeFetchOperation.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/util/UIImageExtension.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/util/ViewControllerExtensions.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/util/LayoutTools.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/util/UploadOperation.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/util/alamoimage.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/util/NetworkHelper.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/util/stringutil.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/core/NetworkManager.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/core/MediaItem.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/core/ItemModel.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/kplayer.xcdatamodeld/kplayer.xcdatamodel" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/master/MasterViewController.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/Base.lproj/LaunchScreen.xib" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/kplayer/Base.lproj/Main.storyboard" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Alamofire/Source/MultipartFormData.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Alamofire/Source/Download.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Alamofire/Source/ParameterEncoding.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Alamofire/Source/ResponseSerialization.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Alamofire/Source/ServerTrustPolicy.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Alamofire/Source/Manager.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Alamofire/Source/Result.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Alamofire/Source/Alamofire.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Alamofire/Source/Request.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Alamofire/Source/Stream.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Alamofire/Source/Upload.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Alamofire/Source/Validation.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Alamofire/Source/Error.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/DiskFetcher.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/Data.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/String+Haneke.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/CGSize+Swift.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/Log.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/NetworkFetcher.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/UIButton+Haneke.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/Format.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/Haneke.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/UIImageView+Haneke.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/DiskCache.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/UIView+Haneke.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/CryptoSwiftMD5.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/NSFileManager+Haneke.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/UIImage+Haneke.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/Fetcher.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/NSHTTPURLResponse+Haneke.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/Fetch.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/HanekeSwift/Haneke/Cache.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Cent/Cent/Cent/Array.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Cent/Cent/Cent/Date.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Cent/Cent/Cent/Int.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Cent/Cent/Cent/Range.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Cent/Cent/Cent/Dictionary.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Cent/Cent/Cent/Cent.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Cent/Cent/Cent/Regex.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Cent/Cent/Cent/String.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Alamofire/Alamofire.modulemap" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Alamofire/Info.plist" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Alamofire/Alamofire.xcconfig" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Alamofire/Alamofire-dummy.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/HanekeSwift/HanekeSwift-prefix.pch" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/HanekeSwift/HanekeSwift-dummy.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/HanekeSwift/HanekeSwift.xcconfig" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/HanekeSwift/HanekeSwift-umbrella.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/HanekeSwift/HanekeSwift.modulemap" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/HanekeSwift/Info.plist" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Cent/Cent-umbrella.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Cent/Cent-dummy.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Cent/Info.plist" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Cent/Cent.modulemap" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Cent/Cent-prefix.pch" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Cent/Cent.xcconfig" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/AFNetworking/AFNetworking-umbrella.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/AFNetworking/Info.plist" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/AFNetworking/AFNetworking.modulemap" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Nimbus/Nimbus.xcconfig" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Nimbus/Nimbus-prefix.pch" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Nimbus/Nimbus-dummy.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Nimbus/Info.plist" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Nimbus/Nimbus.modulemap" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Nimbus/Nimbus-umbrella.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/ALMoviePlayerController/ALMoviePlayerController-dummy.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/ALMoviePlayerController/ALMoviePlayerController-prefix.pch" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/ALMoviePlayerController/ALMoviePlayerController.modulemap" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/ALMoviePlayerController/Info.plist" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/ALMoviePlayerController/ALMoviePlayerController.xcconfig" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/ALMoviePlayerController/ALMoviePlayerController-umbrella.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Dollar/Dollar-dummy.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Dollar/Dollar.modulemap" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Dollar/Dollar-prefix.pch" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Dollar/Info.plist" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Dollar/Dollar.xcconfig" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Dollar/Dollar-umbrella.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/SwiftyJSON/SwiftyJSON.xcconfig" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/SwiftyJSON/SwiftyJSON-umbrella.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/SwiftyJSON/Info.plist" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/SwiftyJSON/SwiftyJSON-prefix.pch" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/SwiftyJSON/SwiftyJSON.modulemap" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/SwiftyJSON/SwiftyJSON-dummy.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Pods/Pods.modulemap" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Pods/Pods-resources.sh" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Pods/Pods-dummy.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Pods/Pods.release.xcconfig" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Pods/Info.plist" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Pods/Pods-umbrella.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Pods/Pods-frameworks.sh" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Pods/Pods.debug.xcconfig" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Target Support Files/Pods/Pods-acknowledgements.plist" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFNetworking.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIDebuggingTools.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NISnapshotRotation.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIDebuggingTools.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIFoundationMethods.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIDeviceOrientation.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NimbusCore.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIFoundationMethods.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIActions.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIInMemoryCache.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIRuntimeClassModifications.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIInMemoryCache.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIRuntimeClassModifications.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIButtonUtilities.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIImageUtilities.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIButtonUtilities.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIOperations.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NINonEmptyCollectionTesting.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIActions.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIDeviceOrientation.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIState.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIImageUtilities.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NICommonMetrics.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NINonEmptyCollectionTesting.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIState.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIError.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NICommonMetrics.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NINetworkActivity.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIPreprocessorMacros.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIError.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/UIResponder+NimbusCore.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIPaths.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIViewRecycler.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NISDKAvailability.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/UIResponder+NimbusCore.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIOperations.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIViewRecycler.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NISDKAvailability.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIOperations+Subclassing.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NINonRetainingCollections.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NINetworkActivity.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIActions+Subclassing.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NINonRetainingCollections.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NimbusCore+Additions.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NIPaths.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/core/src/NISnapshotRotation.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/pagingscrollview/src/NIPagingScrollView.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/pagingscrollview/src/NIPagingScrollViewPage.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/pagingscrollview/src/NIPagingScrollView.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/pagingscrollview/src/NIPagingScrollView+Subclassing.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/pagingscrollview/src/NimbusPagingScrollView.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/pagingscrollview/src/NIPagingScrollViewPage.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/photos/src/NIPhotoAlbumScrollViewDelegate.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/photos/src/NIPhotoAlbumScrollViewDataSource.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/photos/src/NimbusPhotos.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/photos/src/NIPhotoScrubberView.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/photos/src/NIPhotoAlbumScrollView.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/photos/src/NIPhotoScrollView.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/photos/src/NIToolbarPhotoViewController.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/photos/src/NIToolbarPhotoViewController.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/photos/src/NIPhotoAlbumScrollView.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/photos/src/NIPhotoScrollView.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/photos/src/NIPhotoScrollViewPhotoSize.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/photos/src/NIPhotoScrollViewDelegate.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Nimbus/src/photos/src/NIPhotoScrubberView.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/ALMoviePlayerController.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/moviePause.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/movieBackward.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/movieForward.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/movieBackward@2x.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/movieBackwardSelected@2x.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/movieForwardSelected.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/movieEndFullscreen.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/moviePause@2x.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/movieBackwardSelected.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/movieForward@2x.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/movieEndFullscreen@2x.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/moviePlay@2x.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/moviePlay.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/movieFullscreen@2x.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/movieFullscreen.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/Images/movieForwardSelected@2x.png" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/ALButton.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/ALAirplayView.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/ALMoviePlayerController.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/ALAirplayView.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/ALButton.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/ALMoviePlayerControls.m" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/ALMoviePlayerController/ALMoviePlayerController/ALMoviePlayerControls.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Dollar/Dollar/Dollar/Dollar.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Dollar/Dollar/Dollar/Dollar.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/Dollar/Dollar/Dollar/AutoCurry.swift" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Pods/SwiftyJSON/Source/SwiftyJSON.swift" isTestSource="false" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="Header Search Paths">
<CLASSES>
<root url="file://$MODULE_DIR$/Pods/Headers/Private" />
<root url="file:///Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Frameworks/InterfaceBuilderKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Frameworks/DTPerformanceSession.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/HealthKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PassKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreAudioKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MultipeerConnectivity.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AssetsLibrary.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/WatchConnectivity.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreVideo.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/StoreKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SceneKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/OpenGLES.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CFNetwork.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Accelerate.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AddressBookUI.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/EventKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/WatchKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GSS.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AudioUnit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/EventKitUI.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/VideoToolbox.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Contacts.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameplayKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/WebKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CloudKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreImage.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaPlayer.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVFoundation.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/JavaScriptCore.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PushKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreText.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/ReplayKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SpriteKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Twitter.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreAudio.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreData.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MapKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/ContactsUI.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMedia.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaAccessibility.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/ExternalAccessory.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Security.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/ModelIO.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GLKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreBluetooth.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AdSupport.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Social.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SystemConfiguration.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Accounts.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/OpenAL.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NotificationCenter.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/ImageIO.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MobileCoreServices.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AddressBook.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NewsstandKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MessageUI.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreLocation.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuartzCore.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/iAd.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.2/include" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1" />
</CLASSES>
<SOURCES>
<root url="file://$MODULE_DIR$/Pods/Headers/Private" />
<root url="file:///Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Frameworks/InterfaceBuilderKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Frameworks/DTPerformanceSession.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/HealthKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PassKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreAudioKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MultipeerConnectivity.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AssetsLibrary.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/WatchConnectivity.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreVideo.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/StoreKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SceneKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/OpenGLES.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CFNetwork.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Accelerate.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AddressBookUI.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/EventKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/WatchKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GSS.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AudioUnit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/EventKitUI.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Metal.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/VideoToolbox.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Contacts.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuickLook.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameplayKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/WebKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CloudKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreImage.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaPlayer.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVFoundation.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/JavaScriptCore.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PushKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreText.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/ReplayKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SpriteKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Twitter.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreAudio.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreData.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MapKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/ContactsUI.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMedia.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaAccessibility.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/ExternalAccessory.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Security.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/ModelIO.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GLKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreBluetooth.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AdSupport.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Social.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SystemConfiguration.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Accounts.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/OpenAL.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NotificationCenter.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/ImageIO.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MobileCoreServices.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AddressBook.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NewsstandKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MessageUI.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameKit.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreLocation.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/QuartzCore.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/iAd.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.2/include" />
<root url="file:///Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1" />
</SOURCES>
</library>
</orderEntry>
</component>
</module>

4
.idea/misc.xml

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" />
</project>

9
Podfile

@ -4,11 +4,16 @@ source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
# pod 'Player'
pod 'Alamofire', '~> 1.2'
#pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift-2.0'
#pod 'Alamofire', '~> 1.2'
pod 'Alamofire', '~> 2.0'
pod 'ALMoviePlayerController', '~>0.3.0'
#pod 'DZVideoPlayerViewController'
pod 'SwiftyJSON'
pod 'HanekeSwift'
pod 'Nimbus/Photos'
pod 'Nimbus/PagingScrollView'
pod 'AFNetworking', '= 2.1'
pod 'AFNetworking', '~>2.1'
pod 'Dollar'
pod 'Cent'
#, '1.2.0'

96
kplayer.xcodeproj/project.pbxproj

@ -7,40 +7,29 @@
objects = {
/* Begin PBXBuildFile section */
1C7361B71E73ECBE5891B755 /* Dictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C73649A4ADDAAAED634F537 /* Dictionary.swift */; };
1C7361F0F80FEC5B72946923 /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C73605289164DF119E60720 /* Array.swift */; };
1C73626E34BA4D64ACF94AE5 /* alamoimage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736C60C423AE87B8D0F22A /* alamoimage.swift */; };
1C73631EACF56BABD3B2BCFB /* LayoutTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736BC4450890C45F8FBC63 /* LayoutTools.swift */; };
1C7363402AB2B0E5CA0B35BF /* Float.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7365A537608EDDE897BF7C /* Float.swift */; };
1C73635138BBD2BB480A308F /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C736777456388CA571DA17B /* MediaPlayer.framework */; };
1C7363D241B56AEE78D82FAD /* Sequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C73666529EEEBD464F193CD /* Sequence.swift */; };
1C7363D9DC8F9D1F866DE935 /* Kirschkeks-256x256.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C7368DC7EF11A553145E169 /* Kirschkeks-256x256.png */; };
1C73640D928DE56D35175D39 /* UploadOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736260E748CF136FF37EA7 /* UploadOperation.swift */; };
1C73646F87B495A47D7943C7 /* NetData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7369EC16B19B32B515169E /* NetData.swift */; };
1C7364F64DCE93FCF4671D98 /* Character.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7369BCA71AAF64F874F946 /* Character.swift */; };
1C736503B656C999E5E12081 /* NetworkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7365B06FA66294E99AC2D3 /* NetworkManager.swift */; };
1C73654C9EA6D255CFC039C5 /* NetworkHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C73620D01687FB4F1811C5C /* NetworkHelper.swift */; };
1C7365885FAF292F2221ED44 /* MediaPhotoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C73673DC671535E3A049F54 /* MediaPhotoController.swift */; };
1C73677CD719D0F82D144BF6 /* Bool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736C43137E3B8391E5F07B /* Bool.swift */; };
1C73675C34BE0990D44570BE /* ItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736253AB7A95EA41B605B7 /* ItemModel.swift */; };
1C7367AF39961D2BA72480ED /* DataLoadOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736F9338CE36708244D42A /* DataLoadOperation.swift */; };
1C736821D6DF2237A3EABCC1 /* ViewControllerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C73648CEC974A2500172064 /* ViewControllerExtensions.swift */; };
1C7368364397315E12E90F05 /* VideoPlayerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7367379DEE94EBF3FAFA78 /* VideoPlayerController.swift */; };
1C73688D13E5A804880C8768 /* UIImageExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736DCCE3AA9993E15F7652 /* UIImageExtension.swift */; };
1C73689C7E6A25E758B16C54 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C73653A9EBCC466FD4E3DA6 /* String.swift */; };
1C73691A9C7174E0C6B57267 /* stringutil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736B794396F2E50387B8F2 /* stringutil.swift */; };
1C73693A1334A7792856FC58 /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C73611D226B48C24DB37535 /* MasterViewController.swift */; };
1C7369ABC44CFB530EA71FB6 /* HeaderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736D9BB5498E7E8F11C754 /* HeaderCell.swift */; };
1C7369C330F1AB1E4F166050 /* Range.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736E7B8BAD989DC544088E /* Range.swift */; };
1C736A88E2CF46197FAE3160 /* NSDate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7360E65B741C57C034FC7C /* NSDate.swift */; };
1C736C5DD23466269607E07F /* alamojson.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C73618272969871601AB817 /* alamojson.swift */; };
1C736C5EA9EEFF40AD42CA60 /* Double.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736BCC6787411AA435D1E6 /* Double.swift */; };
1C736C885C8EE7CFBF3B8DC3 /* ExSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7365E164CCEDB0A9FDF7FA /* ExSwift.swift */; };
1C736C9C89BABC38C80025FE /* Int.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7368956B34717DAFC35EFF /* Int.swift */; };
1C736D16E81BA1FB325200E0 /* HanekeFetchOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7360744ABACC3557D05760 /* HanekeFetchOperation.swift */; };
1C736D24891597F2728230EE /* ImageLoadOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7360A94DBECA685ED8602F /* ImageLoadOperation.swift */; };
1C736D24B49451141CD4B64D /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7369F53095B7A4D65679C2 /* DetailViewController.swift */; };
1C736F3BC10D1A5ECEA50A30 /* NSArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736DB8164E3EF18FA6F28D /* NSArray.swift */; };
1C736F6A223D4ADB2E1BA733 /* ItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736069C214E9522BB1BD97 /* ItemCell.swift */; };
1C736FB92B19FE17E4357C85 /* MediaItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C73688DAB88F9360FB62A49 /* MediaItem.swift */; };
A5D637AE4588AAB5DC1CBC6B /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 127AC1F28342F9AAE3CEC5C2 /* Pods.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
A5D637AE4588AAB5DC1CBC6B /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 127AC1F28342F9AAE3CEC5C2 /* Pods.framework */; };
C98AF5D51B124D6A00D196CC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C98AF5D41B124D6A00D196CC /* AppDelegate.swift */; };
C98AF5D81B124D6A00D196CC /* kplayer.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = C98AF5D61B124D6A00D196CC /* kplayer.xcdatamodeld */; };
C98AF5DF1B124D6A00D196CC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C98AF5DD1B124D6A00D196CC /* Main.storyboard */; };
@ -61,39 +50,27 @@
/* Begin PBXFileReference section */
127AC1F28342F9AAE3CEC5C2 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1C73605289164DF119E60720 /* Array.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = "<group>"; };
1C736069C214E9522BB1BD97 /* ItemCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemCell.swift; sourceTree = "<group>"; };
1C7360744ABACC3557D05760 /* HanekeFetchOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HanekeFetchOperation.swift; sourceTree = "<group>"; };
1C7360A94DBECA685ED8602F /* ImageLoadOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageLoadOperation.swift; sourceTree = "<group>"; };
1C7360E65B741C57C034FC7C /* NSDate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSDate.swift; sourceTree = "<group>"; };
1C7361024E8CCBDE9C052658 /* ExSwift.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExSwift.h; sourceTree = "<group>"; };
1C73611D226B48C24DB37535 /* MasterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterViewController.swift; sourceTree = "<group>"; };
1C73618272969871601AB817 /* alamojson.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = alamojson.swift; sourceTree = "<group>"; };
1C73620D01687FB4F1811C5C /* NetworkHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkHelper.swift; sourceTree = "<group>"; };
1C736253AB7A95EA41B605B7 /* ItemModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemModel.swift; sourceTree = "<group>"; };
1C736260E748CF136FF37EA7 /* UploadOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UploadOperation.swift; sourceTree = "<group>"; };
1C73649A4ADDAAAED634F537 /* Dictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Dictionary.swift; sourceTree = "<group>"; };
1C73653A9EBCC466FD4E3DA6 /* String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = "<group>"; };
1C7365A537608EDDE897BF7C /* Float.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Float.swift; sourceTree = "<group>"; };
1C73648CEC974A2500172064 /* ViewControllerExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewControllerExtensions.swift; sourceTree = "<group>"; };
1C7365B06FA66294E99AC2D3 /* NetworkManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkManager.swift; sourceTree = "<group>"; };
1C7365E164CCEDB0A9FDF7FA /* ExSwift.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExSwift.swift; sourceTree = "<group>"; };
1C73666529EEEBD464F193CD /* Sequence.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Sequence.swift; sourceTree = "<group>"; };
1C7367379DEE94EBF3FAFA78 /* VideoPlayerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoPlayerController.swift; sourceTree = "<group>"; };
1C73673DC671535E3A049F54 /* MediaPhotoController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaPhotoController.swift; sourceTree = "<group>"; };
1C736777456388CA571DA17B /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };
1C73688DAB88F9360FB62A49 /* MediaItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaItem.swift; sourceTree = "<group>"; };
1C7368956B34717DAFC35EFF /* Int.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Int.swift; sourceTree = "<group>"; };
1C7368DC7EF11A553145E169 /* Kirschkeks-256x256.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Kirschkeks-256x256.png"; sourceTree = "<group>"; };
1C7369BCA71AAF64F874F946 /* Character.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Character.swift; sourceTree = "<group>"; };
1C7369EC16B19B32B515169E /* NetData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetData.swift; sourceTree = "<group>"; };
1C7369F53095B7A4D65679C2 /* DetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = "<group>"; };
1C736B794396F2E50387B8F2 /* stringutil.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = stringutil.swift; sourceTree = "<group>"; };
1C736BC4450890C45F8FBC63 /* LayoutTools.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LayoutTools.swift; sourceTree = "<group>"; };
1C736BCC6787411AA435D1E6 /* Double.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Double.swift; sourceTree = "<group>"; };
1C736C43137E3B8391E5F07B /* Bool.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Bool.swift; sourceTree = "<group>"; };
1C736C60C423AE87B8D0F22A /* alamoimage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = alamoimage.swift; sourceTree = "<group>"; };
1C736D9BB5498E7E8F11C754 /* HeaderCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HeaderCell.swift; sourceTree = "<group>"; };
1C736DB8164E3EF18FA6F28D /* NSArray.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSArray.swift; sourceTree = "<group>"; };
1C736DCCE3AA9993E15F7652 /* UIImageExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIImageExtension.swift; sourceTree = "<group>"; };
1C736E7B8BAD989DC544088E /* Range.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Range.swift; sourceTree = "<group>"; };
1C736F9338CE36708244D42A /* DataLoadOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DataLoadOperation.swift; sourceTree = "<group>"; };
5C6CBA548F885BF342F594EA /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
A170BFB886D61D57F7009BFC /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
@ -156,27 +133,6 @@
path = master;
sourceTree = "<group>";
};
1C73654BC4A499E5D104B61F /* exswift */ = {
isa = PBXGroup;
children = (
1C7369BCA71AAF64F874F946 /* Character.swift */,
1C736C43137E3B8391E5F07B /* Bool.swift */,
1C736DB8164E3EF18FA6F28D /* NSArray.swift */,
1C736BCC6787411AA435D1E6 /* Double.swift */,
1C73653A9EBCC466FD4E3DA6 /* String.swift */,
1C7361024E8CCBDE9C052658 /* ExSwift.h */,
1C7368956B34717DAFC35EFF /* Int.swift */,
1C7365A537608EDDE897BF7C /* Float.swift */,
1C7360E65B741C57C034FC7C /* NSDate.swift */,
1C73666529EEEBD464F193CD /* Sequence.swift */,
1C7365E164CCEDB0A9FDF7FA /* ExSwift.swift */,
1C73649A4ADDAAAED634F537 /* Dictionary.swift */,
1C736E7B8BAD989DC544088E /* Range.swift */,
1C73605289164DF119E60720 /* Array.swift */,
);
path = exswift;
sourceTree = "<group>";
};
1C7365603CAE04E39B73D843 /* util */ = {
isa = PBXGroup;
children = (
@ -185,11 +141,12 @@
1C73620D01687FB4F1811C5C /* NetworkHelper.swift */,
1C736260E748CF136FF37EA7 /* UploadOperation.swift */,
1C7369EC16B19B32B515169E /* NetData.swift */,
1C73618272969871601AB817 /* alamojson.swift */,
1C7360744ABACC3557D05760 /* HanekeFetchOperation.swift */,
1C7360A94DBECA685ED8602F /* ImageLoadOperation.swift */,
1C736C60C423AE87B8D0F22A /* alamoimage.swift */,
1C736F9338CE36708244D42A /* DataLoadOperation.swift */,
1C736B794396F2E50387B8F2 /* stringutil.swift */,
1C73648CEC974A2500172064 /* ViewControllerExtensions.swift */,
);
path = util;
sourceTree = "<group>";
@ -199,6 +156,7 @@
children = (
1C7365B06FA66294E99AC2D3 /* NetworkManager.swift */,
1C73688DAB88F9360FB62A49 /* MediaItem.swift */,
1C736253AB7A95EA41B605B7 /* ItemModel.swift */,
);
path = core;
sourceTree = "<group>";
@ -256,7 +214,6 @@
1C73615846EE8B07DAAFD230 /* detail */,
1C7364808E72BFA7575E75E1 /* master */,
1C7363B608460DED4F522D1C /* photo */,
1C73654BC4A499E5D104B61F /* exswift */,
);
path = kplayer;
sourceTree = "<group>";
@ -333,11 +290,14 @@
C98AF5C71B124D6A00D196CC /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0630;
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0720;
ORGANIZATIONNAME = "Marco Schmickler";
TargetAttributes = {
C98AF5CE1B124D6A00D196CC = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = G9J99WBBN9;
};
C98AF5E81B124D6A00D196CC = {
CreatedOnToolsVersion = 6.3.1;
@ -451,26 +411,15 @@
1C73654C9EA6D255CFC039C5 /* NetworkHelper.swift in Sources */,
1C73640D928DE56D35175D39 /* UploadOperation.swift in Sources */,
1C73646F87B495A47D7943C7 /* NetData.swift in Sources */,
1C736C5DD23466269607E07F /* alamojson.swift in Sources */,
1C73693A1334A7792856FC58 /* MasterViewController.swift in Sources */,
1C7365885FAF292F2221ED44 /* MediaPhotoController.swift in Sources */,
1C7364F64DCE93FCF4671D98 /* Character.swift in Sources */,
1C73677CD719D0F82D144BF6 /* Bool.swift in Sources */,
1C736F3BC10D1A5ECEA50A30 /* NSArray.swift in Sources */,
1C736C5EA9EEFF40AD42CA60 /* Double.swift in Sources */,
1C73689C7E6A25E758B16C54 /* String.swift in Sources */,
1C736C9C89BABC38C80025FE /* Int.swift in Sources */,
1C7363402AB2B0E5CA0B35BF /* Float.swift in Sources */,
1C736A88E2CF46197FAE3160 /* NSDate.swift in Sources */,
1C7363D241B56AEE78D82FAD /* Sequence.swift in Sources */,
1C736C885C8EE7CFBF3B8DC3 /* ExSwift.swift in Sources */,
1C7361B71E73ECBE5891B755 /* Dictionary.swift in Sources */,
1C7369C330F1AB1E4F166050 /* Range.swift in Sources */,
1C7361F0F80FEC5B72946923 /* Array.swift in Sources */,
1C736D16E81BA1FB325200E0 /* HanekeFetchOperation.swift in Sources */,
1C736D24891597F2728230EE /* ImageLoadOperation.swift in Sources */,
1C73626E34BA4D64ACF94AE5 /* alamoimage.swift in Sources */,
1C7367AF39961D2BA72480ED /* DataLoadOperation.swift in Sources */,
1C73675C34BE0990D44570BE /* ItemModel.swift in Sources */,
1C73691A9C7174E0C6B57267 /* stringutil.swift in Sources */,
1C736821D6DF2237A3EABCC1 /* ViewControllerExtensions.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -533,6 +482,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@ -600,9 +550,13 @@
baseConfigurationReference = 5C6CBA548F885BF342F594EA /* Pods.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = kplayer/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "schmickler.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
};
name = Debug;
};
@ -611,9 +565,13 @@
baseConfigurationReference = A170BFB886D61D57F7009BFC /* Pods.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = kplayer/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "schmickler.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
};
name = Release;
};
@ -631,6 +589,7 @@
);
INFOPLIST_FILE = kplayerTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "schmickler.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/kplayer.app/kplayer";
};
@ -646,6 +605,7 @@
);
INFOPLIST_FILE = kplayerTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "schmickler.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/kplayer.app/kplayer";
};

57
kplayer/AppDelegate.swift

@ -19,28 +19,27 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
// Override point for customization after application launch.
let splitViewController = self.window!.rootViewController as! UISplitViewController
let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController
navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem()
navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem()
splitViewController.delegate = self
let masterNavigationController = splitViewController.viewControllers[0] as! UINavigationController
let controller = masterNavigationController.topViewController as! MasterViewController
controller.items = [
MediaItem(name: "fav", path:"fav", root: "/srv/samba/ren/fav", type: ItemType.VIDEOROOT),
MediaItem(name: "knk", path:"knk", root: "/srv/samba/ren/knk", type: ItemType.VIDEOROOT),
MediaItem(name: "knk_archiv", path:"knk_archiv", root: "/srv/samba/ren/knk_archiv", type: ItemType.VIDEOROOT),
MediaItem(name: "knk_archiv2", path:"knk_archiv2", root: "/srv/samba/ren/knk_archiv2", type: ItemType.VIDEOROOT),
MediaItem(name: "knk_archiv3", path:"knk_archiv3", root: "/srv/samba/ren/knk_archiv3", type: ItemType.VIDEOROOT),
MediaItem(name: "knk_archiv4", path:"knk_archiv4", root: "/srv/samba/ren/knk_archiv4", type: ItemType.VIDEOROOT),
MediaItem(name: "ewp", path:"ewp", root: "/srv/samba/ren/ewp", type: ItemType.ROOT),
MediaItem(name: "fjoy", path:"fjoy", root: "/srv/samba/ren/fjoy", type: ItemType.ROOT),
MediaItem(name: "heg", path:"heg", root: "/srv/samba/ren/heg", type: ItemType.ROOT),
MediaItem(name: "ten", path:"ten", root: "/srv/samba/ren/ten", type: ItemType.ROOT),
MediaItem(name: "leg", path:"leg", root: "/srv/samba/ren/leg", type: ItemType.ROOT),
MediaItem(name: "ang", path:"ang", root: "/srv/samba/ren/ang", type: ItemType.ROOT),
MediaItem(name: "series", path:"series", root: "/srv/samba/ren/series", type: ItemType.ROOT),
MediaItem(name: "bm", path:"bm", root: "/srv/samba/ren/bm", type: ItemType.ROOT),
MediaItem(name: "medieval", path:"medieval", root: "/srv/samba/ren/medieval", type: ItemType.ROOT),
MediaItem(name: "fav", path:"", root: "/srv/samba/ren/fav", type: ItemType.VIDEOROOT),
MediaItem(name: "knk", path:"", root: "/srv/samba/ren/knk", type: ItemType.VIDEOROOT),
MediaItem(name: "knk_archiv", path:"", root: "/srv/samba/ren/knk_archiv", type: ItemType.VIDEOROOT),
MediaItem(name: "knk_archiv2", path:"", root: "/srv/samba/ren/knk_archiv2", type: ItemType.VIDEOROOT),
MediaItem(name: "knk_archiv3", path:"", root: "/srv/samba/ren/knk_archiv3", type: ItemType.VIDEOROOT),
MediaItem(name: "knk_archiv4", path:"", root: "/srv/samba/ren/knk_archiv4", type: ItemType.VIDEOROOT),
MediaItem(name: "fjoy", path:"", root: "/srv/samba/ren/fjoy", type: ItemType.ROOT),
MediaItem(name: "heg", path:"", root: "/srv/samba/ren/heg", type: ItemType.ROOT),
MediaItem(name: "ten", path:"", root: "/srv/samba/ren/ten", type: ItemType.ROOT),
MediaItem(name: "leg", path:"", root: "/srv/samba/ren/leg", type: ItemType.ROOT),
MediaItem(name: "ang", path:"", root: "/srv/samba/ren/ang", type: ItemType.ROOT),
MediaItem(name: "series", path:"", root: "/srv/samba/ren/series", type: ItemType.ROOT),
MediaItem(name: "bm", path:"", root: "/srv/samba/ren/bm", type: ItemType.ROOT),
MediaItem(name: "medieval", path:"", root: "/srv/samba/ren/medieval", type: ItemType.ROOT),
]
@ -73,7 +72,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
// MARK: - Split view
func splitViewController(splitViewController: UISplitViewController, collapseSecondaryViewController secondaryViewController:UIViewController!, ontoPrimaryViewController primaryViewController:UIViewController!) -> Bool {
func splitViewController(splitViewController: UISplitViewController, collapseSecondaryViewController secondaryViewController:UIViewController, ontoPrimaryViewController primaryViewController:UIViewController) -> Bool {
if let secondaryAsNavController = secondaryViewController as? UINavigationController {
if let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController {
if topAsDetailController.detailItem == nil {
@ -89,7 +88,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
lazy var applicationDocumentsDirectory: NSURL = {
// The directory the application uses to store the Core Data store file. This code uses a directory named "schmickler.kplayer" in the application's documents Application Support directory.
let urls = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)
return urls[urls.count-1] as! NSURL
return urls[urls.count-1]
}()
lazy var managedObjectModel: NSManagedObjectModel = {
@ -105,7 +104,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
let url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("kplayer.sqlite")
var error: NSError? = nil
var failureReason = "There was an error creating or loading the application's saved data."
if coordinator!.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil, error: &error) == nil {
do {
try coordinator!.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil)
} catch var error1 as NSError {
error = error1
coordinator = nil
// Report any error we got.
var dict = [String: AnyObject]()
@ -117,6 +119,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog("Unresolved error \(error), \(error!.userInfo)")
abort()
} catch {
fatalError()
}
return coordinator
@ -138,11 +142,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
func saveContext () {
if let moc = self.managedObjectContext {
var error: NSError? = nil
if moc.hasChanges && !moc.save(&error) {
// Replace this implementation with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog("Unresolved error \(error), \(error!.userInfo)")
abort()
if moc.hasChanges {
do {
try moc.save()
} catch let error1 as NSError {
error = error1
// Replace this implementation with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog("Unresolved error \(error), \(error!.userInfo)")
abort()
}
}
}
}

15
kplayer/Base.lproj/Main.storyboard

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="H1p-Uh-vWS">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="H1p-Uh-vWS">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<scenes>
<!--Master-->
@ -28,7 +29,7 @@
<viewControllerLayoutGuide type="bottom" id="GAO-Cl-Wes"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="svH-Pt-448">
<rect key="frame" x="0.0" y="0.0" width="600" height="536"/>
<rect key="frame" x="0.0" y="64" width="600" height="536"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" misplaced="YES" text="Detail view content goes here" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="0XM-y9-sOw">
@ -67,7 +68,7 @@
<viewControllerLayoutGuide type="bottom" id="xB2-3N-aYI"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Hzn-H1-qwy">
<rect key="frame" x="0.0" y="94" width="600" height="536"/>
<rect key="frame" x="0.0" y="64" width="600" height="536"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
@ -138,14 +139,14 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" textLabel="Arm-wq-HPj" style="IBUITableViewCellStyleDefault" id="WCw-Qf-5nD">
<rect key="frame" x="0.0" y="86" width="320" height="44"/>
<rect key="frame" x="0.0" y="86" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WCw-Qf-5nD" id="37f-cq-3Eg">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Arm-wq-HPj">
<rect key="frame" x="15" y="0.0" width="290" height="43"/>
<rect key="frame" x="15" y="0.0" width="570" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>

7
kplayer/Info.plist

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>schmickler.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@ -53,5 +53,10 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>

28
kplayer/core/ItemModel.swift

@ -0,0 +1,28 @@
//
// Created by Marco Schmickler on 29.06.15.
// Copyright (c) 2015 Marco Schmickler. All rights reserved.
//
import Foundation
class ItemModel {
var items = [MediaItem]()
var itemsMap = Dictionary<String, MediaItem>()
func addItem(item: MediaItem) {
let path = item.rootSlash + item.path
print(path)
var folder = itemsMap[path]
if folder == nil {
folder = MediaItem(name: "", path: item.path, root: item.root, type: ItemType.FOLDER)
itemsMap[path] = folder!
items.append(folder!)
}
item.index = folder!.children.count
folder!.children.append(item)
item.parent = folder
}
}

54
kplayer/core/MediaItem.swift

@ -6,12 +6,13 @@
import Foundation
import UIKit
enum ItemType : String, Printable {
enum ItemType : String, CustomStringConvertible {
case ROOT = "root"
case VIDEOROOT = "videoroot"
case FOLDER = "folder"
case VIDEO = "video"
case PICS = "pics"
case DETAILS = "details"
case SNAPSHOT = "snapshot"
var description: String {
@ -19,7 +20,7 @@ enum ItemType : String, Printable {
}
}
class MediaItem : DebugPrintable {
class MediaItem : CustomDebugStringConvertible {
var name : String
var path : String
var root: String
@ -51,13 +52,13 @@ class MediaItem : DebugPrintable {
func computeSortName(sname: String) -> String {
var lsortName = sname.stringByReplacingOccurrencesOfString("full", withString: "")
var fullNameArr = split(sortName) {$0 == "_"}
println (lsortName)
var fullNameArr = sortName.characters.split {$0 == "_"}.map { String($0) }
// println (lsortName)
if !fullNameArr.isEmpty {
lsortName = fullNameArr[0]
}
while count(lsortName) < 6 {
while lsortName.characters.count < 6 {
lsortName = "0" + lsortName
}
@ -65,33 +66,58 @@ println (lsortName)
}
var thumbPath: String {
let len = count("/srv/samba/ren")
let tpath = "/srv/samba/ren/thumb" + (root as NSString).substringFromIndex(len) + "/" + path + "/" + name
let enc = tpath.stringByReplacingOccurrencesOfString(" ", withString: "%20")
let len = "/srv/samba/ren".characters.count
let tpath = "/srv/samba/ren/thumb" + (rootSlash as NSString).substringFromIndex(len) + "/" + path + "/" + name
let enc = tpath.stringByAddingPercentEscapesUsingEncoding(NSISOLatin1StringEncoding)! //.stringByReplacingOccurrencesOfString(" ", withString: "%20")
return enc + "/"
}
var thumbUrlAbsolute: String {
let enc = thumbUrl!.stringByReplacingOccurrencesOfString(" ", withString: "%20")
let enc = thumbUrl!.stringByAddingPercentEscapesUsingEncoding(NSISOLatin1StringEncoding)! //.stringByReplacingOccurrencesOfString(" ", withString: "%20")
return NetworkManager.sharedInstance.baseurl + "/service/download" + enc
}
var imageUrlAbsolute: String {
var imageUrl = thumbUrl!.stringByReplacingOccurrencesOfString("_thumb.", withString: ".")
imageUrl = imageUrl.stringByReplacingOccurrencesOfString("?preview=true", withString: "")
imageUrl = imageUrl.stringByReplacingOccurrencesOfString(" ", withString: "%20")
imageUrl = imageUrl.stringByAddingPercentEscapesUsingEncoding(NSISOLatin1StringEncoding)! //.stringByReplacingOccurrencesOfString(" ", withString: "%20")
return NetworkManager.sharedInstance.baseurl + "/service/download" + imageUrl
}
var fullPath: String {
let fpath = root + "/" + path + "/" + name
let enc = fpath.stringByReplacingOccurrencesOfString(" ", withString: "%20")
return enc
let fpath = rootSlash + path + "/" + name
let enc = fpath.stringByAddingPercentEscapesUsingEncoding(NSISOLatin1StringEncoding) //.stringByReplacingOccurrencesOfString(" ", withString: "%20")
return enc!
}
var debugDescription: String {
return "\(type): \(root) \(path) \(name) (\(index)) Child count \(count(children))"
return "\(type): \(root) \(path) \(name) (\(index)) Child count \(children.count)"
}
var rootSlash: String {
if root.endsWith("/") {
return root
}
else {
return root + "/"
}
}
var encodedDir: String? {
let dir = rootSlash + path
return dir.stringByAddingPercentEscapesUsingEncoding(NSISOLatin1StringEncoding)
}
func superRoot() -> MediaItem {
if let p = parent {
return p.superRoot()
}
return self
}
}

341
kplayer/core/NetworkManager.swift

@ -6,6 +6,7 @@
import Foundation
import Alamofire
import SwiftyJSON
import Cent
class NetworkManager {
static let sharedInstance = NetworkManager()
@ -24,12 +25,11 @@ class NetworkManager {
Alamofire.request(.GET, baseurl + "/service/roots")
.responseString {
(_, _, string, _) in
let f = split(string!) {
$0 == "\r\n"
}
println(string)
println(f)
(_, _, result) in
let string = result.value!
let f = string.componentsSeparatedByString("\r\n")
print(string)
print(f)
}
// .response { (request, response, data, error) in
@ -43,106 +43,104 @@ class NetworkManager {
return itemsArray;
}
public typealias Weiter = ([MediaItem]) -> Void
func loadDirs(root: String, completionHandler: Weiter) -> Void {
let url1 = baseurl + "/service/listvideos" + root
let len = count(root)
let len = root.characters.count
var res = [MediaItem]()
let url = (url1 as NSString).stringByReplacingOccurrencesOfString(" ", withString: "+")
println(url)
print(url)
Alamofire.request(.GET, url).responseJSON {
(_, _, response) in
Alamofire.request(.GET, url).responseSwiftyJSON({
(request, response, json, error) in
if let json = response.value {
var hashes = Set<String>()
var hashes = NSMutableSet()
for (a, c) in json {
// let (a,b) = j #
let s = c.object as! String
println(s)
if s.hasSuffix(".mp4") || s.hasSuffix(".m4v") {
let l = count(s)
let name = (s as NSString).lastPathComponent
var pathlen = l - len - count(name)
for s in json as! [String] {
print(s)
if s.hasSuffix(".mp4") || s.hasSuffix(".m4v") {
let l = s.length
let name = NSURL(fileURLWithPath: s).lastPathComponent!
var pathlen = l - len - name.length
// if (pathlen > 1000) {
println(pathlen)
println(name)
println(s)
print(pathlen)
print(name)
print(s)
// }
if (pathlen < 2) {
pathlen = 2
}
if (pathlen < 2) {
pathlen = 2
}
let path = (s as NSString).substringWithRange(NSMakeRange(len + 1, pathlen - 2))
let i = MediaItem(name: name, path: path, root: root, type: ItemType.VIDEO)
if !name.hasPrefix(".") {
res.append(i)
let path = (s as NSString).substringWithRange(NSMakeRange(len + 1, pathlen - 2))
let i = MediaItem(name: name, path: path, root: root, type: ItemType.VIDEO)
if !name.hasPrefix(".") {
res.append(i)
}
}
}
}
completionHandler(res)
})
}
}
func loadPicDirs(root: String, completionHandler: Weiter) -> Void {
let url1 = baseurl + "/service/listpicdirs" + root
let len = count(root)
let len = root.characters.count
var res = [MediaItem]()
let url = (url1 as NSString).stringByReplacingOccurrencesOfString(" ", withString: "+")
println(url)
print(url)
Alamofire.request(.GET, url).responseSwiftyJSON({
(request, response, json, error) in
Alamofire.request(.GET, url).responseJSON {
(_, _, response) in
var hashes = NSMutableSet()
var items = Dictionary<String, MediaItem>()
if let json = response.value {
var items = Dictionary<String, MediaItem>()
for (a, c) in json {
// let (a,b) = j #
let s = c.object as! String
println(s)
if s.lowercaseString.hasSuffix(".jpg") {
let l = count(s)
let name = (s as NSString).lastPathComponent
var pathlen = l - len - count(name)
for s in json as! [String] {
print(s)
if s.lowercaseString.hasSuffix(".jpg") {
let l = s.length
let name = (s as NSString).lastPathComponent
var pathlen = l - len - name.length
// if (pathlen > 1000) {
println(pathlen)
println(name)
println(s)
print(pathlen)
print(name)
print(s)
// }
if (pathlen < 2) {
pathlen = 2
}
let path = (s as NSString).substringWithRange(NSMakeRange(len + 1, pathlen - 2))
let folderName = path.lastPathComponent
let fl = count(path)
let pfl = fl - count(folderName)
println ("\(folderName) \(pfl)")
let fpath = (path as NSString).substringWithRange(NSMakeRange(0, pfl))
let i = MediaItem(name: folderName, path: fpath, root: root, type: ItemType.PICS)
i.thumbUrl = "\(s)?preview=true"
if !name.hasPrefix(".") {
if let picfolder = items[path] {
picfolder.children.append(i)
if (pathlen < 2) {
pathlen = 2
}
else {
let iff = MediaItem(name: folderName, path: fpath, root: root, type: ItemType.PICS)
items[path] = iff
res.append(iff)
iff.children.append(i)
let path = (s as NSString).substringWithRange(NSMakeRange(len + 1, pathlen - 2))
let folderName = NSURL(fileURLWithPath: path).lastPathComponent!
let fl = path.length
let pfl = fl - folderName.length
print("\(folderName) \(pfl)")
let fpath = (path as NSString).substringWithRange(NSMakeRange(0, pfl))
let i = MediaItem(name: folderName, path: fpath, root: root, type: ItemType.PICS)
i.thumbUrl = "\(s)?preview=true"
if !name.hasPrefix(".") {
if let picfolder = items[path] {
picfolder.children.append(i)
} else {
let iff = MediaItem(name: folderName, path: fpath, root: root, type: ItemType.PICS)
items[path] = iff
res.append(iff)
iff.children.append(i)
}
}
}
}
}
completionHandler(res)
})
}
}
func loadDir(root: String, completionHandler: ([MediaItem]) -> Void) -> Void {
@ -151,20 +149,20 @@ class NetworkManager {
let url = (root as NSString).stringByReplacingOccurrencesOfString(" ", withString: "+")
Alamofire.request(.GET, baseurl + "/service/dirs" + url)
.responseString {
(_, _, string, _) in
let f = split(string!) {
$0 == "\r\n"
}
(_, _, result) in
let string = result.value!
let f = string.componentsSeparatedByString("\r\n")
let len = count(root)
let len = root.length
var res = [MediaItem]()
for s in f {
if s.hasSuffix(".mp4") || s.hasSuffix(".m4v") {
let l = count(s)
let name = (s as NSString).lastPathComponent
let pathlen = l - len - count(name)
let l = s.length
let name = NSURL(fileURLWithPath: s).lastPathComponent!
let pathlen = l - len - name.length
let path = (s as NSString).substringWithRange(NSMakeRange(len + 1, pathlen - 2))
let i = MediaItem(name: name, path: path, root: root, type: ItemType.VIDEO)
if !name.hasPrefix(".") {
@ -176,40 +174,49 @@ class NetworkManager {
}
}
func listDirs(root: String, completionHandler: ([MediaItem]) -> Void) -> Void {
func listDirs(root: String, completionHandler: ([MediaItem], Bool) -> Void) -> Void {
var itemsArray = [];
let len = count(root)
let len = root.characters.count
let url = (root as NSString).stringByReplacingOccurrencesOfString(" ", withString: "+")
let ux = baseurl + "/service/listdirs" + url
println (ux)
Alamofire.request(.GET, ux)
.responseSwiftyJSON({
(request, response, json, error) in
print(ux)
Alamofire.request(.GET, ux).responseJSON {
(_, _, response) in
var res = [MediaItem]()
if let json = response.value {
var res = [MediaItem]()
var leaf = false
for s in json as! [String] {
for (a, c) in json {
println (c.object)
if s == "!!LEAF!!" {
leaf = true
} else {
// let (a,b) = j #
// let (a,b) = j #
let s = (c.object as! NSString).substringFromIndex(len+1)
println (s)
var index1 = s.startIndex.advancedBy(len)
var st = s.substringFromIndex(index1)
let i = MediaItem(name: s, path: s, root: root, type: ItemType.FOLDER)
res.append(i)
print(st)
let i = MediaItem(name: st, path: st, root: root, type: ItemType.FOLDER)
res.append(i)
}
}
completionHandler(res, leaf)
}
completionHandler(res)
})
}
}
func playerURL(item: MediaItem) -> String {
let enc = item.name.stringByReplacingOccurrencesOfString(" ", withString: "%20")
return baseurl + "/service/stream" + item.root + "/" + item.path + "/" + enc
return baseurl + "/service/stream" + item.rootSlash + item.path + "/" + enc
}
func loadItems(item: MediaItem) {
if (item.type != ItemType.FOLDER) {
if (item.type != ItemType.FOLDER && item.type != ItemType.DETAILS) {
return
}
@ -224,6 +231,7 @@ println (ux)
loadItem(i, index: j)
j++
}
NSNotificationCenter.defaultCenter().postNotificationName("loadedItems", object: nil)
}
func loadItem(item: MediaItem, index: Int) {
@ -241,51 +249,54 @@ println (ux)
let url = baseurl + "/service/listfiles" + item.thumbPath
println(url)
print(url)
Alamofire.request(.GET, url).responseSwiftyJSON({
(request, response, json, error) in
Alamofire.request(.GET, url).responseJSON {
(_,_,response) in
var hashes = Dictionary<String, String>()
if let json = response.value {
var hashes = Dictionary<String, String>()
for (a, c) in json {
// let (a,b) = j #
let b = c.object as! NSString
for b in json as! [String] {
let p = b.lastPathComponent as NSString
let p = NSURL(fileURLWithPath: b).lastPathComponent!
if p.containsString("_thumb.jpg") {
let ts = p.substringToIndex(p.length - 10)
if p.containsString("_thumb.jpg") {
let ts = p[0 ..< p.length - 10]
hashes[ts] = b as String
} else {
let ts = p.substringToIndex(p.length - 4)
hashes[ts] = b as! String
} else {
let ende = p.length - 4
let ts = p[0 ..< ende]
if hashes[ts] == nil {
hashes[ts] = b as String
if hashes[ts] == nil {
hashes[ts] = b as! String
}
}
}
}
for (ts, p) in hashes {
let t = (ts as NSString).doubleValue / 1000
item.children.removeAll(keepCapacity: true)
for (ts, p) in hashes {
let t = (ts as NSString).doubleValue / 1000
let snap = MediaItem(name: item.name, path: item.path, root: item.root, type: .SNAPSHOT)
snap.time = t
snap.thumbUrl = p
let snap = MediaItem(name: item.name, path: item.path, root: item.root, type: .SNAPSHOT)
snap.time = t
snap.thumbUrl = p
// let op = ImageLoadOperation(baseUrl: self.baseurl, item: snap)
// self.operationQueue.addOperation(op)
snap.parent = item
snap.loaded = true
item.children.append(snap)
}
snap.parent = item
snap.loaded = true
item.children.append(snap)
}
item.loaded = true
NSNotificationCenter.defaultCenter().postNotificationName("loadedItems", object: item)
item.loaded = true
NSNotificationCenter.defaultCenter().postNotificationName("loadedItems", object: item)
// println(error)
})
}
}
}
func favItem(item: MediaItem) {
@ -295,7 +306,7 @@ println (ux)
}
func saveItem(item: MediaItem) {
println(item.children)
print(item.children)
if (item.type != ItemType.VIDEO) {
@ -304,54 +315,52 @@ println (ux)
let url = baseurl + "/service/listfiles" + item.thumbPath
println(url)
print(url)
Alamofire.request(.GET, url).responseSwiftyJSON({
(request, response, json, error) in
var hashes = NSMutableSet()
for (a, c) in json {
// let (a,b) = j #
let b = c.object as! String
hashes.addObject(b)
println(b)
}
Alamofire.request(.GET, url).responseJSON {
(_,_,response) in
for c in item.children {
if let t = c.time {
let ms = Int(t * 1000)
let p = c.thumbPath + "\(ms).jpg"
let pt = c.thumbPath + "\(ms)_thumb.jpg"
println(p)
if hashes.containsObject(pt) {
println("contained")
} else {
if let imageData = UIImageJPEGRepresentation(c.image, 1.0) {
let op = UploadOperation(baseUrl: self.baseurl + "/service/upload", data: imageData, path: p)
self.operationQueue.addOperation(op)
if let json = response.value {
var hashes = Set<String>()
let thumb = c.image!.scaleToSize(15 * 16, height: 15 * 9)
let imageDataT = UIImageJPEGRepresentation(thumb, 1.0);
c.image = thumb
let opT = UploadOperation(baseUrl: self.baseurl + "/service/upload", data: imageDataT, path: pt)
self.operationQueue.addOperation(opT)
for b in json as! [String] {
hashes.insert(b)
print(b)
}
c.loaded = true
for c in item.children {
if let t = c.time {
let ms = Int(t * 1000)
let p = c.thumbPath + "\(ms).jpg"
let pt = c.thumbPath + "\(ms)_thumb.jpg"
print(p)
if hashes.contains(pt) {
print("contained")
} else {
if let id = c.image, imageData = UIImageJPEGRepresentation(id, 1.0) {
let op = UploadOperation(baseUrl: self.baseurl + "/service/upload", data: imageData, path: p)
self.operationQueue.addOperation(op)
let thumb = c.image!.scaleToSize(15 * 16, height: 15 * 9)
let imageDataT = UIImageJPEGRepresentation(thumb, 1.0);
c.image = thumb
let opT = UploadOperation(baseUrl: self.baseurl + "/service/upload", data: imageDataT!, path: pt)
self.operationQueue.addOperation(opT)
c.loaded = true
}
}
hashes.remove(p)
hashes.remove(pt)
}
hashes.removeObject(p)
hashes.removeObject(pt)
}
}
for o in hashes {
println("To delete \(o)")
Alamofire.request(.GET, self.baseurl + "/service/deletethumb\(o)")
for o in hashes {
print("To delete \(o)")
// todo Alamofire.request(.GET, self.baseurl + "/service/deletethumb\(o)")
}
}
println(error)
})
}
}

159
kplayer/detail/DetailViewController.swift

@ -22,7 +22,7 @@ class DetailViewController: UIViewController, UICollectionViewDelegateFlowLayout
var detailItem: MediaItem? {
didSet {
println(detailItem!.children)
print(detailItem!.children)
if collectionView != nil {
collectionView.reloadData()
}
@ -33,20 +33,20 @@ class DetailViewController: UIViewController, UICollectionViewDelegateFlowLayout
func configureView() {
// Update the user interface for the detail item.
println(detailItem)
print(detailItem)
if let detail: MediaItem = self.detailItem {
println(detail)
println(detail.children)
print(detail)
print(detail.children)
if let label = self.detailDescriptionLabel {
label.text = detail.name
}
if count(detail.children) > 0 {
if detail.children.count > 0 {
let i = detail.children[0]
var url = NetworkManager.sharedInstance.playerURL(i)
let url = NetworkManager.sharedInstance.playerURL(i)
println(url)
print(url)
// if moviePlayer == nil {
// play(url)
@ -61,7 +61,7 @@ class DetailViewController: UIViewController, UICollectionViewDelegateFlowLayout
super.loadView()
}
required init(coder aDecoder: NSCoder) {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("refreshItems:"), name: "loadedItems", object: nil)
@ -91,7 +91,7 @@ class DetailViewController: UIViewController, UICollectionViewDelegateFlowLayout
view.addSubview(collectionView)
view.autoresizesSubviews = true
collectionView.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight
collectionView.autoresizingMask = [UIViewAutoresizing.FlexibleWidth, UIViewAutoresizing.FlexibleHeight]
// Do any additional setup after loading the view, typically from a nib.
collectionView.reloadData()
@ -105,7 +105,7 @@ class DetailViewController: UIViewController, UICollectionViewDelegateFlowLayout
let barbutton = UIBarButtonItem(barButtonSystemItem: .Action, target: self, action: Selector("overview"));
navigationItem.rightBarButtonItems = [barbutton]
if detailItem != nil {
println("Details \(detailItem!.children)")
print("Details \(detailItem!.children)")
}
}
@ -130,6 +130,14 @@ class DetailViewController: UIViewController, UICollectionViewDelegateFlowLayout
}
func refreshItems(notification: NSNotification) {
if notification.object == nil {
if self.collectionView != nil {
self.collectionView.reloadData()
}
return
}
let i = notification.object as! MediaItem
let index = i.index
@ -140,30 +148,30 @@ class DetailViewController: UIViewController, UICollectionViewDelegateFlowLayout
return
}
println ("Object: \(oid.hashValue) Index \(index) Item: \(i) Parent: \(i.parent) Detail: \(detailItem)")
print("Object: \(oid.hashValue) Index \(index) Item: \(i) Parent: \(i.parent) Detail: \(detailItem)")
// if (count(detail.children) > 100) {
// self.collectionView.reloadData()
// }
// else {
collectionView.performBatchUpdates({
var newItems = [NSIndexPath]()
var j = 0
collectionView.performBatchUpdates({
var newItems = [NSIndexPath]()
var j = 0
if count(detail.children) > index {
let path = NSIndexPath(forItem: 0, inSection: index)
self.collectionView.reloadItemsAtIndexPaths([path])
if detail.children.count > index {
let path = NSIndexPath(forItem: 0, inSection: index)
self.collectionView.reloadItemsAtIndexPaths([path])
for i in detail.children[index].children {
if j >= 1 {
newItems.append(NSIndexPath(forItem: j, inSection: index))
}
j++
for i in detail.children[index].children {
if j >= 1 {
newItems.append(NSIndexPath(forItem: j, inSection: index))
}
self.collectionView.insertItemsAtIndexPaths(newItems)
j++
}
return
}, completion: nil)
self.collectionView.insertItemsAtIndexPaths(newItems)
}
return
}, completion: nil)
// }
}
@ -177,14 +185,14 @@ class DetailViewController: UIViewController, UICollectionViewDelegateFlowLayout
let indexPath = self.collectionView.indexPathForItemAtPoint(p);
if (indexPath == nil) {
println("couldn't find index path");
print("couldn't find index path");
} else {
if let detail: MediaItem = self.detailItem {
let items = detail.children[indexPath!.section]
if (items.loaded) {
if count(items.children) == 0 {
if items.children.count == 0 {
} else {
if indexPath!.item >= count(items.children) {
if indexPath!.item >= items.children.count {
} else {
items.children.removeAtIndex(indexPath!.item)
self.collectionView.reloadData()
@ -209,7 +217,7 @@ class DetailViewController: UIViewController, UICollectionViewDelegateFlowLayout
func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
if let detail: MediaItem = self.detailItem {
let cnt = count(detail.children)
let cnt = detail.children.count
return cnt
}
return 0
@ -217,7 +225,7 @@ class DetailViewController: UIViewController, UICollectionViewDelegateFlowLayout
func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
if let detail: MediaItem = self.detailItem {
let n = count(detail.children[section].children)
let n = detail.children[section].children.count
if n == 0 {
return 1
@ -232,10 +240,10 @@ class DetailViewController: UIViewController, UICollectionViewDelegateFlowLayout
if let detail: MediaItem = self.detailItem {
let items = detail.children[indexPath.section]
if count(items.children) == 0 {
if items.children.count == 0 {
cell.setItem(items)
} else {
if indexPath.item >= count(items.children) {
if indexPath.item >= items.children.count {
cell.setItem(items)
} else {
let item = items.children[indexPath.item]
@ -269,74 +277,73 @@ class DetailViewController: UIViewController, UICollectionViewDelegateFlowLayout
if let detail: MediaItem = self.detailItem {
var items = detail.children[indexPath.section]
if (items.loaded) {
if indexPath.item >= count(items.children) {
println(items.name)
if indexPath.item >= items.children.count {
print(items.name)
} else {
items = items.children[indexPath.item]
println(items.name)
print(items.name)
}
self.currentItem = items
performSegueWithIdentifier("showVideo", sender: self)
}
else {
let len = count(items.root)
} else {
let len = items.root.characters.count
let url = NetworkManager.sharedInstance.baseurl + "/service/listfiles" + items.fullPath
println(items)
println(url)
print(items)
print(url)
Alamofire.request(.GET, url).responseSwiftyJSON({
(request, response, json, error) in
Alamofire.request(.GET, url).responseJSON {
(_,_,response) in
var im = [MediaItem]()
var hashes = Dictionary<String, String>()
if let json = response.value {
var im = [MediaItem]()
var hashes = Dictionary<String, String>()
for (a, c) in json {
// let (a,b) = j #
let s = c.object as! NSString
for s in json as! [String] {
if s.lowercaseString.hasSuffix(".jpg") {
let l = s.length
let name = (s as NSString).lastPathComponent
var pathlen = l - len - count(name)
if s.lowercaseString.hasSuffix(".jpg") {
let l = s.length
let name = NSURL(fileURLWithPath: s).lastPathComponent!
var pathlen = l - len - name.length
// if (pathlen > 1000) {
println(pathlen)
println(name)
println(s)
print(pathlen)
print(name)
print(s)
// }
if (pathlen < 2) {
pathlen = 2
}
if (pathlen < 2) {
pathlen = 2
}
let path = (s as NSString).substringWithRange(NSMakeRange(len + 1, pathlen - 2))
let path = (s as NSString).substringWithRange(NSMakeRange(len + 1, pathlen - 2))
let folderName = path.lastPathComponent
let fl = count(path)
let pfl = fl - count(folderName)
let folderName = NSURL(fileURLWithPath: path).lastPathComponent!
let fl = path.length
let pfl = fl - folderName.length
println ("\(folderName) \(pfl)")
let fpath = (s as NSString).substringWithRange(NSMakeRange(0, pfl))
print("\(folderName) \(pfl)")
let fpath = (s as NSString).substringWithRange(NSMakeRange(0, pfl))
let i = MediaItem(name: folderName, path: fpath, root: items.root, type: ItemType.PICS)
i.thumbUrl = "\(s)?preview=true"
if !name.hasPrefix(".") {
im.append(i)
let i = MediaItem(name: folderName, path: fpath, root: items.root, type: ItemType.PICS)
i.thumbUrl = "\(s)?preview=true"
if !name.hasPrefix(".") {
im.append(i)
}
}
}
}
let pc = MediaPhotoController()
let pc = MediaPhotoController()
pc.items = im
pc.completionHandler = {
self.dismissViewControllerAnimated(true, completion: nil);
}
let navController = UINavigationController(rootViewController: pc) // Creating a navigation controller with pc at the root of the navigation stack.
pc.items = im
pc.completionHandler = {
self.dismissViewControllerAnimated(true, completion: nil);
}
let navController = UINavigationController(rootViewController: pc) // Creating a navigation controller with pc at the root of the navigation stack.
self.presentViewController(navController, animated: false, completion: nil)
})
self.presentViewController(navController, animated: false, completion: nil)
}
}
}
}
}

2
kplayer/detail/HeaderCell.swift

@ -12,7 +12,7 @@ class HeaderCell: UICollectionViewCell {
var label: UILabel!
required init(coder aDecoder: NSCoder)
required init?(coder aDecoder: NSCoder)
{
super.init(coder: aDecoder)
}

2
kplayer/detail/ItemCell.swift

@ -14,7 +14,7 @@ class ItemCell: UICollectionViewCell {
var image: UIImageView!
required init(coder aDecoder: NSCoder) {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}

40
kplayer/detail/VideoPlayerController.swift

@ -35,9 +35,9 @@ class VideoPlayerController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
var url = NetworkManager.sharedInstance.playerURL(currentItem!)
let url = NetworkManager.sharedInstance.playerURL(currentItem!)
println(url)
print(url)
barbutton = UIBarButtonItem(barButtonSystemItem: .Action, target: self, action: Selector("twoFingersTwoTaps"));
navigationItem.rightBarButtonItems = [barbutton!]
@ -75,7 +75,7 @@ class VideoPlayerController: UIViewController {
moviePlayer!.play()
moviePlayer!.currentPlaybackRate = Float(speedOptions[speedOption])
}
println("play")
print("play")
}
func speed(sender: AnyObject) {
@ -86,7 +86,7 @@ println("play")
moviePlayer!.currentPlaybackRate = Float(speedOptions[speedOption])
speedButton!.title = "\(moviePlayer!.currentPlaybackRate)"
println("speed \(moviePlayer!.currentPlaybackRate)")
print("speed \(moviePlayer!.currentPlaybackRate)")
}
@IBAction func back(sender: AnyObject) {
@ -144,7 +144,7 @@ println("play")
newItem.parent = currentItem!
currentItem!.children.append(newItem)
println(newItem.time)
print(newItem.time)
addItemButton(newItem)
}
@ -187,14 +187,14 @@ println("play")
moviePlayer!.currentPlaybackTime = buttons[source]!.time!
moviePlayer!.currentPlaybackRate = Float(speedOptions[speedOption])
println("goto \(buttons[source]!.time!) is \(moviePlayer!.currentPlaybackTime)")
print("goto \(buttons[source]!.time!) is \(moviePlayer!.currentPlaybackTime)")
}
func update() {
if let player = self.moviePlayer {
if !(player.duration > 0.0) { // player.loadState == MPMovieLoadState.Unknown || player.loadState == MPMovieLoadState.Stalled {
println("again")
print("again")
var timer = NSTimer.scheduledTimerWithTimeInterval(0.3, target: self, selector: Selector("update"), userInfo: nil, repeats: false)
return
}
@ -209,7 +209,7 @@ println("play")
player.currentPlaybackTime = currentItem!.children[0].time!
}
else {
println(player.duration)
print(player.duration)
player.currentPlaybackTime = player.duration / 2
}
}
@ -271,21 +271,21 @@ println("play")
}
func swipeUp() {
println("u")
print("u")
if let player = self.moviePlayer {
println("Type: \(currentItem!.type) Count: \(count(currentItem!.children)) Index: \(index) Current: \(currentItem!.index)")
print("Type: \(currentItem!.type) Count: \(currentItem!.children.count) Index: \(index) Current: \(currentItem!.index)")
if !edit && (currentItem!.children.isEmpty || !(index < count(currentItem!.children) - 1)) {
println ("switch")
if !edit && (currentItem!.children.isEmpty || !(index < currentItem!.children.count - 1)) {
print ("switch")
var newIndex = currentItem!.index + 1
if count(currentItem!.parent!.children) <= newIndex {
if currentItem!.parent!.children.count <= newIndex {
newIndex = 0
}
currentItem = currentItem!.parent!.children[newIndex]
println("'Switched Type: \(currentItem!.type) Count: \(count(currentItem!.children)) Index: \(index) Current: \(currentItem!.index)")
print("'Switched Type: \(currentItem!.type) Count: \(currentItem!.children.count) Index: \(index) Current: \(currentItem!.index)")
index = 0
player.contentURL = NSURL(string: NetworkManager.sharedInstance.playerURL(currentItem!))
@ -296,8 +296,8 @@ println("play")
}
if !(currentItem!.children.isEmpty) {
println ("switch internal")
if index < count(currentItem!.children) - 1 {
print ("switch internal")
if index < currentItem!.children.count - 1 {
index++;
} else {
index = 0;
@ -310,7 +310,7 @@ println("play")
}
func swipeRight() {
println("r")
print("r")
if let player = self.moviePlayer {
player.currentPlaybackTime = player.currentPlaybackTime - 30.0
moviePlayer!.currentPlaybackRate = Float(speedOptions[speedOption])
@ -318,7 +318,7 @@ println("play")
}
func swipeDown() {
println("d")
print("d")
if let player = self.moviePlayer {
if !edit {
@ -343,7 +343,7 @@ println("play")
}
func swipeLeft() {
println("l")
print("l")
if let player = self.moviePlayer {
player.currentPlaybackTime = player.currentPlaybackTime + 30.0
moviePlayer!.currentPlaybackRate = Float(speedOptions[speedOption])
@ -353,7 +353,7 @@ println("play")
func twoFingersTwoTaps() {
if edit {
thumbnailTime = moviePlayer!.currentPlaybackTime
println("tap \(thumbnailTime)")
print("tap \(thumbnailTime)")
moviePlayer!.requestThumbnailImagesAtTimes([thumbnailTime],
timeOption: MPMovieTimeOption.Exact);
}

1419
kplayer/exswift/Array.swift
File diff suppressed because it is too large
View File

18
kplayer/exswift/Bool.swift

@ -1,18 +0,0 @@
//
// Bool.swift
// ExSwift
//
// Created by Hernandez Alvarez, David on 2/10/15.
// Copyright (c) 2015 pNre. All rights reserved.
//
import Foundation
extension Bool {
mutating func toggle() -> Bool {
self = !self
return self
}
}

21
kplayer/exswift/Character.swift

@ -1,21 +0,0 @@
//
// Character.swift
// ExSwift
//
// Created by Cenny Davidsson on 2014-12-08.
// Copyright (c) 2014 pNre. All rights reserved.
//
import Foundation
public extension Character {
/**
If the character represents an integer that fits into an Int, returns
the corresponding integer.
*/
public func toInt () -> Int? {
return String(self).toInt()
}
}

421
kplayer/exswift/Dictionary.swift

@ -1,421 +0,0 @@
//
// Dictionary.swift
// ExSwift
//
// Created by pNre on 04/06/14.
// Copyright (c) 2014 pNre. All rights reserved.
//
import Foundation
import Swift
internal extension Dictionary {
/**
Difference of self and the input dictionaries.
Two dictionaries are considered equal if they contain the same [key: value] pairs.
:param: dictionaries Dictionaries to subtract
:returns: Difference of self and the input dictionaries
*/
func difference <V: Equatable> (dictionaries: [Key: V]...) -> [Key: V] {
var result = [Key: V]()
each {
if let item = $1 as? V {
result[$0] = item
}
}
// Difference
for dictionary in dictionaries {
for (key, value) in dictionary {
if result.has(key) && result[key] == value {
result.removeValueForKey(key)
}
}
}
return result
}
/**
Union of self and the input dictionaries.
:param: dictionaries Dictionaries to join
:returns: Union of self and the input dictionaries
*/
func union (dictionaries: Dictionary...) -> Dictionary {
var result = self
dictionaries.each { (dictionary) -> Void in
dictionary.each { (key, value) -> Void in
_ = result.updateValue(value, forKey: key)
}
}
return result
}
/**
Intersection of self and the input dictionaries.
Two dictionaries are considered equal if they contain the same [key: value] copules.
:param: values Dictionaries to intersect
:returns: Dictionary of [key: value] couples contained in all the dictionaries and self
*/
func intersection <K, V where K: Equatable, V: Equatable> (dictionaries: [K: V]...) -> [K: V] {
// Casts self from [Key: Value] to [K: V]
let filtered = mapFilter { (item, value) -> (K, V)? in
if (item is K) && (value is V) {
return (item as! K, value as! V)
}
return nil
}
// Intersection
return filtered.filter({ (key: K, value: V) -> Bool in
// check for [key: value] in all the dictionaries
dictionaries.all { $0.has(key) && $0[key] == value }
})
}
/**
Checks if a key exists in the dictionary.
:param: key Key to check
:returns: true if the key exists
*/
func has (key: Key) -> Bool {
return indexForKey(key) != nil
}
/**
Creates an Array with values generated by running
each [key: value] of self through the mapFunction.
:param: mapFunction
:returns: Mapped array
*/
func toArray <V> (map: (Key, Value) -> V) -> [V] {
var mapped = [V]()
each {
mapped.append(map($0, $1))
}
return mapped
}
/**
Creates a Dictionary with the same keys as self and values generated by running
each [key: value] of self through the mapFunction.
:param: mapFunction
:returns: Mapped dictionary
*/
func mapValues <V> (map: (Key, Value) -> V) -> [Key: V] {
var mapped = [Key: V]()
each {
mapped[$0] = map($0, $1)
}
return mapped
}
/**
Creates a Dictionary with the same keys as self and values generated by running
each [key: value] of self through the mapFunction discarding nil return values.
:param: mapFunction
:returns: Mapped dictionary
*/
func mapFilterValues <V> (map: (Key, Value) -> V?) -> [Key: V] {
var mapped = [Key: V]()
each {
if let value = map($0, $1) {
mapped[$0] = value
}
}
return mapped
}
/**
Creates a Dictionary with keys and values generated by running
each [key: value] of self through the mapFunction discarding nil return values.
:param: mapFunction
:returns: Mapped dictionary
*/
func mapFilter <K, V> (map: (Key, Value) -> (K, V)?) -> [K: V] {
var mapped = [K: V]()
each {
if let value = map($0, $1) {
mapped[value.0] = value.1
}
}
return mapped
}
/**
Creates a Dictionary with keys and values generated by running
each [key: value] of self through the mapFunction.
:param: mapFunction
:returns: Mapped dictionary
*/
func map <K, V> (map: (Key, Value) -> (K, V)) -> [K: V] {
var mapped = [K: V]()
self.each({
let (_key, _value) = map($0, $1)
mapped[_key] = _value
})
return mapped
}
/**
Loops trough each [key: value] pair in self.
:param: eachFunction Function to inovke on each loop
*/
func each (each: (Key, Value) -> ()) {
for (key, value) in self {
each(key, value)
}
}
/**
Constructs a dictionary containing every [key: value] pair from self
for which testFunction evaluates to true.
:param: testFunction Function called to test each key, value
:returns: Filtered dictionary
*/
func filter (test: (Key, Value) -> Bool) -> Dictionary {
var result = Dictionary()
for (key, value) in self {
if test(key, value) {
result[key] = value
}
}
return result
}
/**
Creates a dictionary composed of keys generated from the results of
running each element of self through groupingFunction. The corresponding
value of each key is an array of the elements responsible for generating the key.
:param: groupingFunction
:returns: Grouped dictionary
*/
func groupBy <T> (group: (Key, Value) -> T) -> [T: [Value]] {
var result = [T: [Value]]()
for (key, value) in self {
let groupKey = group(key, value)
// If element has already been added to dictionary, append to it. If not, create one.
if result.has(groupKey) {
result[groupKey]! += [value]
} else {
result[groupKey] = [value]
}
}
return result
}
/**
Similar to groupBy. Doesn't return a list of values, but the number of values for each group.
:param: groupingFunction Function called to define the grouping key
:returns: Grouped dictionary
*/
func countBy <T> (group: (Key, Value) -> (T)) -> [T: Int] {
var result = [T: Int]()
for (key, value) in self {
let groupKey = group(key, value)
// If element has already been added to dictionary, append to it. If not, create one.
if result.has(groupKey) {
result[groupKey]!++
} else {
result[groupKey] = 1
}
}
return result
}
/**
Checks if test evaluates true for all the elements in self.
:param: test Function to call for each element
:returns: true if test returns true for all the elements in self
*/
func all (test: (Key, Value) -> (Bool)) -> Bool {
for (key, value) in self {
if !test(key, value) {
return false
}
}
return true
}
/**
Checks if test evaluates true for any element of self.
:param: test Function to call for each element
:returns: true if test returns true for any element of self
*/
func any (test: (Key, Value) -> (Bool)) -> Bool {
for (key, value) in self {
if test(key, value) {
return true
}
}
return false
}
/**
Returns the number of elements which meet the condition
:param: test Function to call for each element
:returns: the number of elements meeting the condition
*/
func countWhere (test: (Key, Value) -> (Bool)) -> Int {
var result = 0
for (key, value) in self {
if test(key, value) {
result++
}
}
return result
}
/**
Recombines the [key: value] couples in self trough combine using initial as initial value.
:param: initial Initial value
:param: combine Function that reduces the dictionary
:returns: Resulting value
*/
func reduce <U> (initial: U, combine: (U, Element) -> U) -> U {
return Swift.reduce(self, initial, combine)
}
/**
Returns a copy of self, filtered to only have values for the whitelisted keys.
:param: keys Whitelisted keys
:returns: Filtered dictionary
*/
func pick (keys: [Key]) -> Dictionary {
return filter { (key: Key, _) -> Bool in
return keys.contains(key)
}
}
/**
Returns a copy of self, filtered to only have values for the whitelisted keys.
:param: keys Whitelisted keys
:returns: Filtered dictionary
*/
func pick (keys: Key...) -> Dictionary {
return pick(unsafeBitCast(keys, [Key].self))
}
/**
Returns a copy of self, filtered to only have values for the whitelisted keys.
:param: keys Keys to get
:returns: Dictionary with the given keys
*/
func at (keys: Key...) -> Dictionary {
return pick(keys)
}
/**
Removes a (key, value) pair from self and returns it as tuple.
If the dictionary is empty returns nil.
:returns: (key, value) tuple
*/
mutating func shift () -> (Key, Value)? {
if let key = keys.first {
return (key, removeValueForKey(key)!)
}
return nil
}
}
/**
Difference operator
*/
public func - <K, V: Equatable> (first: [K: V], second: [K: V]) -> [K: V] {
return first.difference(second)
}
/**
Intersection operator
*/
public func & <K, V: Equatable> (first: [K: V], second: [K: V]) -> [K: V] {
return first.intersection(second)
}
/**
Union operator
*/
public func | <K: Hashable, V> (first: [K: V], second: [K: V]) -> [K: V] {
return first.union(second)
}

93
kplayer/exswift/Double.swift

@ -1,93 +0,0 @@
//
// Double.swift
// ExSwift
//
// Created by pNre on 10/07/14.
// Copyright (c) 2014 pNre. All rights reserved.
//
import Foundation
public extension Double {
/**
Absolute value.
:returns: fabs(self)
*/
func abs () -> Double {
return Foundation.fabs(self)
}
/**
Squared root.
:returns: sqrt(self)
*/
func sqrt () -> Double {
return Foundation.sqrt(self)
}
/**
Rounds self to the largest integer <= self.
:returns: floor(self)
*/
func floor () -> Double {
return Foundation.floor(self)
}
/**
Rounds self to the smallest integer >= self.
:returns: ceil(self)
*/
func ceil () -> Double {
return Foundation.ceil(self)
}
/**
Rounds self to the nearest integer.
:returns: round(self)
*/
func round () -> Double {
return Foundation.round(self)
}
/**
Clamps self to a specified range.
:param: min Lower bound
:param: max Upper bound
:returns: Clamped value
*/
func clamp (min: Double, _ max: Double) -> Double {
return Swift.max(min, Swift.min(max, self))
}
/**
Just like round(), except it supports rounding to an arbitrary number, not just 1
Be careful about rounding errors
:params: increment the increment to round to
*/
func roundToNearest(increment: Double) -> Double {
let remainder = self % increment
return remainder < increment / 2 ? self - remainder : self - remainder + increment
}
/**
Random double between min and max (inclusive).
:params: min
:params: max
:returns: Random number
*/
static func random(min: Double = 0, max: Double) -> Double {
let diff = max - min;
let rand = Double(arc4random() % (UInt32(RAND_MAX) + 1))
return ((rand / Double(RAND_MAX)) * diff) + min;
}
}

19
kplayer/exswift/ExSwift.h

@ -1,19 +0,0 @@
//
// ExSwift.h
// ExSwift
//
// Created by pNre on 07/06/14.
// Copyright (c) 2014 pNre. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for ExSwift.
FOUNDATION_EXPORT double ExSwiftVersionNumber;
//! Project version string for ExSwift.
FOUNDATION_EXPORT const unsigned char ExSwiftVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <ExSwift/PublicHeader.h>

282
kplayer/exswift/ExSwift.swift

@ -1,282 +0,0 @@
//
// ExSwift.swift
// ExSwift
//
// Created by pNre on 07/06/14.
// Copyright (c) 2014 pNre. All rights reserved.
//
import Foundation
infix operator =~ {}
infix operator |~ {}
infix operator .. {}
infix operator <=> {}
public typealias Ex = ExSwift
public class ExSwift {
/**
Creates a wrapper that, executes function only after being called n times.
:param: n No. of times the wrapper has to be called before function is invoked
:param: function Function to wrap
:returns: Wrapper function
*/
public class func after <P, T> (n: Int, function: (P...) -> T) -> ((P...) -> T?) {
typealias Function = [P] -> T
var times = n
return {
(params: P...) -> T? in
// Workaround for the now illegal (T...) type.
let adaptedFunction = unsafeBitCast(function, Function.self)
if times-- <= 0 {
return adaptedFunction(params)
}
return nil
}
}
/**
Creates a wrapper that, executes function only after being called n times
:param: n No. of times the wrapper has to be called before function is invoked
:param: function Function to wrap
:returns: Wrapper function
*/
public class func after <T> (n: Int, function: Void -> T) -> (Void -> T?) {
func callAfter (args: Any?...) -> T {
return function()
}
let f = ExSwift.after(n, function: callAfter)
return { f([nil]) }
}
/**
Creates a wrapper function that invokes function once.
Repeated calls to the wrapper function will return the value of the first call.
:param: function Function to wrap
:returns: Wrapper function
*/
public class func once <P, T> (function: (P...) -> T) -> ((P...) -> T) {
typealias Function = [P] -> T
var returnValue: T? = nil
return { (params: P...) -> T in
if returnValue != nil {
return returnValue!
}
let adaptedFunction = unsafeBitCast(function, Function.self)
returnValue = adaptedFunction(params)
return returnValue!
}
}
/**
Creates a wrapper function that invokes function once.
Repeated calls to the wrapper function will return the value of the first call.
:param: function Function to wrap
:returns: Wrapper function
*/
public class func once <T> (function: Void -> T) -> (Void -> T) {
let f = ExSwift.once {
(params: Any?...) -> T in
return function()
}
return { f([nil]) }
}
/**
Creates a wrapper that, when called, invokes function with any additional
partial arguments prepended to those provided to the new function.
:param: function Function to wrap
:param: parameters Arguments to prepend
:returns: Wrapper function
*/
public class func partial <P, T> (function: (P...) -> T, _ parameters: P...) -> ((P...) -> T) {
typealias Function = [P] -> T
return { (params: P...) -> T in
let adaptedFunction = unsafeBitCast(function, Function.self)
return adaptedFunction(parameters + params)
}
}
/**
Creates a wrapper (without any parameter) that, when called, invokes function
automatically passing parameters as arguments.
:param: function Function to wrap
:param: parameters Arguments to pass to function
:returns: Wrapper function
*/
public class func bind <P, T> (function: (P...) -> T, _ parameters: P...) -> (Void -> T) {
typealias Function = [P] -> T
return { Void -> T in
let adaptedFunction = unsafeBitCast(function, Function.self)
return adaptedFunction(parameters)
}
}
/**
Creates a wrapper for function that caches the result of function's invocations.
:param: function Function with one parameter to cache
:returns: Wrapper function
*/
public class func cached <P: Hashable, R> (function: P -> R) -> (P -> R) {
var cache = [P:R]()
return { (param: P) -> R in
let key = param
if let cachedValue = cache[key] {
return cachedValue
} else {
let value = function(param)
cache[key] = value
return value
}
}
}
/**
Creates a wrapper for function that caches the result of function's invocations.
:param: function Function to cache
:param: hash Parameters based hashing function that computes the key used to store each result in the cache
:returns: Wrapper function
*/
public class func cached <P: Hashable, R> (function: (P...) -> R, hash: ((P...) -> P)) -> ((P...) -> R) {
typealias Function = [P] -> R
typealias Hash = [P] -> P
var cache = [P:R]()
return { (params: P...) -> R in
let adaptedFunction = unsafeBitCast(function, Function.self)
let adaptedHash = unsafeBitCast(hash, Hash.self)
let key = adaptedHash(params)
if let cachedValue = cache[key] {
return cachedValue
} else {
let value = adaptedFunction(params)
cache[key] = value
return value
}
}
}
/**
Creates a wrapper for function that caches the result of function's invocations.
:param: function Function to cache
:returns: Wrapper function
*/
public class func cached <P: Hashable, R> (function: (P...) -> R) -> ((P...) -> R) {
return cached(function, hash: { (params: P...) -> P in return params[0] })
}
/**
Utility method to return an NSRegularExpression object given a pattern.
:param: pattern Regex pattern
:param: ignoreCase If true the NSRegularExpression is created with the NSRegularExpressionOptions.CaseInsensitive flag
:returns: NSRegularExpression object
*/
internal class func regex (pattern: String, ignoreCase: Bool = false) -> NSRegularExpression? {
var options = NSRegularExpressionOptions.DotMatchesLineSeparators.rawValue
if ignoreCase {
options = NSRegularExpressionOptions.CaseInsensitive.rawValue | options
}
var error: NSError? = nil
let regex = NSRegularExpression(pattern: pattern, options: NSRegularExpressionOptions(rawValue: options), error: &error)
return (error == nil) ? regex : nil
}
}
func <=> <T: Comparable>(lhs: T, rhs: T) -> Int {
if lhs < rhs {
return -1
} else if lhs > rhs {
return 1
} else {
return 0
}
}
/**
* Internal methods
*/
extension ExSwift {
/**
* Converts, if possible, and flattens an object from its Objective-C
* representation to the Swift one.
* @param object Object to convert
* @returns Flattenend array of converted values
*/
internal class func bridgeObjCObject <T, S> (object: S) -> [T] {
var result = [T]()
let reflection = reflect(object)
// object has an Objective-C type
if let obj = object as? T {
// object has type T
result.append(obj)
} else if reflection.disposition == .ObjCObject {
var bridgedValue: T!?
// If it is an NSArray, flattening will produce the expected result
if let array = object as? NSArray {
result += array.flatten()
} else if let bridged = reflection.value as? T {
result.append(bridged)
}
} else if reflection.disposition == .IndexContainer {
// object is a native Swift array
// recursively convert each item
(0..<reflection.count).each {
let ref = reflection[$0].1
result += Ex.bridgeObjCObject(ref.value)
}
}
return result
}
}

83
kplayer/exswift/Float.swift

@ -1,83 +0,0 @@
//
// Float.swift
// ExSwift
//
// Created by pNre on 04/06/14.
// Copyright (c) 2014 pNre. All rights reserved.
//
import Foundation
public extension Float {
/**
Absolute value.
:returns: fabs(self)
*/
func abs () -> Float {
return fabsf(self)
}
/**
Squared root.
:returns: sqrtf(self)
*/
func sqrt () -> Float {
return sqrtf(self)
}
/**
Rounds self to the largest integer <= self.
:returns: floorf(self)
*/
func floor () -> Float {
return floorf(self)
}
/**
Rounds self to the smallest integer >= self.
:returns: ceilf(self)
*/
func ceil () -> Float {
return ceilf(self)
}
/**
Rounds self to the nearest integer.
:returns: roundf(self)
*/
func round () -> Float {
return roundf(self)
}
/**
Clamps self to a specified range.
:param: min Lower bound
:param: max Upper bound
:returns: Clamped value
*/
func clamp (min: Float, _ max: Float) -> Float {
return Swift.max(min, Swift.min(max, self))
}
/**
Random float between min and max (inclusive).
:param: min
:param: max
:returns: Random number
*/
static func random(min: Float = 0, max: Float) -> Float {
let diff = max - min;
let rand = Float(arc4random() % (UInt32(RAND_MAX) + 1))
return ((rand / Float(RAND_MAX)) * diff) + min;
}
}

256
kplayer/exswift/Int.swift

@ -1,256 +0,0 @@
//
// Int.swift
// ExSwift
//
// Created by pNre on 03/06/14.
// Copyright (c) 2014 pNre. All rights reserved.
//
import Foundation
public extension Int {
/**
Calls function self times.
:param: function Function to call
*/
func times <T> (function: Void -> T) {
(0..<self).each { _ in function(); return }
}
/**
Calls function self times.
:param: function Function to call
*/
func times (function: Void -> Void) {
(0..<self).each { _ in function(); return }
}
/**
Calls function self times passing a value from 0 to self on each call.
:param: function Function to call
*/
func times <T> (function: (Int) -> T) {
(0..<self).each { index in function(index); return }
}
/**
Checks if a number is even.
:returns: true if self is even
*/
func isEven () -> Bool {
return (self % 2) == 0
}
/**
Checks if a number is odd.
:returns: true if self is odd
*/
func isOdd () -> Bool {
return !isEven()
}
/**
Iterates function, passing in integer values from self up to and including limit.
:param: limit Last value to pass
:param: function Function to invoke
*/
func upTo (limit: Int, function: (Int) -> ()) {
if limit < self {
return
}
(self...limit).each(function)
}
/**
Iterates function, passing in integer values from self down to and including limit.
:param: limit Last value to pass
:param: function Function to invoke
*/
func downTo (limit: Int, function: (Int) -> ()) {
if limit > self {
return
}
Array(limit...self).reverse().each(function)
}
/**
Clamps self to a specified range.
:param: range Clamping range
:returns: Clamped value
*/
func clamp (range: Range<Int>) -> Int {
return clamp(range.startIndex, range.endIndex - 1)
}
/**
Clamps self to a specified range.
:param: min Lower bound
:param: max Upper bound
:returns: Clamped value
*/
func clamp (min: Int, _ max: Int) -> Int {
return Swift.max(min, Swift.min(max, self))
}
/**
Checks if self is included a specified range.
:param: range Range
:param: strict If true, "<" is used for comparison
:returns: true if in range
*/
func isIn (range: Range<Int>, strict: Bool = false) -> Bool {
if strict {
return range.startIndex < self && self < range.endIndex - 1
}
return range.startIndex <= self && self <= range.endIndex - 1
}
/**
Checks if self is included in a closed interval.
:param: interval Interval to check
:returns: true if in the interval
*/
func isIn (interval: ClosedInterval<Int>) -> Bool {
return interval.contains(self)
}
/**
Checks if self is included in an half open interval.
:param: interval Interval to check
:returns: true if in the interval
*/
func isIn (interval: HalfOpenInterval<Int>) -> Bool {
return interval.contains(self)
}
/**
Returns an [Int] containing the digits in self.
:return: Array of digits
*/
func digits () -> [Int] {
var result = [Int]()
for char in String(self) {
let string = String(char)
if let toInt = string.toInt() {
result.append(toInt)
}
}
return result
}
/**
Absolute value.
:returns: abs(self)
*/
func abs () -> Int {
return Swift.abs(self)
}
/**
Greatest common divisor of self and n.
:param: n
:returns: GCD
*/
func gcd (n: Int) -> Int {
return n == 0 ? self : n.gcd(self % n)
}
/**
Least common multiple of self and n
:param: n
:returns: LCM
*/
func lcm (n: Int) -> Int {
return (self * n).abs() / gcd(n)
}
/**
Computes the factorial of self
:returns: Factorial
*/
func factorial () -> Int {
return self == 0 ? 1 : self * (self - 1).factorial()
}
/**
Random integer between min and max (inclusive).
:param: min Minimum value to return
:param: max Maximum value to return
:returns: Random integer
*/
static func random(min: Int = 0, max: Int) -> Int {
return Int(arc4random_uniform(UInt32((max - min) + 1))) + min
}
}
/**
NSTimeInterval conversion extensions
*/
public extension Int {
var years: NSTimeInterval {
return 365 * self.days
}
var year: NSTimeInterval {
return self.years
}
var days: NSTimeInterval {
return 24 * self.hours
}
var day: NSTimeInterval {
return self.days
}
var hours: NSTimeInterval {
return 60 * self.minutes
}
var hour: NSTimeInterval {
return self.hours
}
var minutes: NSTimeInterval {
return 60 * self.seconds
}
var minute: NSTimeInterval {
return self.minutes
}
var seconds: NSTimeInterval {
return NSTimeInterval(self)
}
var second: NSTimeInterval {
return self.seconds
}
}

64
kplayer/exswift/NSArray.swift

@ -1,64 +0,0 @@
//
// NSArray.swift
// ExSwift
//
// Created by pNre on 10/06/14.
// Copyright (c) 2014 pNre. All rights reserved.
//
import Foundation
public extension NSArray {
/**
Converts an NSArray object to an OutType[] array containing the items in the NSArray of type OutType.
:returns: Array of Swift objects
*/
func cast <OutType> () -> [OutType] {
var result = [OutType]()
for item : AnyObject in self {
result += Ex.bridgeObjCObject(item) as [OutType]
}
return result
}
/**
Flattens a multidimensional NSArray to an OutType[] array
containing the items in the NSArray that can be bridged from their ObjC type to OutType.
:returns: Flattened array
*/
func flatten <OutType> () -> [OutType] {
var result = [OutType]()
let reflection = reflect(self)
for i in 0..<reflection.count {
result += Ex.bridgeObjCObject(reflection[i].1.value) as [OutType]
}
return result
}
/**
Flattens a multidimensional NSArray to a [AnyObject].
:returns: Flattened array
*/
func flattenAny () -> [AnyObject] {
var result = [AnyObject]()
for item in self {
if let array = item as? NSArray {
result += array.flattenAny()
} else {
result.append(item)
}
}
return result
}
}

318
kplayer/exswift/NSDate.swift

@ -1,318 +0,0 @@
//
// File.swift
// ExSwift
//
// Created by Piergiuseppe Longo on 23/11/14.
// Copyright (c) 2014 pNre. All rights reserved.
//
import Foundation
public extension NSDate {
// MARK: NSDate Manipulation
/**
Returns a new NSDate object representing the date calculated by adding the amount specified to self date
:param: seconds number of seconds to add
:param: minutes number of minutes to add
:param: hours number of hours to add
:param: days number of days to add
:param: weeks number of weeks to add
:param: months number of months to add
:param: years number of years to add
:returns: the NSDate computed
*/
public func add(seconds: Int = 0, minutes: Int = 0, hours: Int = 0, days: Int = 0, weeks: Int = 0, months: Int = 0, years: Int = 0) -> NSDate {
var calendar = NSCalendar.currentCalendar()
let version = floor(NSFoundationVersionNumber)
if version <= NSFoundationVersionNumber10_9_2 {
var component = NSDateComponents()
component.setValue(seconds, forComponent: .CalendarUnitSecond)
var date : NSDate! = calendar.dateByAddingComponents(component, toDate: self, options: nil)!
component = NSDateComponents()
component.setValue(minutes, forComponent: .CalendarUnitMinute)
date = calendar.dateByAddingComponents(component, toDate: date, options: nil)!
component = NSDateComponents()
component.setValue(hours, forComponent: .CalendarUnitHour)
date = calendar.dateByAddingComponents(component, toDate: date, options: nil)!
component = NSDateComponents()
component.setValue(days, forComponent: .CalendarUnitDay)
date = calendar.dateByAddingComponents(component, toDate: date, options: nil)!
component = NSDateComponents()
component.setValue(weeks, forComponent: .CalendarUnitWeekOfMonth)
date = calendar.dateByAddingComponents(component, toDate: date, options: nil)!
component = NSDateComponents()
component.setValue(months, forComponent: .CalendarUnitMonth)
date = calendar.dateByAddingComponents(component, toDate: date, options: nil)!
component = NSDateComponents()
component.setValue(years, forComponent: .CalendarUnitYear)
date = calendar.dateByAddingComponents(component, toDate: date, options: nil)!
return date
}
var date : NSDate! = calendar.dateByAddingUnit(.CalendarUnitSecond, value: seconds, toDate: self, options: nil)
date = calendar.dateByAddingUnit(.CalendarUnitMinute, value: minutes, toDate: date, options: nil)
date = calendar.dateByAddingUnit(.CalendarUnitDay, value: days, toDate: date, options: nil)
date = calendar.dateByAddingUnit(.CalendarUnitHour, value: hours, toDate: date, options: nil)
date = calendar.dateByAddingUnit(.CalendarUnitWeekOfMonth, value: weeks, toDate: date, options: nil)
date = calendar.dateByAddingUnit(.CalendarUnitMonth, value: months, toDate: date, options: nil)
date = calendar.dateByAddingUnit(.CalendarUnitYear, value: years, toDate: date, options: nil)
return date
}
/**
Returns a new NSDate object representing the date calculated by adding an amount of seconds to self date
:param: seconds number of seconds to add
:returns: the NSDate computed
*/
public func addSeconds (seconds: Int) -> NSDate {
return add(seconds: seconds)
}
/**
Returns a new NSDate object representing the date calculated by adding an amount of minutes to self date
:param: minutes number of minutes to add
:returns: the NSDate computed
*/
public func addMinutes (minutes: Int) -> NSDate {
return add(minutes: minutes)
}
/**
Returns a new NSDate object representing the date calculated by adding an amount of hours to self date
:param: hours number of hours to add
:returns: the NSDate computed
*/
public func addHours(hours: Int) -> NSDate {
return add(hours: hours)
}
/**
Returns a new NSDate object representing the date calculated by adding an amount of days to self date
:param: days number of days to add
:returns: the NSDate computed
*/
public func addDays(days: Int) -> NSDate {
return add(days: days)
}
/**
Returns a new NSDate object representing the date calculated by adding an amount of weeks to self date
:param: weeks number of weeks to add
:returns: the NSDate computed
*/
public func addWeeks(weeks: Int) -> NSDate {
return add(weeks: weeks)
}
/**
Returns a new NSDate object representing the date calculated by adding an amount of months to self date
:param: months number of months to add
:returns: the NSDate computed
*/
public func addMonths(months: Int) -> NSDate {
return add(months: months)
}
/**
Returns a new NSDate object representing the date calculated by adding an amount of years to self date
:param: years number of year to add
:returns: the NSDate computed
*/
public func addYears(years: Int) -> NSDate {
return add(years: years)
}
// MARK: Date comparison
/**
Checks if self is after input NSDate
:param: date NSDate to compare
:returns: True if self is after the input NSDate, false otherwise
*/
public func isAfter(date: NSDate) -> Bool{
return (self.compare(date) == NSComparisonResult.OrderedDescending)
}
/**
Checks if self is before input NSDate
:param: date NSDate to compare
:returns: True if self is before the input NSDate, false otherwise
*/
public func isBefore(date: NSDate) -> Bool{
return (self.compare(date) == NSComparisonResult.OrderedAscending)
}
// MARK: Getter
/**
Date year
*/
public var year : Int {
get {
return getComponent(.CalendarUnitYear)
}
}
/**
Date month
*/
public var month : Int {
get {
return getComponent(.CalendarUnitMonth)
}
}
/**
Date weekday
*/
public var weekday : Int {
get {
return getComponent(.CalendarUnitWeekday)
}
}
/**
Date weekMonth
*/
public var weekMonth : Int {
get {
return getComponent(.CalendarUnitWeekOfMonth)
}
}
/**
Date days
*/
public var days : Int {
get {
return getComponent(.CalendarUnitDay)
}
}
/**
Date hours
*/
public var hours : Int {
get {
return getComponent(.CalendarUnitHour)
}
}
/**
Date minuts
*/
public var minutes : Int {
get {
return getComponent(.CalendarUnitMinute)
}
}
/**
Date seconds
*/
public var seconds : Int {
get {
return getComponent(.CalendarUnitSecond)
}
}
/**
Returns the value of the NSDate component
:param: component NSCalendarUnit
:returns: the value of the component
*/
public func getComponent (component : NSCalendarUnit) -> Int {
let calendar = NSCalendar.currentCalendar()
let components = calendar.components(component, fromDate: self)
return components.valueForComponent(component)
}
}
extension NSDate: Strideable {
public func distanceTo(other: NSDate) -> NSTimeInterval {
return other - self
}
public func advancedBy(n: NSTimeInterval) -> Self {
return self.dynamicType(timeIntervalSinceReferenceDate: self.timeIntervalSinceReferenceDate + n)
}
}
// MARK: Arithmetic
func +(date: NSDate, timeInterval: Int) -> NSDate {
return date + NSTimeInterval(timeInterval)
}
func -(date: NSDate, timeInterval: Int) -> NSDate {
return date - NSTimeInterval(timeInterval)
}
func +=(inout date: NSDate, timeInterval: Int) {
date = date + timeInterval
}
func -=(inout date: NSDate, timeInterval: Int) {
date = date - timeInterval
}
func +(date: NSDate, timeInterval: Double) -> NSDate {
return date.dateByAddingTimeInterval(NSTimeInterval(timeInterval))
}
func -(date: NSDate, timeInterval: Double) -> NSDate {
return date.dateByAddingTimeInterval(NSTimeInterval(-timeInterval))
}
func +=(inout date: NSDate, timeInterval: Double) {
date = date + timeInterval
}
func -=(inout date: NSDate, timeInterval: Double) {
date = date - timeInterval
}
func -(date: NSDate, otherDate: NSDate) -> NSTimeInterval {
return date.timeIntervalSinceDate(otherDate)
}
extension NSDate: Equatable {
}
public func ==(lhs: NSDate, rhs: NSDate) -> Bool {
return lhs.compare(rhs) == NSComparisonResult.OrderedSame
}
extension NSDate: Comparable {
}
public func <(lhs: NSDate, rhs: NSDate) -> Bool {
return lhs.compare(rhs) == NSComparisonResult.OrderedAscending
}

80
kplayer/exswift/Range.swift

@ -1,80 +0,0 @@
//
// Range.swift
// ExSwift
//
// Created by pNre on 04/06/14.
// Copyright (c) 2014 pNre. All rights reserved.
//
import Foundation
internal extension Range {
/**
For each element in the range invokes function.
:param: function Function to call
*/
func times (function: () -> ()) {
each { (current: T) -> () in
function()
}
}
/**
For each element in the range invokes function passing the element as argument.
:param: function Function to invoke
*/
func times (function: (T) -> ()) {
each (function)
}
/**
For each element in the range invokes function passing the element as argument.
:param: function Function to invoke
*/
func each (function: (T) -> ()) {
for i in self {
function(i)
}
}
/**
Returns each element of the range in an array
:returns: Each element of the range in an array
*/
func toArray () -> [T] {
var result: [T] = []
for i in self {
result.append(i)
}
return result
}
/**
Range of Int with random bounds between from and to (inclusive).
:param: from Lower bound
:param: to Upper bound
:returns: Random range
*/
static func random (from: Int, to: Int) -> Range<Int> {
let lowerBound = Int.random(min: from, max: to)
let upperBound = Int.random(min: lowerBound, max: to)
return lowerBound...upperBound
}
}
/**
* Operator == to compare 2 ranges first, second by start & end indexes. If first.startIndex is equal to
* second.startIndex and first.endIndex is equal to second.endIndex the ranges are considered equal.
*/
public func == <U: ForwardIndexType> (first: Range<U>, second: Range<U>) -> Bool {
return first.startIndex == second.startIndex &&
first.endIndex == second.endIndex
}

244
kplayer/exswift/Sequence.swift

@ -1,244 +0,0 @@
//
// Sequence.swift
// ExSwift
//
// Created by Colin Eberhardt on 24/06/2014.
// Copyright (c) 2014 pNre. All rights reserved.
//
import Foundation
internal extension SequenceOf {
/**
First element of the sequence.
:returns: First element of the sequence if present
*/
var first: T? {
var generator = self.generate()
return generator.next()
}
/**
Checks if call returns true for any element of self.
:param: call Function to call for each element
:returns: True if call returns true for any element of self
*/
func any (call: (T) -> Bool) -> Bool {
var generator = self.generate()
while let nextItem = generator.next() {
if call(nextItem) {
return true
}
}
return false
}
/**
Object at the specified index if exists.
:param: index
:returns: Object at index in sequence, nil if index is out of bounds
*/
func get (index: Int) -> T? {
var generator = self.generate()
for _ in 0..<(index - 1) {
generator.next()
}
return generator.next()
}
/**
Objects in the specified range.
:param: range
:returns: Subsequence in range
*/
func get (range: Range<Int>) -> SequenceOf<T> {
return self.skip(range.startIndex).take(range.endIndex - range.startIndex)
}
/**
Index of the first occurrence of item, if found.
:param: item The item to search for
:returns: Index of the matched item or nil
*/
func indexOf <U: Equatable> (item: U) -> Int? {
var index = 0
for current in self {
if let equatable = current as? U {
if equatable == item {
return index
}
}
index++
}
return nil
}
/**
Subsequence from n to the end of the sequence.
:param: n Number of elements to skip
:returns: Sequence from n to the end
*/
func skip (n: Int) -> SequenceOf<T> {
var generator = self.generate()
for _ in 0..<n {
generator.next()
}
return SequenceOf(generator)
}
/**
Filters the sequence only including items that match the test.
:param: include Function invoked to test elements for inclusion in the sequence
:returns: Filtered sequence
*/
func filter(include: (T) -> Bool) -> SequenceOf<T> {
return SequenceOf(lazy(self).filter(include))
}
/**
Opposite of filter.
:param: exclude Function invoked to test elements for exlcusion from the sequence
:returns: Filtered sequence
*/
func reject (exclude: (T -> Bool)) -> SequenceOf<T> {
return self.filter {
return !exclude($0)
}
}
/**
Skips the elements in the sequence up until the condition returns false.
:param: condition A function which returns a boolean if an element satisfies a given condition or not
:returns: Elements of the sequence starting with the element which does not meet the condition
*/
func skipWhile(condition:(T) -> Bool) -> SequenceOf<T> {
var generator = self.generate()
var checkingGenerator = self.generate()
var keepSkipping = true
while keepSkipping {
var nextItem = checkingGenerator.next()
keepSkipping = nextItem != nil ? condition(nextItem!) : false
if keepSkipping {
generator.next()
}
}
return SequenceOf(generator)
}
/**
Checks if self contains the item object.
:param: item The item to search for
:returns: true if self contains item
*/
func contains<T:Equatable> (item: T) -> Bool {
var generator = self.generate()
while let nextItem = generator.next() {
if nextItem as! T == item {
return true
}
}
return false
}
/**
Returns the first n elements from self.
:param: n Number of elements to take
:returns: First n elements
*/
func take (n: Int) -> SequenceOf<T> {
return SequenceOf(TakeSequence(self, n))
}
/**
Returns the elements of the sequence up until an element does not meet the condition.
:param: condition A function which returns a boolean if an element satisfies a given condition or not.
:returns: Elements of the sequence up until an element does not meet the condition
*/
func takeWhile (condition:(T?) -> Bool) -> SequenceOf<T> {
return SequenceOf(TakeWhileSequence(self, condition))
}
/**
Returns each element of the sequence in an array
:returns: Each element of the sequence in an array
*/
func toArray () -> [T] {
var result: [T] = []
for item in self {
result.append(item)
}
return result
}
}
/**
A sequence adapter that implements the 'take' functionality
*/
public struct TakeSequence<S: SequenceType>: SequenceType {
private let sequence: S
private let n: Int
public init(_ sequence: S, _ n: Int) {
self.sequence = sequence
self.n = n
}
public func generate() -> GeneratorOf<S.Generator.Element> {
var count = 0
var generator = self.sequence.generate()
return GeneratorOf<S.Generator.Element> {
count++
if count > self.n {
return nil
} else {
return generator.next()
}
}
}
}
/**
a sequence adapter that implements the 'takeWhile' functionality
*/
public struct TakeWhileSequence<S: SequenceType>: SequenceType {
private let sequence: S
private let condition: (S.Generator.Element?) -> Bool
public init(_ sequence:S, _ condition:(S.Generator.Element?) -> Bool) {
self.sequence = sequence
self.condition = condition
}
public func generate() -> GeneratorOf<S.Generator.Element> {
var generator = self.sequence.generate()
var endConditionMet = false
return GeneratorOf<S.Generator.Element> {
let next: S.Generator.Element? = generator.next()
if !endConditionMet {
endConditionMet = !self.condition(next)
}
if endConditionMet {
return nil
} else {
return next
}
}
}
}

403
kplayer/exswift/String.swift

@ -1,403 +0,0 @@
//
// String.swift
// ExSwift
//
// Created by pNre on 03/06/14.
// Copyright (c) 2014 pNre. All rights reserved.
//
import Foundation
public extension String {
/**
String length
*/
var length: Int { return count(self) }
/**
self.capitalizedString shorthand
*/
var capitalized: String { return capitalizedString }
/**
Returns the substring in the given range
:param: range
:returns: Substring in range
*/
subscript (range: Range<Int>) -> String? {
if range.startIndex < 0 || range.endIndex > self.length {
return nil
}
let range = Range(start: advance(startIndex, range.startIndex), end: advance(startIndex, range.endIndex))
return self[range]
}
/**
Equivalent to at. Takes a list of indexes and returns an Array
containing the elements at the given indexes in self.
:param: firstIndex
:param: secondIndex
:param: restOfIndexes
:returns: Charaters at the specified indexes (converted to String)
*/
subscript (firstIndex: Int, secondIndex: Int, restOfIndexes: Int...) -> [String] {
return at([firstIndex, secondIndex] + restOfIndexes)
}
/**
Gets the character at the specified index as String.
If index is negative it is assumed to be relative to the end of the String.
:param: index Position of the character to get
:returns: Character as String or nil if the index is out of bounds
*/
subscript (index: Int) -> String? {
if let char = Array(self).get(index) {
return String(char)
}
return nil
}
/**
Takes a list of indexes and returns an Array containing the elements at the given indexes in self.
:param: indexes Positions of the elements to get
:returns: Array of characters (as String)
*/
func at (indexes: Int...) -> [String] {
return indexes.map { self[$0]! }
}
/**
Takes a list of indexes and returns an Array containing the elements at the given indexes in self.
:param: indexes Positions of the elements to get
:returns: Array of characters (as String)
*/
func at (indexes: [Int]) -> [String] {
return indexes.map { self[$0]! }
}
/**
Returns an array of strings, each of which is a substring of self formed by splitting it on separator.
:param: separator Character used to split the string
:returns: Array of substrings
*/
func explode (separator: Character) -> [String] {
return split(self, isSeparator: { (element: Character) -> Bool in
return element == separator
})
}
/**
Finds any match in self for pattern.
:param: pattern Pattern to match
:param: ignoreCase true for case insensitive matching
:returns: Matches found (as [NSTextCheckingResult])
*/
func matches (pattern: String, ignoreCase: Bool = false) -> [NSTextCheckingResult]? {
if let regex = ExSwift.regex(pattern, ignoreCase: ignoreCase) {
// Using map to prevent a possible bug in the compiler
return regex.matchesInString(self, options: nil, range: NSMakeRange(0, length)).map { $0 as! NSTextCheckingResult }
}
return nil
}
/**
Check is string with this pattern included in string
:param: pattern Pattern to match
:param: ignoreCase true for case insensitive matching
:returns: true if contains match, otherwise false
*/
func containsMatch (pattern: String, ignoreCase: Bool = false) -> Bool? {
if let regex = ExSwift.regex(pattern, ignoreCase: ignoreCase) {
let range = NSMakeRange(0, count(self))
return regex.firstMatchInString(self, options: .allZeros, range: range) != nil
}
return nil
}
/**
Replace all pattern matches with another string
:param: pattern Pattern to match
:param: replacementString string to replace matches
:param: ignoreCase true for case insensitive matching
:returns: true if contains match, otherwise false
*/
func replaceMatches (pattern: String, withString replacementString: String, ignoreCase: Bool = false) -> String? {
if let regex = ExSwift.regex(pattern, ignoreCase: ignoreCase) {
let range = NSMakeRange(0, count(self))
return regex.stringByReplacingMatchesInString(self, options: .allZeros, range: range, withTemplate: replacementString)
}
return nil
}
/**
Inserts a substring at the given index in self.
:param: index Where the new string is inserted
:param: string String to insert
:returns: String formed from self inserting string at index
*/
func insert (var index: Int, _ string: String) -> String {
// Edge cases, prepend and append
if index > length {
return self + string
} else if index < 0 {
return string + self
}
return self[0..<index]! + string + self[index..<length]!
}
/**
Strips the specified characters from the beginning of self.
:returns: Stripped string
*/
func trimmedLeft (characterSet set: NSCharacterSet = NSCharacterSet.whitespaceAndNewlineCharacterSet()) -> String {
if let range = rangeOfCharacterFromSet(set.invertedSet) {
return self[range.startIndex..<endIndex]
}
return ""
}
@availability(*, unavailable, message="use 'trimmedLeft' instead") func ltrimmed (set: NSCharacterSet = NSCharacterSet.whitespaceAndNewlineCharacterSet()) -> String {
return trimmedLeft(characterSet: set)
}
/**
Strips the specified characters from the end of self.
:returns: Stripped string
*/
func trimmedRight (characterSet set: NSCharacterSet = NSCharacterSet.whitespaceAndNewlineCharacterSet()) -> String {
if let range = rangeOfCharacterFromSet(set.invertedSet, options: NSStringCompareOptions.BackwardsSearch) {
return self[startIndex..<range.endIndex]
}
return ""
}
@availability(*, unavailable, message="use 'trimmedRight' instead") func rtrimmed (set: NSCharacterSet = NSCharacterSet.whitespaceAndNewlineCharacterSet()) -> String {
return trimmedRight(characterSet: set)
}
/**
Strips whitespaces from both the beginning and the end of self.
:returns: Stripped string
*/
func trimmed () -> String {
return trimmedLeft().trimmedRight()
}
/**
Costructs a string using random chars from a given set.
:param: length String length. If < 1, it's randomly selected in the range 0..16
:param: charset Chars to use in the random string
:returns: Random string
*/
static func random (var length len: Int = 0, charset: String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") -> String {
if len < 1 {
len = Int.random(max: 16)
}
var result = String()
let max = charset.length - 1
len.times {
result += charset[Int.random(min: 0, max: max)]!
}
return result
}
/**
Parses a string containing a double numerical value into an optional double if the string is a well formed number.
:returns: A double parsed from the string or nil if it cannot be parsed.
*/
func toDouble() -> Double? {
let scanner = NSScanner(string: self)
var double: Double = 0
if scanner.scanDouble(&double) {
return double
}
return nil
}
/**
Parses a string containing a float numerical value into an optional float if the string is a well formed number.
:returns: A float parsed from the string or nil if it cannot be parsed.
*/
func toFloat() -> Float? {
let scanner = NSScanner(string: self)
var float: Float = 0
if scanner.scanFloat(&float) {
return float
}
return nil
}
/**
Parses a string containing a non-negative integer value into an optional UInt if the string is a well formed number.
:returns: A UInt parsed from the string or nil if it cannot be parsed.
*/
func toUInt() -> UInt? {
if let val = self.trimmed().toInt() {
if val < 0 {
return nil
}
return UInt(val)
}
return nil
}
/**
Parses a string containing a boolean value (true or false) into an optional Bool if the string is a well formed.
:returns: A Bool parsed from the string or nil if it cannot be parsed as a boolean.
*/
func toBool() -> Bool? {
let text = self.trimmed().lowercaseString
if text == "true" || text == "false" || text == "yes" || text == "no" {
return (text as NSString).boolValue
}
return nil
}
/**
Parses a string containing a date into an optional NSDate if the string is a well formed.
The default format is yyyy-MM-dd, but can be overriden.
:returns: A NSDate parsed from the string or nil if it cannot be parsed as a date.
*/
func toDate(format : String? = "yyyy-MM-dd") -> NSDate? {
let text = self.trimmed().lowercaseString
var dateFmt = NSDateFormatter()
dateFmt.timeZone = NSTimeZone.defaultTimeZone()
if let fmt = format {
dateFmt.dateFormat = fmt
}
return dateFmt.dateFromString(text)
}
/**
Parses a string containing a date and time into an optional NSDate if the string is a well formed.
The default format is yyyy-MM-dd hh-mm-ss, but can be overriden.
:returns: A NSDate parsed from the string or nil if it cannot be parsed as a date.
*/
func toDateTime(format : String? = "yyyy-MM-dd hh-mm-ss") -> NSDate? {
return toDate(format: format)
}
}
/**
Repeats the string first n times
*/
public func * (first: String, n: Int) -> String {
var result = String()
n.times {
result += first
}
return result
}
// Pattern matching using a regular expression
public func =~ (string: String, pattern: String) -> Bool {
let regex = ExSwift.regex(pattern, ignoreCase: false)!
let matches = regex.numberOfMatchesInString(string, options: nil, range: NSMakeRange(0, string.length))
return matches > 0
}
// Pattern matching using a regular expression
public func =~ (string: String, regex: NSRegularExpression) -> Bool {
let matches = regex.numberOfMatchesInString(string, options: nil, range: NSMakeRange(0, string.length))
return matches > 0
}
// This version also allowes to specify case sentitivity
public func =~ (string: String, options: (pattern: String, ignoreCase: Bool)) -> Bool {
if let matches = ExSwift.regex(options.pattern, ignoreCase: options.ignoreCase)?.numberOfMatchesInString(string, options: nil, range: NSMakeRange(0, string.length)) {
return matches > 0
}
return false
}
// Match against all the alements in an array of String
public func =~ (strings: [String], pattern: String) -> Bool {
let regex = ExSwift.regex(pattern, ignoreCase: false)!
return strings.all { $0 =~ regex }
}
public func =~ (strings: [String], options: (pattern: String, ignoreCase: Bool)) -> Bool {
return strings.all { $0 =~ options }
}
// Match against any element in an array of String
public func |~ (strings: [String], pattern: String) -> Bool {
let regex = ExSwift.regex(pattern, ignoreCase: false)!
return strings.any { $0 =~ regex }
}
public func |~ (strings: [String], options: (pattern: String, ignoreCase: Bool)) -> Bool {
return strings.any { $0 =~ options }
}

153
kplayer/master/MasterViewController.swift

@ -25,7 +25,8 @@ class MasterViewController: UITableViewController {
}
func addItem(item: MediaItem) {
let path = item.root + item.path
let path = item.rootSlash + item.path
print(path)
var folder = itemsMap[path]
if folder == nil {
@ -34,7 +35,7 @@ class MasterViewController: UITableViewController {
items.append(folder!)
}
item.index = count(folder!.children)
item.index = folder!.children.count
folder!.children.append(item)
item.parent = folder
}
@ -58,45 +59,29 @@ class MasterViewController: UITableViewController {
// let addButton = UIBarButtonItem(barButtonSystemItem: .Add, target: self, action: "insertNewObject:")
// self.navigationItem.rightBarButtonItem = addButton
if let split = self.splitViewController {
let controllers = split.viewControllers
self.detailViewController = controllers[controllers.count - 1].topViewController as? DetailViewController
self.detailViewController = split.findChildController(DetailViewController.self)
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
println("Memory Warning")
print("Memory Warning")
// Dispose of any resources that can be recreated.
}
override func tableView(tableView: UITableView, accessoryButtonTappedForRowWithIndexPath indexPath: NSIndexPath) {
let pc = MediaPhotoController()
var i = [MediaItem]()
for it in items[indexPath.row].children {
for c in it.children {
i.append(c)
}
}
pc.items = i
pc.completionHandler = {
self.dismissViewControllerAnimated(true, completion: nil);
}
let navController = UINavigationController(rootViewController: pc) // Creating a navigation controller with pc at the root of the navigation stack.
presentViewController(navController, animated: false, completion: nil)
}
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
println("\(indexPath.row)")
print("\(indexPath.row)")
let selectedItem = items[indexPath.row]
if (selectedItem.type == ItemType.DETAILS) {
performSegueWithIdentifier("showDetail", sender: self)
return
}
if (selectedItem.type == ItemType.FOLDER) {
if (!selectedItem.children.isEmpty) {
if selectedItem.children[0].type != ItemType.FOLDER {
if selectedItem.children[0].type == ItemType.VIDEO {
performSegueWithIdentifier("showDetail", sender: self)
return
}
@ -104,14 +89,13 @@ class MasterViewController: UITableViewController {
}
let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
// Imagine it's called MyCustomTableVC
let vc = mainStoryboard.instantiateViewControllerWithIdentifier("mastertable") as! MasterViewController
if (selectedItem.type == ItemType.FOLDER) {
vc.navigationItem.title = selectedItem.name;
if !selectedItem.loaded {
let dir = selectedItem.root + "/" + selectedItem.path
let dir = selectedItem.encodedDir!
let weiter: NetworkManager.Weiter = {
(g) in
@ -124,13 +108,14 @@ class MasterViewController: UITableViewController {
var all: [MediaItem]?
for f in selectedItem.children {
print(f.path)
if f.type == ItemType.FOLDER && f.path != "" {
self.navigationController!.pushViewController(vc, animated: true)
return
}
if f.type == ItemType.FOLDER && f.path == "" {
all = f.children
break
// break
}
}
@ -150,43 +135,114 @@ class MasterViewController: UITableViewController {
let p = selectedItem.parent!
if p.type == ItemType.VIDEOROOT {
NetworkManager.sharedInstance.loadDirs(dir, completionHandler: weiter)
// NetworkManager.sharedInstance.loadDirs(dir, completionHandler: weiter)
}
else {
NetworkManager.sharedInstance.loadPicDirs(dir, completionHandler: weiter)
else if p.type == ItemType.DETAILS {
// NetworkManager.sharedInstance.loadPicDirs(dir, completionHandler: weiter)
}
else if p.type == ItemType.FOLDER {
}
} else {
vc.items = selectedItem.children
navigationController!.pushViewController(vc, animated: true)
return
}
}
if (selectedItem.type == ItemType.ROOT) || (selectedItem.type == ItemType.VIDEOROOT) {
NetworkManager.sharedInstance.listDirs(selectedItem.root, completionHandler: {
(i) in
if (selectedItem.type == ItemType.ROOT) || (selectedItem.type == ItemType.VIDEOROOT) || (selectedItem.type == ItemType.FOLDER) {
print (selectedItem.path)
NetworkManager.sharedInstance.listDirs(selectedItem.encodedDir!, completionHandler: {
(i, leaf) in
let newFolder = MediaItem(name: ".", path: selectedItem.path, root: selectedItem.root, type: ItemType.FOLDER)
for item in i {
if item.type != ItemType.FOLDER {
item.parent = newFolder
newFolder.children.append(item)
}
item.parent = selectedItem
selectedItem.children.append(item)
}
if newFolder.children.count > 0 {
newFolder.parent = selectedItem
selectedItem.children.append(newFolder)
}
if leaf {
selectedItem.type = ItemType.DETAILS
let weiter: NetworkManager.Weiter = {
(g) in
vc.items.removeAll()
vc.itemsMap.removeAll()
for f in g {
vc.addItem(f)
}
selectedItem.children = vc.items
selectedItem.loaded = true
var all: [MediaItem]?
for f in selectedItem.children {
print(f.path)
if f.type == ItemType.FOLDER && f.path == "" {
all = f.children
break
}
}
if all != nil {
selectedItem.children = all!
selectedItem.loaded = false
for f in all! {
f.loaded = false
f.parent = selectedItem
}
}
self.performSegueWithIdentifier("showDetail", sender: self)
return
}
let p = selectedItem.superRoot()
let dir = selectedItem.encodedDir!
if p.type == ItemType.VIDEOROOT {
NetworkManager.sharedInstance.loadDirs(dir, completionHandler: weiter)
}
else {
NetworkManager.sharedInstance.loadPicDirs(dir, completionHandler: weiter)
}
// self.performSegueWithIdentifier("showDetail", sender: self)
return
}
vc.items = i
vc.tableView.reloadData()
vc.navigationItem.title = selectedItem.name;
self.navigationController!.pushViewController(vc, animated: true)
})
vc.navigationItem.title = selectedItem.name;
navigationController!.pushViewController(vc, animated: true)
}
}
override func shouldPerformSegueWithIdentifier(identifier: String!, sender: AnyObject?) -> Bool {
override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool {
return false;
}
// MARK: - Segues
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showDetail" {
if let indexPath = self.tableView.indexPathForSelectedRow() {
if let indexPath = self.tableView.indexPathForSelectedRow {
let item = items[indexPath.row]
let controller = (segue.destinationViewController as! UINavigationController).topViewController as! DetailViewController
controller.detailItem = item
@ -201,7 +257,7 @@ class MasterViewController: UITableViewController {
controller.defaultItemSize = CGSize(width: 300, height: 300)
}
item.children.sort({
item.children.sortInPlace({
$0.sortName < $1.sortName
})
@ -210,8 +266,6 @@ class MasterViewController: UITableViewController {
i.index = j++
}
// controller.collectionView.reloadData()
NetworkManager.sharedInstance.loadItems(item)
controller.navigationItem.leftBarButtonItem = self.splitViewController?.displayModeButtonItem()
controller.navigationItem.leftItemsSupplementBackButton = true
@ -226,11 +280,11 @@ class MasterViewController: UITableViewController {
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return count(items)
return items.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! UITableViewCell
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)
self.configureCell(cell, atIndexPath: indexPath)
@ -249,19 +303,14 @@ class MasterViewController: UITableViewController {
func configureCell(cell: UITableViewCell, atIndexPath indexPath: NSIndexPath) {
let object = items[indexPath.row]
if (object.path.length == 0) {
cell.textLabel!.text = "."
if (object.path.characters.count == 0) {
cell.textLabel!.text = "." + object.name
}
else {
cell.textLabel!.text = object.path
}
// if !object.children.isEmpty && object.children[0].type == ItemType.VIDEO {
// cell.accessoryType = UITableViewCellAccessoryType.DetailDisclosureButton
// }
// else {
cell.accessoryType = UITableViewCellAccessoryType.None
// }
}

144
kplayer/photo/MediaPhotoController.swift

@ -18,6 +18,10 @@ class MediaPhotoController: NIToolbarPhotoViewController, NIPhotoAlbumScrollView
var imageCache = NSCache()
var total = 0
var slide = 0
var timer: NSTimer?
lazy var backgroundOperationQueue: NSOperationQueue = {
var queue = NSOperationQueue()
queue.name = "Thumb queue"
@ -42,7 +46,8 @@ class MediaPhotoController: NIToolbarPhotoViewController, NIPhotoAlbumScrollView
imageCache.totalCostLimit = 1024 * 1024 * 50
let backButton = UIBarButtonItem(barButtonSystemItem: .Cancel, target: self, action: Selector("back"))
navigationItem.leftBarButtonItems = [backButton]
let slideButton = UIBarButtonItem(barButtonSystemItem: .FastForward, target: self, action: Selector("slideShow"))
navigationItem.leftBarButtonItems = [backButton, slideButton]
let playButton = UIBarButtonItem(barButtonSystemItem: .Play, target: self, action: Selector("play"))
let shotButton = UIBarButtonItem(barButtonSystemItem: .Camera, target: self, action: Selector("shot"))
@ -72,22 +77,21 @@ class MediaPhotoController: NIToolbarPhotoViewController, NIPhotoAlbumScrollView
let bytesPerPixel = CGImageGetBitsPerPixel(imageRef) / 8;
let cost = CGImageGetWidth(imageRef) * CGImageGetHeight(imageRef) * bytesPerPixel;
self.total += d.length
println("preload image loaded \(i.thumbUrlAbsolute) cost \(cost) total\(self.total)")
print("preload image loaded \(i.thumbUrlAbsolute) cost \(cost) total\(self.total)")
self.imageCache.setObject(img, forKey: i.thumbUrlAbsolute, cost: d.length)
}
}
}, index: j)
op1.qualityOfService = NSQualityOfService.Background
backgroundOperationQueue.addOperation(op1)
}
else {
println("## Invalid URL: \(i.thumbUrlAbsolute)")
} else {
print("## Invalid URL: \(i.thumbUrlAbsolute)")
}
}
}
override func didReceiveMemoryWarning() {
println("warning")
print("warning")
imageCache.removeAllObjects()
super.didReceiveMemoryWarning()
@ -100,10 +104,10 @@ class MediaPhotoController: NIToolbarPhotoViewController, NIPhotoAlbumScrollView
imageUrl = imageUrl.stringByReplacingOccurrencesOfString("?preview=true", withString: "")
let url = NetworkManager.sharedInstance.baseurl + "/service/linkfavpic" + imageUrl
println(url)
print(url)
Alamofire.request(.GET, url).responseString {
(_, _, string, _) in
println("ok")
(_, _, string) in
print("ok")
}
}
@ -111,69 +115,96 @@ class MediaPhotoController: NIToolbarPhotoViewController, NIPhotoAlbumScrollView
completionHandler!()
}
func slideShow() {
if (++slide > 2) {
slide = 0
}
if timer == nil {
showItem()
}
}
func showItem() {
var nextItem = photoAlbumView.centerPageIndex + 1
if (nextItem >= (items).count) {
nextItem = 0
}
photoAlbumView.moveToPageAtIndex(nextItem, animated: false);
photoScrubberView.setSelectedPhotoIndex(nextItem, animated: true)
if (slide > 0) {
timer = NSTimer.scheduledTimerWithTimeInterval(Double(slide) / 2.0, target: self, selector: Selector("showItem"), userInfo: nil, repeats: false)
} else {
timer = nil
}
}
func play() {
let currentItem = items[photoAlbumView.centerPageIndex]
if (currentItem.type == ItemType.PICS) {
let items = currentItem
let len = count(items.root)
let len = items.root.characters.count
let url = NetworkManager.sharedInstance.baseurl + "/service/listfiles" + items.root + "/" + items.path + "/" + items.name
println(items)
println(url)
print(items)
print(url)
Alamofire.request(.GET, url).responseSwiftyJSON({
(request, response, json, error) in
Alamofire.request(.GET, url).responseJSON {
(request, response, result) in
var im = [MediaItem]()
var hashes = Dictionary<String, String>()
for (a, c) in json {
// let (a,b) = j #
let s = c.object as! NSString
if let json = result.value {
if s.hasSuffix(".jpg") {
let l = s.length
let name = (s as NSString).lastPathComponent
var pathlen = l - len - count(name)
for s in json as! [String] {
if s.hasSuffix(".jpg") {
let l = s.length
let name = NSURL(fileURLWithPath: s as! String).lastPathComponent!
var pathlen = l - len - name.length
// if (pathlen > 1000) {
println(pathlen)
println(name)
println(s)
print(pathlen)
print(name)
print(s)
// }
if (pathlen < 2) {
pathlen = 2
}
if (pathlen < 2) {
pathlen = 2
}
let path = (s as NSString).substringWithRange(NSMakeRange(len + 1, pathlen - 2))
let path = (s as NSString).substringWithRange(NSMakeRange(len + 1, pathlen - 2))
let folderName = path.lastPathComponent
let fl = count(path)
let pfl = fl - count(folderName)
let folderName = NSURL(fileURLWithPath: path).lastPathComponent!
let fl = path.length
let pfl = fl - folderName.length
println("\(folderName) \(pfl)")
let fpath = (s as NSString).substringWithRange(NSMakeRange(0, pfl))
print("\(folderName) \(pfl)")
let fpath = (s as NSString).substringWithRange(NSMakeRange(0, pfl))
let i = MediaItem(name: folderName, path: fpath, root: items.root, type: ItemType.PICS)
i.thumbUrl = "\(s)?preview=true"
if !name.hasPrefix(".") {
im.append(i)
let i = MediaItem(name: folderName, path: fpath, root: items.root, type: ItemType.PICS)
i.thumbUrl = "\(s)?preview=true"
if !name.hasPrefix(".") {
im.append(i)
}
}
}
}
let pc = MediaPhotoController()
let pc = MediaPhotoController()
pc.items = im
pc.completionHandler = {
self.dismissViewControllerAnimated(true, completion: nil);
}
let navController = UINavigationController(rootViewController: pc) // Creating a navigation controller with pc at the root of the navigation stack.
pc.items = im
pc.completionHandler = {
self.dismissViewControllerAnimated(true, completion: nil);
}
let navController = UINavigationController(rootViewController: pc) // Creating a navigation controller with pc at the root of the navigation stack.
self.presentViewController(navController, animated: false, completion: nil)
})
self.presentViewController(navController, animated: false, completion: nil)
}
}
return
}
@ -215,12 +246,12 @@ class MediaPhotoController: NIToolbarPhotoViewController, NIPhotoAlbumScrollView
self.title = "loading"
// self.photoAlbumView.loadingImage = UIImage(named: "Kirschkeks-256x256.png")
println("\(count(items))")
print("\(items.count)")
}
func photoAlbumScrollView(photoAlbumScrollView: NIPhotoAlbumScrollView!, photoAtIndex: Int, photoSize: UnsafeMutablePointer<NIPhotoScrollViewPhotoSize>,
isLoading: UnsafeMutablePointer<ObjCBool>, originalPhotoDimensions: UnsafeMutablePointer<CGSize>) -> UIImage! {
let c = count(items)
let c = items.count
// println("Index: \(photoAtIndex) of \(c)")
let newItem = items[photoAtIndex]
let u1 = NSURL(string: newItem.imageUrlAbsolute)
@ -243,11 +274,11 @@ class MediaPhotoController: NIToolbarPhotoViewController, NIPhotoAlbumScrollView
if !ok {
r.cancel()
requests.remove(r)
requests.removeAtIndex(requests.indexOf(r)!)
}
}
image = imageCache.objectForKey(URL.absoluteString!) as? UIImage
image = imageCache.objectForKey(URL.absoluteString) as? UIImage
if let i = image {
size = NIPhotoScrollViewPhotoSizeThumbnail
@ -295,14 +326,14 @@ class MediaPhotoController: NIToolbarPhotoViewController, NIPhotoAlbumScrollView
return image
} else {
println("## Invalid URL: \(newItem.imageUrlAbsolute)")
print("## Invalid URL: \(newItem.imageUrlAbsolute)")
return nil
}
}
func numberOfPagesInPagingScrollView(pagingScrollView: NIPagingScrollView) -> Int {
let c = count(items)
let c = items.count
return c
}
@ -322,7 +353,7 @@ class MediaPhotoController: NIToolbarPhotoViewController, NIPhotoAlbumScrollView
}
func numberOfPhotosInScrubberView(photoScrubberView: NIPhotoScrubberView!) -> Int {
let c = count(items)
let c = items.count
return c
}
@ -336,7 +367,7 @@ class MediaPhotoController: NIToolbarPhotoViewController, NIPhotoAlbumScrollView
return nil
}
let c = count(items)
let c = items.count
let newItem = items[thumbnailIndex]
var image: UIImage?
@ -364,9 +395,8 @@ class MediaPhotoController: NIToolbarPhotoViewController, NIPhotoAlbumScrollView
}, index: thumbnailIndex)
op3.qualityOfService = NSQualityOfService.UserInitiated
operationQueue.addOperation(op3)
}
else {
println("## Invalid URL: \(newItem.thumbUrlAbsolute)")
} else {
print("## Invalid URL: \(newItem.thumbUrlAbsolute)")
}
}

19
kplayer/util/ImageLoadOperation.swift

@ -8,7 +8,7 @@ import Alamofire
import Darwin
class ImageLoadOperation: NSOperation {
public typealias Succeeder = (UIImage) -> ()
internal typealias Succeeder = (UIImage) -> ()
let imageURL: NSURL
let succeeder: Succeeder
@ -39,17 +39,12 @@ class ImageLoadOperation: NSOperation {
request = Alamofire.request(.GET, imageURL)
}
request!.validate().responseImage() {
(request, _, image, error) in
if error == nil {
self.ready1 = true
// if request.URLString.isEqual(self.imageURL) {
// dispatch_async(dispatch_get_main_queue()) {
self.succeeder(image!)
// }
// }
request!.validate().response { (request, response, data, error) in
if let e = error {
print(e)
}
else if let d = data {
self.succeeder(UIImage(data: d, scale: 1)!)
}
}

14
kplayer/util/LayoutTools.swift

@ -18,7 +18,7 @@ public extension UIView {
for value in views.values {
let vv: UIView = value
addSubview(vv)
vv.setTranslatesAutoresizingMaskIntoConstraints(false)
vv.translatesAutoresizingMaskIntoConstraints = false
}
while index < constraints.count {
@ -30,11 +30,11 @@ public extension UIView {
options: constraints[index] as! NSLayoutFormatOptions,
metrics: nil,
views: views)
addConstraints(constr as [AnyObject])
addConstraints(constr as! [NSLayoutConstraint])
} else {
let constr: NSArray = NSLayoutConstraint.constraintsWithVisualFormat(c as! String,
options: NSLayoutFormatOptions(0), metrics: nil, views: views)
addConstraints(constr as [AnyObject])
options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: views)
addConstraints(constr as! [NSLayoutConstraint])
}
}
index++
@ -43,9 +43,9 @@ public extension UIView {
func recursiveSearchForViewWithName(classname: String) -> UIView? {
for v in subviews {
let sv = v as! UIView
var result = sv.recursiveSearchForViewWithName(classname)
let cn = toString(v.dynamicType)
let sv = v
let result = sv.recursiveSearchForViewWithName(classname)
let cn = String(v.dynamicType)
if cn == classname {
return v as? UIView

4
kplayer/util/NetData.swift

@ -42,12 +42,12 @@ class NetData
self.filename = filename
}
init(pngImage: UIImage, filename: String) {
data = UIImagePNGRepresentation(pngImage)
data = UIImagePNGRepresentation(pngImage)!
self.mimeType = MimeType.ImagePng
self.filename = filename
}
init(jpegImage: UIImage, compressionQuanlity: CGFloat, filename: String) {
data = UIImageJPEGRepresentation(jpegImage, compressionQuanlity)
data = UIImageJPEGRepresentation(jpegImage, compressionQuanlity)!
self.mimeType = MimeType.ImageJpeg
self.filename = filename
}

4
kplayer/util/UploadOperation.swift

@ -28,8 +28,8 @@ class UploadOperation: NSOperation {
"name": path
]
let urlRequest = urlRequestWithComponents(baseUrl, parameters)
let request = Alamofire.upload(urlRequest)
let urlRequest = urlRequestWithComponents(baseUrl, parameters: parameters)
// let request = Alamofire.upload(urlRequest)
// success: todo set url to item

67
kplayer/util/ViewControllerExtensions.swift

@ -0,0 +1,67 @@
//
// Created by Marco Schmickler on 25.01.15.
// Copyright (c) 2015 Marco Schmickler. All rights reserved.
//
import Foundation
import UIKit
public extension UIView {
func removeAllSubViews() {
for subView: UIView in subviews {
subView.removeFromSuperview();
}
}
}
public extension UIViewController {
func findControllerInHierachy<T where T:UIViewController>(_: T.Type) -> T? {
var currentVC = self
while let parentVC = currentVC.parentViewController {
print("comparing \(parentVC) to \(T.description())")
if let result = parentVC as? T {
// (XXX)
return result
}
currentVC = parentVC
}
return nil
}
func findChildController<T>(my: T.Type) -> T? {
for child in childViewControllers {
if let result = child as? T {
// (XXX)
return result
}
if let childControl = child as? UIViewController {
if let found = childControl.findChildController(my) {
return found;
}
}
}
return nil
}
func removeAllConstraints(otherView: UIView) {
var cons = [NSLayoutConstraint]()
for con:NSLayoutConstraint in self.view.constraints {
if (con.firstItem as? UIView == otherView || con.secondItem as? UIView == otherView) {
cons.append(con)
}
}
view.removeConstraints(cons)
otherView.removeConstraints(otherView.constraints);
otherView.translatesAutoresizingMaskIntoConstraints = true;
}
func embedChildViewController(vc: UIViewController, inView: UIView) {
vc.view.frame = inView.bounds;
addChildViewController(vc);
inView.removeAllSubViews();
inView.addSubview(vc.view);
}
}

38
kplayer/util/alamoimage.swift

@ -7,24 +7,26 @@ import Foundation
import Alamofire
extension Alamofire.Request {
class func imageResponseSerializer() -> Serializer {
return { request, response, data in
if data == nil || data!.length == 0 {
return (nil, nil)
}
if let i = UIImage(data: data!) {
// let image = i.hnk_decompressedImage()
return (i, nil)
}
return (nil, nil)
}
}
func responseImage(completionHandler: (NSURLRequest, NSHTTPURLResponse?, UIImage?, NSError?) -> Void) -> Self {
return response(serializer: Request.imageResponseSerializer(), completionHandler: { (request, response, image, error) in
completionHandler(request, response, image as? UIImage, error)
})
}
// class func imageResponseSerializer() -> Serializer {
// return { request, response, data in
// if data == nil || data!.length == 0 {
// return (nil, nil)
// }
//
// if let i = UIImage(data: data!) {
//// let image = i.hnk_decompressedImage()
//
// return (i, nil)
// }
// return (nil, nil)
// }
// }
//
// func responseImage(completionHandler: (NSURLRequest, NSHTTPURLResponse?, UIImage?, NSError?) -> Void) -> Self {
// return response(serializer: Request.imageResponseSerializer(), completionHandler: { (request, response, image, error) in
// completionHandler(request, response, image as? UIImage, error)
// })
// }
}

48
kplayer/util/alamojson.swift

@ -1,48 +0,0 @@
//
// AlamofireSwiftyJSON.swift
// AlamofireSwiftyJSON
//
// Created by Pinglin Tang on 14-9-22.
// Copyright (c) 2014 SwiftyJSON. All rights reserved.
//
import Foundation
import Alamofire
import SwiftyJSON
// MARK: - Request for Swift JSON
extension Request {
/**
Adds a handler to be called once the request has finished.
:param: completionHandler A closure to be executed once the request has finished. The closure takes 4 arguments: the URL request, the URL response, if one was received, the SwiftyJSON enum, if one could be created from the URL response and data, and any error produced while creating the SwiftyJSON enum.
:returns: The request.
*/
public func responseSwiftyJSON(completionHandler: (NSURLRequest, NSHTTPURLResponse?, SwiftyJSON.JSON, NSError?) -> Void) -> Self {
return responseSwiftyJSON(queue: nil, options: NSJSONReadingOptions.AllowFragments, completionHandler: completionHandler)
}
/**
Adds a handler to be called once the request has finished.
:param: queue The queue on which the completion handler is dispatched.
:param: options The JSON serialization reading options. `.AllowFragments` by default.
:param: completionHandler A closure to be executed once the request has finished. The closure takes 4 arguments: the URL request, the URL response, if one was received, the SwiftyJSON enum, if one could be created from the URL response and data, and any error produced while creating the SwiftyJSON enum.
:returns: The request.
*/
public func responseSwiftyJSON(queue: dispatch_queue_t? = nil, options: NSJSONReadingOptions = .AllowFragments, completionHandler: (NSURLRequest, NSHTTPURLResponse?, JSON, NSError?) -> Void) -> Self {
return response(queue: queue, serializer: Request.JSONResponseSerializer(options: options), completionHandler: {
(request, response, object, error) -> Void in
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), {
var responseJSON: JSON
if error != nil || object == nil {
responseJSON = JSON.nullJSON
} else {
responseJSON = SwiftyJSON.JSON(object!)
}
dispatch_async(queue ?? dispatch_get_main_queue(), {
completionHandler(self.request, self.response, responseJSON, error)
})
})
})
}
}

16
kplayer/util/stringutil.swift

@ -0,0 +1,16 @@
//
// Created by Marco Schmickler on 15.07.15.
// Copyright (c) 2015 Marco Schmickler. All rights reserved.
//
import Foundation
public extension String {
func beginsWith (str: String) -> Bool {
return hasPrefix(str)
}
func endsWith (str: String) -> Bool {
return hasSuffix(str)
}
}

2
kplayerTests/Info.plist

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>schmickler.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

9
kplayerTests/kplayerTests.swift

@ -21,9 +21,14 @@ class kplayerTests: XCTestCase {
super.tearDown()
}
func testExample() {
func testMyExample() {
// http://linkstation.local/tomcat/media/service/listpicdirs/srv/samba/ren/series/sg
print("hello")
let i = 12
// This is an example of a functional test case.
XCTAssert(true, "Pass")
XCTAssert(i == 1, "Pass")
}
func testPerformanceExample() {

Loading…
Cancel
Save