Xcode 7 Archive Button Grayed Out

One reason the Archive button may be grayed out in Xcode is that you need to be connected to a device, and choose that device. See here: http://stackoverflow.com/questions/16050640/xcode-product-archive-disabled/18791703#18791703

Categorized as hints Tagged

Scroll to the Bottom of a Collection View

private func scrollToBottom() { let lastSectionIndex = (collectionView?.numberOfSections())! – 1 let lastItemIndex = (collectionView?.numberOfItemsInSection(lastSectionIndex))! – 1 let indexPath = NSIndexPath(forItem: lastItemIndex, inSection: lastSectionIndex) collectionView!.scrollToItemAtIndexPath(indexPath, atScrollPosition: UICollectionViewScrollPosition.Bottom, animated: false) }  

NSDateFormatter Styles

Here is a great guide for how to format the string for the dateFormat method (like “yyyy-MM-dd”): http://www.codingexplorer.com/swiftly-getting-human-readable-date-nsdateformatter/

Categorized as resources