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 | |
do { | |
let cameras: [Camera] = try response.mapArray() as [Camera] | |
// do something with cameras | |
} catch { |
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
#1 Moya Target | |
import Foundation | |
import Moya | |
enum MyAPI { | |
// MARK: - User | |
case createUser(model: User) | |
case changePassword(currentPassword: String, newPassword: String) |
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
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool { | |
if let fromView = tabBarController.selectedViewController?.view, | |
let toView = viewController.view, fromView != toView, | |
let controllerIndex = self.viewControllers?.firstIndex(of: viewController) { | |
let viewSize = fromView.frame | |
let scrollRight = controllerIndex > tabBarController.selectedIndex | |
if fromView.superview?.subviews.contains(toView) == true { return false } |
OlderNewer