Skip to content

Instantly share code, notes, and snippets.

View Fengson's full-sized avatar
🏠
Working from home

Szymon Kadluczka Fengson

🏠
Working from home
View GitHub Profile
@buechner
buechner / UIImageView+fixVectorTemplate.swift
Created August 2, 2016 10:01
Fixing a bug in XCode, where a vector image set as template can not be tinted in Interface Builder: http://openradar.appspot.com/18448072
import UIKit
// fixing Bug in XCode
// http://openradar.appspot.com/18448072
extension UIImageView {
override public func awakeFromNib() {
super.awakeFromNib()
self.tintColorDidChange()
}
}
@mmick66
mmick66 / UICollectionViewFlowLayoutCenterItem.m
Last active August 2, 2022 10:06
UICollectionViewFlowLayout with arbitrary sized Paging
#import "UICollectionViewFlowLayoutCenterItem.h"
@implementation UICollectionViewFlowLayoutCenterItem
- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity
{
CGSize collectionViewSize = self.collectionView.bounds.size;
CGFloat proposedContentOffsetCenterX = proposedContentOffset.x + self.collectionView.bounds.size.width * 0.5f;
CGRect proposedRect = self.collectionView.bounds;