Skip to content

Instantly share code, notes, and snippets.

View pffan91's full-sized avatar
🌍
Developing the Future

Vladyslav Semenchenko pffan91

🌍
Developing the Future
View GitHub Profile
@pffan91
pffan91 / NetworkLayerWithMoya_parsingDataFromServer.swift
Created May 15, 2017 18:05
NetworkLayerWithMoya_parsingDataFromServer
// 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 {
@pffan91
pffan91 / NetworkLayerWithMoya_fullExample.swift
Last active February 7, 2019 12:46
NetworkLayerWithMoya_fullExample
#1 Moya Target
import Foundation
import Moya
enum MyAPI {
// MARK: - User
case createUser(model: User)
case changePassword(currentPassword: String, newPassword: String)
@pffan91
pffan91 / SlideAnimationTabBarController.swift
Created April 11, 2022 14:03 — forked from illescasDaniel/SlideAnimationTabBarController.swift
[Updated to Swift 4] - UITabBarController slide animation. Slide left and right when tabs are selected. Based on code from StackOverflow
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 }