Skip to content

Instantly share code, notes, and snippets.

View popwarsweet's full-sized avatar
💭
Not coding

Kyle Zaragoza popwarsweet

💭
Not coding
View GitHub Profile
@popwarsweet
popwarsweet / ChatCollectionViewFlowLayout.swift
Created October 8, 2018 17:55 — 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]?
@popwarsweet
popwarsweet / PagingCarouselFlowLayout.swift
Created March 31, 2017 19:02
Flow layout for pinning (paging) items in a carousel without needing item sizes that match the bounds of the scroll view.
//
// PagingCarouselFlowLayout.swift
// PagingCarousel
//
// Created by Kyle Zaragoza on 10/28/16.
// Copyright © 2016 Kyle Zaragoza. All rights reserved.
//
import UIKit
@popwarsweet
popwarsweet / sample_public.md
Created January 28, 2017 19:46
Sample public gist.

This is Just a Sample

Of a public markdown gist.

Sounds Good

Ok bye!

if public {
  print("public")
}