CoreText Swift Academy - part 1

Ever wanted to layout letters? implement label view? create text edit component from the ground? bear with me. CoreText is low-level framework for laying out text and handling fonts. Low level like "C language level low", but also like "Font glyph level low". What CoreText can:…

Retry! in the wild

In perfect world every action finish with the success. In real world it's not. In perfect world sending network request returns with a result. In real world it fail sometimes due to dozen of reasons, and since we're living in the real world I have to…

Code at the end of the queue

Operation and OperationQueue [http://nshipster.com/nsoperation/] are great and useful Foundation framework [https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/ObjC_classic/] tools for asynchronous tasks. One thing puzzled me though: How can I run code after all my queue operations finish? The simple answer is: use…

Swift reflection about food

Reflection in practice Reflection [https://en.wikipedia.org/wiki/Reflection_(computer_programming)] technique may be useful to build quasi generic functions that operate at runtime. It may be quasi type safe, though it uses runtime too - as such can't be optimised/validated during compilation. With Objective-C we…

ChunkSequence 🔪🍰

Have cake and eat it Have a cake and consume the cake by the Swift [https://developer.apple.com/swift/] function, at the same time. Magic. The nature of the Swift type is that it is copied or copied on write [https://en.wikipedia.org/wiki/Copy-on-write]. When I assign…