Skip to content

Instantly share code, notes, and snippets.

View devpolant's full-sized avatar
🎯
Focusing

Anton devpolant

🎯
Focusing
  • Ukraine
View GitHub Profile
@devpolant
devpolant / ChatCollectionViewFlowLayout.swift
Created August 9, 2018 07:26 — forked from jochenschoellig/ChatCollectionViewFlowLayout.swift
A subclass of UICollectionViewFlowLayout to get chat behavior without turning collection view upside-down. This layout is written in Swift 3 and absolutely usable with RxSwift and RxDataSources because UI is completely separated from any logic or binding.
import UIKit
class ChatCollectionViewFlowLayout: UICollectionViewFlowLayout {
private var topMostVisibleItem = Int.max
private var bottomMostVisibleItem = -Int.max
private var offset: CGFloat = 0.0
private var visibleAttributes: [UICollectionViewLayoutAttributes]?
//
// UIImage+Blur.swift
// NativeBlur
//
// Created by Anton Poltoratskyi on 11.02.2018.
// Copyright © 2018 Anton Poltoratskyi. All rights reserved.
//
import UIKit
import Accelerate
@devpolant
devpolant / NumberFormatter.swift
Last active July 28, 2022 20:30
Custom iOS NumberFormatter Wrapper
//
// AppNumberFormatter.swift
// TrumpWall
//
// Created by Anton Poltoratskyi on 4/13/17.
// Copyright © 2017 Anton Poltoratskyi. All rights reserved.
//
import Foundation
//: Playground - noun: a place where people can play
import UIKit
import SpriteKit
import PlaygroundSupport
let sceneView = SKView(frame: CGRect(x: 0, y: 0, width: 480, height: 320))
let scene = SKScene(size: CGSize(width: 480, height: 320))
scene.physicsWorld.gravity = .zero
//
// main.swift
// DESAlgorithmCommandLine
//
// Created by Anton Poltoratskyi on 12.03.17.
// Copyright © 2017 Anton Poltoratskyi. All rights reserved.
//
import Foundation
@devpolant
devpolant / Cryptography.swift
Last active February 20, 2017 22:43
Cryptography
import Foundation
// MARK: - Text + Statistic
public extension Character {
var isWhiteSpace: Bool {
return self == Character(" ")
}
}