Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lisovik-home24 committed May 14, 2019
1 parent 6219e57 commit 6f5c8f5
Show file tree
Hide file tree
Showing 56 changed files with 2,933 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'themoviedb' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

pod 'Moya', '~> 13.0'
pod 'Kingfisher', '~> 5.0'
pod 'RealmSwift'
pod 'SVProgressHUD'

target 'themoviedbTests' do
inherit! :search_paths
# Pods for testing
end

target 'themoviedbUITests' do
inherit! :search_paths
# Pods for testing
end

end
44 changes: 44 additions & 0 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
PODS:
- Alamofire (4.8.2)
- Kingfisher (5.4.0)
- Moya (13.0.1):
- Moya/Core (= 13.0.1)
- Moya/Core (13.0.1):
- Alamofire (~> 4.1)
- Result (~> 4.1)
- Realm (3.15.0):
- Realm/Headers (= 3.15.0)
- Realm/Headers (3.15.0)
- RealmSwift (3.15.0):
- Realm (= 3.15.0)
- Result (4.1.0)
- SVProgressHUD (2.2.5)

DEPENDENCIES:
- Kingfisher (~> 5.0)
- Moya (~> 13.0)
- RealmSwift
- SVProgressHUD

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Alamofire
- Kingfisher
- Moya
- Realm
- RealmSwift
- Result
- SVProgressHUD

SPEC CHECKSUMS:
Alamofire: ae5c501addb7afdbb13687d7f2f722c78734c2d3
Kingfisher: 9c8f2cc6710334e06f32ba2b45e77707d5e2f0c9
Moya: f4a4b80ff2f8a4ffc208dfb31cd91636622fee6e
Realm: 9b834e1be6062f544805252c812348872dc5d4ed
RealmSwift: 8a41886f8ab6efef9eb8df97de2f2bb911561a79
Result: bd966fac789cc6c1563440b348ab2598cc24d5c7
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6

PODFILE CHECKSUM: 516ffc03715b16825e7fa7a6b0743fb5bf24641c

COCOAPODS: 1.6.1
1,016 changes: 1,016 additions & 0 deletions themoviedb.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>themoviedb.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>10</integer>
</dict>
</dict>
</dict>
</plist>
10 changes: 10 additions & 0 deletions themoviedb.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions themoviedb.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
47 changes: 47 additions & 0 deletions themoviedb/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// AppDelegate.swift
// themoviedb
//
// Created by Alexander Lisovik on 5/11/19.
// Copyright © 2019 Alexander Lisovik. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = UINavigationController(rootViewController: TabBarViewController())
window?.makeKeyAndVisible()

return true
}

func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}

func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


}

98 changes: 98 additions & 0 deletions themoviedb/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
6 changes: 6 additions & 0 deletions themoviedb/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
25 changes: 25 additions & 0 deletions themoviedb/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
36 changes: 36 additions & 0 deletions themoviedb/Base/BaseViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// BaseViewController.swift
// themoviedb
//
// Created by Alexander Lisovik on 5/13/19.
// Copyright © 2019 Alexander Lisovik. All rights reserved.
//

import UIKit

class BaseViewController<P: Presenter>: UIViewController {
public var presenter: P

public init(presenter: P) {
self.presenter = presenter
super.init(nibName: nil, bundle: nil)
}

public required init?(coder aDecoder: NSCoder) {
fatalError("not implemented")
}

override func loadView() {
self.view = UIView(frame: UIScreen.main.bounds)
}

override func viewDidLoad() {
super.viewDidLoad()
presenter.didBindController()
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
presenter.viewWillAppear()
}
}
18 changes: 18 additions & 0 deletions themoviedb/Base/Presenter.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// Presenter.swift
// themoviedb
//
// Created by Alexander Lisovik on 5/13/19.
// Copyright © 2019 Alexander Lisovik. All rights reserved.
//

import Foundation

protocol Presenter {
func didBindController()
func viewWillAppear()
}

extension Presenter {
func viewWillAppear() {}
}
35 changes: 35 additions & 0 deletions themoviedb/Helpers/XibLoadable.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// XibLoadable.swift
// themoviedb
//
// Created by Alexander Lisovik on 5/13/19.
// Copyright © 2019 Alexander Lisovik. All rights reserved.
//

import UIKit
import Foundation

// MARK: - XibLoadable
public protocol XibLoadable {
static var xibName: String { get }
}

public extension XibLoadable {
static func nib(bundle: Bundle? = nil) -> UINib {
return UINib(nibName: xibName, bundle: bundle)
}
}

public extension XibLoadable where Self: UIView {
static var xibName: String {
return String(describing: self)
}

static func loadViewFromXib() -> Self {
let nib = self.nib(bundle: Bundle(for: Self.self))
guard let view = nib.instantiate(withOwner: nil, options: nil).first as? Self else {
fatalError("The nib \(nib) expected its root view to be of type \(self)")
}
return view
}
}
Loading

0 comments on commit 6f5c8f5

Please sign in to comment.