Skip to content

Instantly share code, notes, and snippets.

View Oni-zerone's full-sized avatar
🧗‍♀️
I may be hanging around.

Andrea Altea Oni-zerone

🧗‍♀️
I may be hanging around.
View GitHub Profile
//
// SOTControlBar.swift
// ControlBar
//
// Created by Andrea Altea on 27/06/17.
// Copyright © 2017 StudiOUT. All rights reserved.
//
import UIKit
@Oni-zerone
Oni-zerone / TabViewContainer.swift
Created August 2, 2017 12:28
SOTTabViewContainer
//
// TabViewContainer.swift
// BusMap
//
// Created by Andrea Altea on 24/05/17.
// Copyright © 2017 StudiOUT. All rights reserved.
//
import UIKit
//
// TouchLayerView.swift
//
//
// Created by Oni_01 on 04/01/15.
// Copyright (c) 2015 Andrea Altea. All rights reserved.
//
import UIKit
@Oni-zerone
Oni-zerone / SOTBubbleLabel.swift
Last active August 22, 2017 08:22
SOTBubbleLabel
//
// SOTBubbleLabel.swift
//
//
// Created by Andrea Altea on 18/08/17.
// Copyright 2017 Andrea Altea. All rights reserved.
//
import UIKit
//
// RequestManager.swift
//
//
// Created by Andrea Altea on 05/11/17.
// Copyright © 2017 Studiout. All rights reserved.
//
import Foundation
struct RequestManagerConfiguration {
@Oni-zerone
Oni-zerone / ZoomCardFlowLayout.swift
Last active May 2, 2018 19:49
A card zooming custom flow layout
//
// ZoomCardFlowLayout.swift
//
//
// Created by Oni_01 on 12/05/15.
// Copyright (c) 2015 Andrea Altea. All rights reserved.
//
import UIKit
@Oni-zerone
Oni-zerone / WUCFCollectionViewDataSource.swift
Last active October 21, 2018 14:40
An example of what you could find in a UICollectionViewDataSource
class StandardCell: UICollectionViewCell {
var titleLabel: UILabel!
}
class StandardDataSource: NSObject, UICollectionViewDataSource {
var firstSectionItems: [String] = ["first", "second", "third"]
var secondSectionItems: [String] = ["FIRST", "SECOND", "THIRD"]
@Oni-zerone
Oni-zerone / CollectionViewModel.swift
Last active October 21, 2018 15:11
A UICollectionViewDataSource that will use a ViewModel representation of the items inside the collection
protocol ItemViewModel {
var reuseIdentifier: String { get }
func setup(_ cell: UICollectionReusableView, in collectionView: UICollectionView, at indexPath: IndexPath)
}
protocol SectionViewModel {
var headerItem: ItemViewModel? { get }
class MVVMCollectionViewDataSource: NSObject, UICollectionViewDataSource {
var model: [SectionViewModel] = []
func numberOfSections(in collectionView: UICollectionView) -> Int {
return self.model.count
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return self.model[section].items.count
@Oni-zerone
Oni-zerone / StandardCellItemViewModel.swift
Created October 21, 2018 15:18
An itemViewModel of a simple cell
struct StandardCellViewModel: ItemViewModel {
let title: String
var reuseIdentifier: String {
return "cell"
}
func setup(_ cell: UICollectionReusableView, in collectionView: UICollectionView, at indexPath: IndexPath) {
guard let cell = cell as? StandardCell else {