Skip to content

Instantly share code, notes, and snippets.

View k-o-d-e-n's full-sized avatar
🚩
Fuck capitalism!

Denis Freerider k-o-d-e-n

🚩
Fuck capitalism!
View GitHub Profile
@k-o-d-e-n
k-o-d-e-n / LazyLoadable.swift
Last active November 23, 2022 09:43
How to avoid an anonymous closure in lazy properties
/*
lazy var actionButton: UIButton = UIButton().add(to: view) { btn in
// button configuration
}
instead of:
lazy var actionButton: UIButton = {
let btn = UIButton()
addSubview(btn)
@k-o-d-e-n
k-o-d-e-n / ScrollStackView.swift
Created January 15, 2018 13:11
UIStackView + UIScrollView in single view. It has lazy loading of arranged views behaviour.
//
// ScrollStackView.swift
// iOS-Extensions
//
// Created by Denis Koryttsev on 07/08/2017.
// Copyright © 2017 Denis Koryttsev. All rights reserved.
//
import UIKit
@k-o-d-e-n
k-o-d-e-n / ExtendedRealmCollection.swift
Created October 18, 2017 20:27
Extended Realm Collection
import Foundation
import RealmSwift
extension AnyRealmCollection {
var asArray: [Element] {
return map { $0 }
}
}
final class ExtendedRealmCollection<O: Object>: RealmCollection {