This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Vladyslav Semenchenko on 09/04/2017. | |
// Copyright © 2017 Vladyslav Semenchenko. All rights reserved. | |
import UIKit | |
class InitialViewController: EZViewController { | |
// MARK: - Variables | |
@IBOutlet weak var controlsContainer: UIView! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Vladyslav Semenchenko on 09/04/2017. | |
// Copyright © 2017 Vladyslav Semenchenko. All rights reserved. | |
import UIKit | |
class InitialViewControllerAnimations: NSObject { | |
class func animateLoginPresentation(imageHorizontalConstraint: NSLayoutConstraint, controlsContainer: UIView) { | |
imageHorizontalConstraint.constant = -150 | |
UIView.animate(withDuration: 0.7, delay: 0.5, options: .curveEaseInOut, animations: { | |
AnimationHelper.currentViewController()?.view.layoutIfNeeded() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Vladyslav Semenchenko on 09/04/2017. | |
// Copyright © 2017 Vladyslav Semenchenko. All rights reserved. | |
// MARK: - Private | |
func checkUser() { | |
// some code here and then | |
InitialViewControllerAnimations.animateLoginPresentation(imageHorizontalConstraint: ivLogoHorizontalConstraint, controlsContainer: controlsContainer) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Vladyslav Semenchenko on 09/04/2017. | |
// Copyright © 2017 Vladyslav Semenchenko. All rights reserved. | |
import UIKit | |
class InitialViewControllerAnimations: NSObject { | |
@IBOutlet weak var controlsContainer: UIView! | |
@IBOutlet weak var ivLogoHorizontalConstraint: NSLayoutConstraint! | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Vladyslav Semenchenko on 09/04/2017. | |
// Copyright © 2017 Vladyslav Semenchenko. All rights reserved. | |
import UIKit | |
class InitialViewController: EZViewController { | |
// MARK: - Variables | |
@IBOutlet var sceneAnimations: InitialViewControllerAnimations! | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Vladyslav Semenchenko on 15/05/2017. | |
// Copyright © 2017 Vladyslav Semenchenko. All rights reserved. | |
import Foundation | |
import Moya | |
// 1: | |
enum MyServerAPI { | |
// MARK: - Cameras |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Vladyslav Semenchenko on 15/05/2017. | |
// Copyright © 2017 Vladyslav Semenchenko. All rights reserved. | |
let provider = MoyaProvider<MyServerAPI>() | |
provider.request(.cameras) { (result) in | |
switch result { | |
case .success(let response): | |
// do something with resoinse | |
case .failure(let error): | |
// show error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Vladyslav Semenchenko on 15/05/2017. | |
// Copyright © 2017 Vladyslav Semenchenko. All rights reserved. | |
import Moya | |
struct NetworkAdapter { | |
static let provider = MoyaProvider<MyServerAPI>() | |
static func request(target: MyServerAPI, success successCallback: @escaping (Response) -> Void, error errorCallback: @escaping (Swift.Error) -> Void, failure failureCallback: @escaping (MoyaError) -> Void) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Vladyslav Semenchenko on 15/05/2017. | |
// Copyright © 2017 Vladyslav Semenchenko. All rights reserved. | |
NetworkAdapter.request(target: .cameras, success: { (response) in | |
// parse your data | |
}, error: { (error) in | |
// show error from server | |
}, failure: { (error) in | |
// show Moya error | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Vladyslav Semenchenko on 15/05/2017. | |
// Copyright © 2017 Vladyslav Semenchenko. All rights reserved. | |
import Mapper | |
// 1: | |
class Camera: Mappable { | |
var cameraId: Int? | |
var title: String? | |
var isAvailable: Bool? |
OlderNewer