Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Commit

Permalink
Remove Parse
Browse files Browse the repository at this point in the history
  • Loading branch information
danylokos committed Feb 25, 2016
1 parent 362a5f5 commit baa6abd
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 275 deletions.
5 changes: 0 additions & 5 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ pod 'Reachability'
pod 'CocoaSecurity'
pod 'SDWebImage'

pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'ParseFacebookUtilsV4'
pod 'ParseUI'

pod 'Crashlytics'
pod 'Fabric'

Expand Down
31 changes: 0 additions & 31 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
PODS:
- Bolts (1.6.0):
- Bolts/AppLinks (= 1.6.0)
- Bolts/Tasks (= 1.6.0)
- Bolts/AppLinks (1.6.0):
- Bolts/Tasks
- Bolts/Tasks (1.6.0)
- CocoaSecurity (1.2.4)
- Crashlytics (3.7.0):
- Fabric (~> 1.6.3)
- Fabric (1.6.6)
- FBSDKCoreKit (4.10.0):
- Bolts (~> 1.5)
- FBSDKLoginKit (4.10.0):
- FBSDKCoreKit
- Parse (1.12.0):
- Bolts/Tasks (~> 1.5)
- ParseFacebookUtilsV4 (1.11.1):
- Bolts/Tasks (>= 1.6)
- FBSDKCoreKit (~> 4.10)
- FBSDKLoginKit (~> 4.10)
- FBSDKTVOSKit (~> 4.10)
- Parse (~> 1.12)
- ParseUI (1.2.0):
- Bolts/Tasks (~> 1.3)
- Parse (~> 1.9)
- private-boost (1.58.0)
- private-libtorrent (1.0.6)
- private-MobileVLCKit (2.5.150604)
Expand All @@ -37,10 +16,6 @@ DEPENDENCIES:
- CocoaSecurity
- Crashlytics
- Fabric
- FBSDKCoreKit
- FBSDKLoginKit
- ParseFacebookUtilsV4
- ParseUI
- private-boost
- private-libtorrent
- private-MobileVLCKit
Expand All @@ -49,15 +24,9 @@ DEPENDENCIES:
- SDWebImage

