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

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
danylokos committed May 20, 2015
0 parents commit b292e16
Show file tree
Hide file tree
Showing 97 changed files with 7,049 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Created by https://www.gitignore.io

### OSX ###
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### Xcode ###
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.xcuserstate


### Objective-C ###
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
*.xcworkspace/
Pods/
16 changes: 16 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'

source 'https://github.com/danylokostyshyn/private-podspecs.git'
source 'https://github.com/CocoaPods/Specs'

target 'PopcornTime' do

pod 'private-MobileVLCKit'
pod 'private-boost'
pod 'private-libtorrent'
pod 'private-openssl'
pod 'Reachability'
pod 'CocoaSecurity'

end
25 changes: 25 additions & 0 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
PODS:
- CocoaSecurity (1.2.4)
- private-boost (1.55.0)
- private-libtorrent (1.0.3)
- private-MobileVLCKit (2.5.150406)
- private-openssl (1.0.201)
- Reachability (3.2)

DEPENDENCIES:
- CocoaSecurity
- private-boost
- private-libtorrent
- private-MobileVLCKit
- private-openssl
- Reachability

SPEC CHECKSUMS:
CocoaSecurity: d288a6f87e0f363823d2cb83e753814a6944f71a
private-boost: ed099134a5d12b4c4520089cd95b1d27bed45762
private-libtorrent: 60c6a134ad7358c0917f1317544ec00f3e146713
private-MobileVLCKit: 856e7cee6e7a898bc4f66e99d408072c750c1778
private-openssl: e18da74a10edef6cf1923b62e302836e21506e12
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96

COCOAPODS: 0.37.1
625 changes: 625 additions & 0 deletions PopcornTime.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

88 changes: 88 additions & 0 deletions PopcornTime.xcodeproj/xcshareddata/xcschemes/PopcornTime.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7F8824C61A227A0100E2710A"
BuildableName = "PopcornTime.app"
BlueprintName = "PopcornTime"
ReferencedContainer = "container:PopcornTime.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7F8824C61A227A0100E2710A"
BuildableName = "PopcornTime.app"
BlueprintName = "PopcornTime"
ReferencedContainer = "container:PopcornTime.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7F8824C61A227A0100E2710A"
BuildableName = "PopcornTime.app"
BlueprintName = "PopcornTime"
ReferencedContainer = "container:PopcornTime.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7F8824C61A227A0100E2710A"
BuildableName = "PopcornTime.app"
BlueprintName = "PopcornTime"
ReferencedContainer = "container:PopcornTime.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
57 changes: 57 additions & 0 deletions PopcornTime/Controllers/AnimeDetailsViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//
// ShowDetailsViewController.swift
// PopcornTime
//
// Created by Andrew K. on 3/13/15.
// Copyright (c) 2015 PopcornTime. All rights reserved.
//

import UIKit

class AnimeDetailsViewController: BaseDetailsViewController {

var anime: Anime! {
get {
return self.item as! Anime
}
}
// MARK: - UIViewController

override func viewDidLoad() {
super.viewDidLoad()
preferedOtherHeadersHeight = 0.0
}

// MARK: - BaseDetailsViewController

override func reloadData() {
PTAPIManager.sharedManager().showInfoWithType(.Anime, withId: item.identifier, success: { (item) -> Void in
self.anime.update(item)
self.collectionView.reloadData()
}, failure: nil)
}

// MARK: - DetailViewControllerDataSource
override func numberOfSeasons() -> Int {
return anime.seasons.count
}

override func numberOfEpisodesInSeason(seasonsIndex: Int) -> Int {
return anime.seasons[seasonsIndex].episodes.count
}

override func setupCell(cell: EpisodeCell, seasonIndex: Int, episodeIndex: Int) {
let episode = anime.seasons[seasonIndex].episodes[episodeIndex]
cell.titleLabel.text = "\(episode.episodeNumber)"
}

override func setupSeasonHeader(header: SeasonHeader, seasonIndex: Int) {

}

override func userSelectedEpisode(cell: UICollectionViewCell, episodeIndex: Int, fromSeason seasonIndex: Int) {
let episode = anime.seasons[seasonIndex].episodes[episodeIndex]
showVideoPickerPopupForEpisode(episode, fromView: cell)
}

}
54 changes: 54 additions & 0 deletions PopcornTime/Controllers/AnimeViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//
// MoviesViewController.swift
// PopcornTime
//
// Created by Andrew K. on 3/15/15.
// Copyright (c) 2015 PopcornTime. All rights reserved.
//

import UIKit

class AnimeViewController: PagedViewController {

override var showType: PTItemType {
get {
return .Anime
}
}

override func map(response: [AnyObject]) -> [BasicInfo] {
return response.map({ Anime(dictionary: $0 as! NSDictionary) })
}

func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {

if let cell = collectionView.cellForItemAtIndexPath(indexPath){
//Check if cell is MoreShowsCell
if let moreCell = cell as? MoreShowsCollectionViewCell{
loadMore()
} else {
performSegueWithIdentifier("showDetails", sender: cell)
}
}
}

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
super.prepareForSegue(segue, sender: sender)

if segue.identifier == "showDetails"{
if let episodesVC = segue.destinationViewController as? AnimeDetailsViewController{
if let senderCell = sender as? UICollectionViewCell{
if let indexPath = collectionView!.indexPathForCell(senderCell){
var item: BasicInfo!
if (searchController!.active) {
item = searchResults[indexPath.row]
} else {
item = items[indexPath.row]
}
episodesVC.item = item as! Anime
}
}
}
}
}
}
32 changes: 32 additions & 0 deletions PopcornTime/Controllers/BarHidingViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// BarHidingViewController.swift
// PopcornTime
//
// Created by Andrew K. on 3/13/15.
// Copyright (c) 2015 PopcornTime. All rights reserved.
//

import UIKit

class BarHidingViewController: UIViewController {

private var barsVisible:Bool = true {
willSet {
self.tabBarController?.tabBar.hidden = !newValue
self.navigationController?.navigationBar.hidden = !newValue
UIApplication.sharedApplication().setStatusBarHidden(!newValue, withAnimation: .Fade)
}
}

override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
//Hide bars if needed
let sizeClass = (horizontal: self.view.traitCollection.horizontalSizeClass, vertical: self.view.traitCollection.verticalSizeClass)
switch sizeClass{
case (_,.Compact):
self.barsVisible = false
default: self.barsVisible = true
}
}

}
Loading

0 comments on commit b292e16

Please sign in to comment.