This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use this one and it pulls flowLayout info, even from storyboard | |
extension UICollectionViewFlowLayout { | |
func cellsFitAcrossScreen(numberOfCells: Int, labelHeight: CGFloat, cellShapeRatio: CGFloat) -> CGSize { | |
//using information from flowLayout get proper spacing for cells across entire screen | |
let insideMargin = self.minimumInteritemSpacing | |
let outsideMargins = self.sectionInset.left + self.sectionInset.right | |
let numberOfDivisions: Int = numberOfCells - 1 | |
let subtractionForMargins: CGFloat = insideMargin * CGFloat(numberOfDivisions) + outsideMargins | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MasterViewController.swift | |
// coreDataTest | |
// | |
// Created by Douglas Hewitt on 6/26/16. | |
// Copyright © 2016 madebydouglas. All rights reserved. | |
// | |
import UIKit | |
import CoreData |