Skip to content

Instantly share code, notes, and snippets.

View Savchukv's full-sized avatar

Vasiliy Savchuk Savchukv

View GitHub Profile
@Savchukv
Savchukv / GenreViewController.swift
Created June 7, 2017 14:08
Example ViewController with CollectionView
//
// GenreViewController.swift
//
// Created by Vasiliy Savchuk on 09.02.17.
// Copyright © 2017 All rights reserved.
//
class GenreViewController: BaseViewController {
@IBOutlet weak var mainGenreCollectionView: UICollectionView!
var viewModel = GenreViewModel()
//
// RandomMusicViewModel.swift
//
// Created by Vasiliy Savchuk on 2/6/17.
// Copyright © 2017 All rights reserved.
//
class RandomMusicViewModel: ViewModelTitleProtocol, ViewModelProtocol, ViewModelTypeProtocol {
var dataSource: Array<JSONDecodable> = Array()
var type: CellType = .randomMusicCell
@Savchukv
Savchukv / GoogleMapViewController.swift
Created May 31, 2017 14:53
Example Google map ViewController
//
// GoogleMapViewController.swift
//
// Created by Vasiliy Savchuk on 11/21/16.
// Copyright © 2016 All rights reserved.
//
import UIKit
import GoogleMaps
@Savchukv
Savchukv / LoginViewModel.swift
Created May 31, 2017 14:49
Example Login View Model with Firebase
//
// LoginViewModel.swift
//
// Created by Vasiliy Savchuk on 11/9/16.
// Copyright © 2016 All rights reserved.
//
// Usage this snippet:
// let viewModel: LoginViewModel = LoginViewModel()
//
// @IBAction func signInButtonDidPress(_ sender: Any) {
@Savchukv
Savchukv / PopUpViewController.swift
Created May 31, 2017 14:42
Example custom animation PopUp ViewController with sending email
//
// PopUpViewController.swift
//
// Created by Vasiliy Savchuk on 22.11.16.
// Copyright © 2016 All rights reserved.
//
// Usage this snippet:
// @IBAction func yourButtonDidPress(_ sender: Any) {
// let popOverVC = UIStoryboard(name: Constants.Storyboard.Map, bundle: nil).instantiateViewController(withIdentifier: Constants.StoryboardID.PopUpViewController) as! PopUpViewController
// popOverVC.pointModel = self.curentPoint
@Savchukv
Savchukv / Alert.swift
Created May 31, 2017 14:35
Example to call Alert from different ViewControllers
//
// Alert.swift
//
// Created by Vasiliy Savchuk on 16.12.16.
// Copyright © All rights reserved.
//
// Usage this snippet:
// to call - displayAlert(title: "Oops!", message: "Error", viewController: self)
import Foundation
@Savchukv
Savchukv / UserViewController.swift
Created May 31, 2017 14:22
Example TableView Controller with extension UITableViewDataSource and UITableViewDelegate
//
// UserProfileViewController.swift
//
// Created by Vasiliy Savchuk on 01.02.17.
// Copyright © 2017 All rights reserved.
//
class UserProfileViewController: UIViewController {
@IBOutlet weak var tableView: UITableView!
@Savchukv
Savchukv / BackendService.swift
Created May 31, 2017 14:12
Example Alamofire request for login with constants string
//
// BackendService.swift
//
// Created by Vasiliy Savchuk on 27.01.17.
// Copyright © 2017 All rights reserved.
//
enum API {
static var token: String?
static var tokenType: String?
@Savchukv
Savchukv / VideoViewController.swift
Created May 31, 2017 14:00
Play full screen video with routers
//
// ViewController.swift
//
// Created by Vasiliy Savchuk on 19.01.17.
// Copyright © 2017 All rights reserved.
//
import UIKit
import AVFoundation
import AVKit
@Savchukv
Savchukv / ExtensionView.swift
Created May 31, 2017 13:55
Example extension UIView for creating IOS screenshot
//
// ExtensionView.swift
//
// Created by Vasiliy Savchuk on 2/6/17.
// Copyright © 2017 All rights reserved.
//
// Usage this snippet:
// yourImageView.image = view.screenshot
import UIKit