SPEC CHECKSUMS:
Bolts: f52a250053bb517ca874523c3913776359ab3def
CocoaSecurity: d288a6f87e0f363823d2cb83e753814a6944f71a
Crashlytics: c3a2333dea9e2733d2777f730910321fc9e25c0d
Fabric: 1abc1e59f11fa39ede6f690ef7309d8563e3ec59
FBSDKCoreKit: 13bec8373fb3af94d44daf2aa1e0958687897fbd
FBSDKLoginKit: d3d4a2e9d31954deb00bfea964167a05ca1ea976
Parse: de2c52a9a1421b91ae7594ab8ce191afd184f19b
ParseFacebookUtilsV4: 2f30c2b7021c8005d3042781da7ef87d06589421
ParseUI: af2eba584799da4a9fbdac0e178662d7438b502e
private-boost: 390bdadecb82f24bcec47068f4b041acc757d575
private-libtorrent: 9f0d4c5e1b3842e3baf5493b66cadb684bb07afd
private-MobileVLCKit: 9f36464901370c0dd54e2fa2fe34b44effc18cb3
Expand Down
8 changes: 0 additions & 8 deletions PopcornTime.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@
4348D3101B38166300028043 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4348D30F1B38166300028043 /* StoreKit.framework */; };
4348D3121B38166F00028043 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4348D3111B38166F00028043 /* SystemConfiguration.framework */; };
4348D3141B38168800028043 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4348D3131B38168800028043 /* libsqlite3.dylib */; };
4348D3161B38176800028043 /* ParseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4348D3151B38176800028043 /* ParseViewController.swift */; };
4348D3181B38179100028043 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4348D3171B38179100028043 /* libz.dylib */; };
4348D31D1B3817D800028043 /* Accounts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4348D3191B3817A400028043 /* Accounts.framework */; };
4348D31E1B3817DF00028043 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4348D31B1B3817AB00028043 /* Social.framework */; };
4354B8EF1B396EBF00C42A5A /* ParseManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4354B8EE1B396EBF00C42A5A /* ParseManager.swift */; };
65ADB189759E25BAEE4DD696 /* libPods-PopcornTime.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E136A40A06A3FB238998C59 /* libPods-PopcornTime.a */; };
773399A41AF7E43A008DF31A /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 773399A31AF7E43A008DF31A /* Launch Screen.xib */; };
773399A61AF7E4C8008DF31A /* FavoritesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 773399A51AF7E4C8008DF31A /* FavoritesViewController.swift */; };
Expand Down Expand Up @@ -100,11 +98,9 @@
4348D30F1B38166300028043 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
4348D3111B38166F00028043 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
4348D3131B38168800028043 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; };
4348D3151B38176800028043 /* ParseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ParseViewController.swift; path = Controllers/ParseViewController.swift; sourceTree = "<group>"; };
4348D3171B38179100028043 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
4348D3191B3817A400028043 /* Accounts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accounts.framework; path = System/Library/Frameworks/Accounts.framework; sourceTree = SDKROOT; };
4348D31B1B3817AB00028043 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
4354B8EE1B396EBF00C42A5A /* ParseManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParseManager.swift; sourceTree = "<group>"; };
5892EA13CDF70C028E9A7CB2 /* Pods-PopcornTime.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PopcornTime.release.xcconfig"; path = "Pods/Target Support Files/Pods-PopcornTime/Pods-PopcornTime.release.xcconfig"; sourceTree = "<group>"; };
5E136A40A06A3FB238998C59 /* libPods-PopcornTime.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PopcornTime.a"; sourceTree = BUILT_PRODUCTS_DIR; };
60E49EA58E27726D5CF6EA80 /* Pods-PopcornTime.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PopcornTime.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PopcornTime/Pods-PopcornTime.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -224,7 +220,6 @@
7F4992B71A24928200D8D36E /* Models */ = {
isa = PBXGroup;
children = (
4354B8EE1B396EBF00C42A5A /* ParseManager.swift */,
7F083C651AB36D84001C938B /* AppDelegate.swift */,
7F8D1A681A9D460000C236BC /* PTAPIManager.h */,
7F8D1A691A9D460000C236BC /* PTAPIManager.m */,
Expand Down Expand Up @@ -291,7 +286,6 @@
7F8D1A6C1A9DB78100C236BC /* Controllers */ = {
isa = PBXGroup;
children = (
4348D3151B38176800028043 /* ParseViewController.swift */,
7FD7629E1AB632E300BD462C /* OAuthViewController.swift */,
7FD7629C1AB632E300BD462C /* LoadingViewController.swift */,
0C4F84C61AB32D3A00779B1A /* BarHidingViewController.swift */,
Expand Down Expand Up @@ -507,7 +501,6 @@
7F8B3EB31ABDC55500BE192D /* Image.swift in Sources */,
7F0420561ABDD3A100E27FA1 /* BaseDetailsViewController.swift in Sources */,
7FD9B3631A9A89E400DB89B7 /* PTTorrentStreamer.mm in Sources */,
4348D3161B38176800028043 /* ParseViewController.swift in Sources */,
7FD762A01AB632E300BD462C /* LoadingViewController.swift in Sources */,
7F01A5401ABD953900D2B923 /* Movie.swift in Sources */,
0C5312D11AACE65A001CB097 /* ShowCollectionViewCell.swift in Sources */,
Expand All @@ -534,7 +527,6 @@
7F01A53E1ABD953900D2B923 /* Anime.swift in Sources */,
7F0420511ABDCE4E00E27FA1 /* BaseCollectionViewController.swift in Sources */,
7F04205A1ABDD7D700E27FA1 /* MovieDetailsViewController.swift in Sources */,
4354B8EF1B396EBF00C42A5A /* ParseManager.swift in Sources */,
7F0420521ABDCE4E00E27FA1 /* MoviesViewController.swift in Sources */,
0C0A54281AAEE7CB00B4B9B3 /* ImageProvider.swift in Sources */,
7F083C661AB36D84001C938B /* AppDelegate.swift in Sources */,
Expand Down
9 changes: 2 additions & 7 deletions PopcornTime/Controllers/AnimeDetailsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ class AnimeDetailsViewController: BaseDetailsViewController {
override func setupCell(cell: EpisodeCell, seasonIndex: Int, episodeIndex: Int) {
let episode = anime.seasons[seasonIndex].episodes[episodeIndex]
cell.titleLabel.text = "\(episode.episodeNumber)"
if let parseData = parseData {
cell.watchedEpisode = parseData.isEpisodeWatched(Int(episode.seasonNumber), episode: Int(episode.episodeNumber))
}
}

override func setupSeasonHeader(header: SeasonHeader, seasonIndex: Int) {
Expand All @@ -58,9 +55,7 @@ class AnimeDetailsViewController: BaseDetailsViewController {
}

override func cellWasLongPressed(cell: UICollectionViewCell, seasonIndex: Int, episodeIndex: Int) {
let episode = anime.episodeFor(seasonIndex: seasonIndex, episodeIndex: episodeIndex)
let seasonEpisodes = anime.episodesFor(seasonIndex: seasonIndex)

promptToMarkEpisodesWatched(lastEpisodeToMarked: episode, basicInfo: anime, allSeasonEpisodes: seasonEpisodes, popoverView: cell)
// let episode = anime.episodeFor(seasonIndex: seasonIndex, episodeIndex: episodeIndex)
// let seasonEpisodes = anime.episodesFor(seasonIndex: seasonIndex)
}
}
50 changes: 3 additions & 47 deletions PopcornTime/Controllers/BaseDetailsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,9 @@ class BaseDetailsViewController: BarHidingViewController, VDLPlaybackViewControl
let episodeCellReuseIdentifier = "EpisodeCell"

var layout: StratchyHeaderLayout?

// Harmless object, calling it's methods when not connected to Parse does nothing / returns default values
var parseData: ParseShowData?



var item: BasicInfo! {
didSet {
reloadShowInfoFromParse()
navigationItem.title = item.title
reloadData()
}
Expand Down Expand Up @@ -109,42 +104,7 @@ class BaseDetailsViewController: BarHidingViewController, VDLPlaybackViewControl
header?.headerSize = headerSize
layout?.headerSize = headerSize
}

// MARK: - Parse
func reloadShowInfoFromParse() {
ParseManager.sharedInstance.parseEpisodesData(item, handler: { (parseShowData) -> Void in
self.parseData = parseShowData
self.reloadData()
})
}

func promptToMarkEpisodesWatched(lastEpisodeToMarked lastEpisodeToMarked: Episode, basicInfo: BasicInfo, allSeasonEpisodes: [Episode], popoverView: UIView) {
if (ParseManager.sharedInstance.user != nil) {
let actionSheetController = UIAlertController(title: nil, message: nil, preferredStyle: UIAlertControllerStyle.ActionSheet)

let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel, handler: nil)
actionSheetController.addAction(cancelAction)

let markAllEpisodesBeforeThis = UIAlertAction(title: "Mark watched episodes before this one", style: .Destructive) { (action) -> Void in
let episodesBefore = allSeasonEpisodes.filter(){ episodeToCompere in
return (episodeToCompere.episodeNumber) <= lastEpisodeToMarked.episodeNumber
}
ParseManager.sharedInstance.markEpisodes(episodesBefore, basicInfo: basicInfo, completionHandler: { (success, error) -> Void in
self.reloadShowInfoFromParse()
})
}
actionSheetController.addAction(markAllEpisodesBeforeThis)

let popOver = actionSheetController.popoverPresentationController
popOver?.sourceView = view
popOver?.sourceRect = view.bounds
popOver?.permittedArrowDirections = UIPopoverArrowDirection.Any

self.presentViewController(actionSheetController, animated: true, completion: nil)
}
}



// MARK: - Favorites
func addToFavorites() {
DataManager.sharedManager().addToFavorites(item)
Expand All @@ -162,11 +122,7 @@ class BaseDetailsViewController: BarHidingViewController, VDLPlaybackViewControl
}

func startPlayback(episode: Episode, basicInfo: BasicInfo, magnetLink: String, loadingTitle: String) {

// Mark on Parse
ParseManager.sharedInstance.markEpisode(episode, basicInfo: basicInfo)
reloadShowInfoFromParse()


let loadingVC = self.storyboard?.instantiateViewControllerWithIdentifier("loadingViewController") as! LoadingViewController
loadingVC.delegate = self
loadingVC.status = "Downloading..."
Expand Down
3 changes: 0 additions & 3 deletions PopcornTime/Controllers/MovieDetailsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ class MovieDetailsViewController: BaseDetailsViewController {
title += name
}
cell.titleLabel.text = title
if let parseData = parseData {
cell.watchedEpisode = parseData.isEpisodeWatched(0, episode: 0)
}
}

override func setupSeasonHeader(header: SeasonHeader, seasonIndex: Int) {
Expand Down
9 changes: 2 additions & 7 deletions PopcornTime/Controllers/ShowDetailsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ class ShowDetailsViewController: BaseDetailsViewController {
} else {
cell.titleLabel.text = "S\(episode.seasonNumber)E\(episode.episodeNumber)"
}
if let parseData = parseData {
cell.watchedEpisode = parseData.isEpisodeWatched(Int(episode.seasonNumber), episode: Int(episode.episodeNumber))
}
}

override func setupSeasonHeader(header: SeasonHeader, seasonIndex: Int) {
Expand All @@ -59,9 +56,7 @@ class ShowDetailsViewController: BaseDetailsViewController {
}

override func cellWasLongPressed(cell: UICollectionViewCell, seasonIndex: Int, episodeIndex: Int) {
let episode = show.episodeFor(seasonIndex: seasonIndex, episodeIndex: episodeIndex)
let seasonEpisodes = show.episodesFor(seasonIndex: seasonIndex)

promptToMarkEpisodesWatched(lastEpisodeToMarked: episode, basicInfo: show, allSeasonEpisodes: seasonEpisodes, popoverView: cell)
// let episode = show.episodeFor(seasonIndex: seasonIndex, episodeIndex: episodeIndex)
// let seasonEpisodes = show.episodesFor(seasonIndex: seasonIndex)
}
}
20 changes: 0 additions & 20 deletions PopcornTime/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb459546117547491</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>Fabric</key>
Expand All @@ -45,17 +36,6 @@
</dict>
</array>
</dict>
<key>FacebookAppID</key>
<string>459546117547491</string>
<key>FacebookDisplayName</key>
<string>PocornTime iOS</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
24 changes: 1 addition & 23 deletions PopcornTime/Models/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,12 @@ import Crashlytics
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?



func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
#if RELEASE
Fabric.with([Crashlytics()])
#endif
//
Parse.enableLocalDatastore()
Parse.setApplicationId("Zb2NtG60U9aoQcV8jlDaDocs9xtHSpKf0GucHOvD", clientKey: "5ZtO2iAJ3WBwf2IocarUvVG6po7r9byF8XEQ4Moe")
PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)
PFAnalytics.trackAppOpenedWithLaunchOptions(launchOptions)
//
return true
}

func application(application: UIApplication,
openURL url: NSURL,
sourceApplication: String?,
annotation: AnyObject) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application,
openURL: url,
sourceApplication: sourceApplication,
annotation: annotation)
}

func applicationDidBecomeActive(application: UIApplication) {
FBSDKAppEvents.activateApp()
}


}
6 changes: 0 additions & 6 deletions PopcornTime/PopcornTime-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,3 @@
#import <CocoaSecurity/CocoaSecurity.h>
#import <SDWebImage/UIImageView+WebCache.h>
#import <SDWebImage/SDWebImageDownloader.h>

#import <ParseUI/ParseUI.h>
#import <Parse/Parse.h>
#import <Bolts/Bolts.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <ParseFacebookUtilsV4/PFFacebookUtils.h>
Loading

0 comments on commit baa6abd

Please sign in to comment.