Short (72 chars or less) summary
More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
| class ViewController: UIViewController { | |
| let tableView = UITableView() | |
| // BAD SOLUTION, but works | |
| override func viewDidLayoutSubviews() { | |
| super.viewDidLayoutSubviews() | |
| tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: -tableView.bounds.height, right: 0) | |
| } |
| MOVED HERE: | |
| https://gist.github.com/naveenkrdy/26760ac5135deed6d0bb8902f6ceb6bd |
| extension UICollectionView { | |
| func indexPath(for supplementaryView: UICollectionReusableView?, ofKind kind: String = UICollectionView.elementKindSectionHeader) -> IndexPath? { | |
| let elements = visibleSupplementaryViews(ofKind: kind) | |
| let indexPaths = indexPathsForVisibleSupplementaryElements(ofKind: kind) | |
| for (element, indexPath) in zip(elements, indexPaths) { | |
| if element === supplementaryView { | |
| return indexPath | |
| } | |
| } |
| #!/bin/bash | |
| sudo apt-get install clang libicu-dev libcurl4-openssl-dev lldb git wget unzip -y | |
| wget https://swift.org/builds/swift-4.1-release/ubuntu1604/swift-4.1-RELEASE/swift-4.1-RELEASE-ubuntu16.04.tar.gz | |
| tar zxf swift-4.1*.tar.gz && rm -rf swift-4.1*.tar.gz | |
| sudo mv swift-4.1* /swift-4.1 | |
| echo "export PATH=/swift-4.1/usr/bin:\"\${PATH}\"" >> ~/.bashrc | |
| source ~/.bashrc |
| // | |
| // UIImage+PDF.swift. Copyright © 2016 Nigel Timothy Barber (@mindbrix). All rights reserved. | |
| // | |
| import UIKit | |
| extension UIImage { | |
| static func PDFImageWith(_ url: URL, pageNumber: Int, width: CGFloat) -> UIImage? { | |
| return PDFImageWith(url, pageNumber: pageNumber, constraints: CGSize(width: width, height: 0)) | |
| } | |
| APP="MyApp" | |
| CONSTRUCT=xcodebuild -workspace $(APP).xcworkspace -scheme $(APP) clean | |
| install_deps: | |
| pod install | |
| create_config: | |
| swift package fetch | |
| swift package generate-xcodeproj | |
| wipe: | |
| rm -rf .build $(APP).xcodeproj $(APP).xcworkspace Package.pins Pods Podfile.lock |
| enum DateStride { | |
| case year(Int) | |
| case month(Int) | |
| case day(Int) | |
| var component: Calendar.Component { | |
| switch self { | |
| case .year(_): | |
| return .year | |
| var _fetchedResultsController: NSFetchedResultsController<Entity>? = nil | |
| var blockOperations: [BlockOperation] = [] | |
| var fetchedResultController: NSFetchedResultsController<Entity> { | |
| if _fetchedResultsController != nil { | |
| return _fetchedResultsController! | |
| } | |
| let fetchRequest: NSFetchRequest<Entity> = Entity.fetchRequest() | |
| let managedObjectContext = (UIApplication.shared.delegate as! AppDelegate).managedObjectContext! |
Following the tradition from last year, here's my complete list of all interesting features and updates I could find in Apple's OSes, SDKs and developer tools that were announced at this year's WWDC. This is based on the keynotes, the "What's New In ..." presentations and some others, Apple's release notes, and blog posts and tweets that I came across in the last few weeks.
If for some reason you haven't watched the talks yet, I really recommend watching at least the "State of the Union" and the "What's New In" intros for the platforms you're interested in. The unofficial WWDC Mac app is great way to download the videos and keep track of what you've already watched.
If you're interested, here are my WWDC 2015 notes (might be useful if you're planning to drop support for iOS 8 now and start using some iOS 9 APIs).