Skip to content

Instantly share code, notes, and snippets.

View vialyx's full-sized avatar
🎯
Focusing

Maxim Vialyx vialyx

🎯
Focusing
View GitHub Profile
2015-04-15 11:21:38.929 fasten[841:186573] startLoaderSpin
2015-04-15 11:21:39.086 fasten[841:186573] Connected to ws://95.213.131.42:8080
2015-04-15 11:21:39.119 fasten[841:186573] sending - {
"api_token" = "222b2c85-62a4-4a86-86f3-364a9482de82";
type = "CUSTOMER_GET_CREDIT_CARDS";
}
2015-04-15 11:21:39.120 fasten[841:186573] sending - {
"api_token" = "222b2c85-62a4-4a86-86f3-364a9482de82";
data = {
"car_capacity" = 4;
class StrongLoginPresenter {
// MARK: - Inner
func login {
// Work with data
}
// MARK: - Network
func sendLoginRequest {
// Work with URLRequest formed
protocol LoginInteractorInput {
func doLogin(login: String, password: String) -> Bool
}
protocol LoginRouterInput {
func openMainScreen()
}
class LoginInteractor: LoginInteractorInput {
protocol AnalyticType {
func track(_ event: String, parameters: [String: Any]?)
}
final class FacebookAnalytic: AnalyticType {
func track(_ event: String, parameters: [String : Any]?) {
// TODO: - Send facebook event
}
protocol NameType {
var name: String { get }
}
class UserShort: NameType {
var id: UInt
var name: String
init(id: UInt, name: String) {
protocol ResourceType {
func load()
}
protocol PagginationProtocol {
var offset: UInt { get set }
var limit: UInt! { get set }
var hasMore: Bool { get }
func loadMore()
}
protocol UserType {
var id: UInt { get set }
var name: String { get set }
}
struct User: UserType {
var id: UInt
var name: String
import UIKit
var str = "Hello, playground"
class BaseViewController: UIViewController {
var handledErrorCodes: [Int: String] = [200: "localized.title", 210: "localized.title.error"]
func showError(error: NSError) {
let code = error.code
├─ Models
├─ Views
├─ Modules (ViewModels - MVVM, Controllers - MVC)
├─ Stores
├─ Extensions
├─ Utils
├─ Helpers
├─ etc...
struct Constants {
struct UI {
static let chooseTransportCellHeight: CGFloat = 90
static let settingsSectionHeaderHeight: CGFloat = 60
private init() {}
}