Skip to content

Instantly share code, notes, and snippets.

View whakkee's full-sized avatar
🐛
Herding bugs

Marga Keuvelaar whakkee

🐛
Herding bugs
View GitHub Profile
// Instead of
[something downloadImage:^(UIImage *image){
cell.imageView.image = image;
}];
// Something like
[something downloadImage:^(UIImage *image){
UITableViewCell *cellForImage = [tableView cellForRowAtIndexPath:indexPath];
@smariapena
smariapena / qa_beginner_reading_list.md
Last active November 2, 2021 08:36
Small Book List: Required Reading For The Absolute Test Beginner
@pgor
pgor / String+Hyphenation.swift
Last active November 12, 2024 12:12
Very basic implementation of enabling hyphenation for text.
import UIKit
public extension String {
/// Transforms this string into an NSAttributedString that has hyphenation enabled.
/// Especially at larger preferredContentSizes, regular word wrapping can lead to really
/// choppy line breaks. Hyphenating allows fuller use of the line whenever possible,
/// resulting in more text on the screen.
/// - Returns: An NSAttributedString version of this String with hyphenation enabled
func withHyphenationEnabled() -> NSAttributedString {
let paragraphStyle = NSMutableParagraphStyle()