Skip to content

Instantly share code, notes, and snippets.

View rdscoo1's full-sized avatar

Roman rdscoo1

  • Moscow
View GitHub Profile
@rdscoo1
rdscoo1 / duplicate_line_xcode.md
Created June 12, 2021 13:26 — forked from VadimYakovliev/duplicate_line_xcode.md
Xcode - Duplicate Line key binding

Xcode line duplicate

Bind keys to duplicate lines in Xcode

  1. Open below directory in Finder with Cmnd + Shift + G
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
@rdscoo1
rdscoo1 / AwesomeViewController.swift
Created November 2, 2019 23:39 — forked from thomaskioko/AwesomeViewController.swift
How to dynamically style custom cells in the UICollectionViewController
class AwesomeViewController: UICollectionViewController {
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize
{
let cellSpacing = CGFloat(1) //Define the space between each cell
let leftRightMargin = CGFloat(0) //If defined in Interface Builder for "Section Insets"
let numColumns = CGFloat(3) //The total number of columns you want
let totalCellSpace = cellSpacing * (numColumns - 1)
let screenWidth = UIScreen.mainScreen().bounds.width // Get the width of the screen.