Skip to content

Instantly share code, notes, and snippets.

LLDB Note

A key conversation.

Well, it's three years ago, and now it works far better.

Remote Debugging Summary

Swift Coding Style

I have specific coding style for Swift.

  • Follow Apple's Cocoa coding style. (Camel case, uppercases for abbreviations, etc.)
  • Openign braces { at same line.

func exampleFunction1() -> Int {

@eonil
eonil / gist:1aa12ecacf1a4b2566fe
Last active October 31, 2021 12:35
Cocoa Note

Cocoa Note (including AppKit)

  • NSLayoutManager.setTemporaryAttributes(:forCharacterRange:) is far faster than NSTextStorage.setAttributes(:range:). On My iMac, former took about 2 seconds, and latter took about 17 seconds in optimised build of test suit.

  • Anyway, modifying NSTextStorage also took 2 seconds when wrapped by beginEditing/endEditing pair. So this performance drop is mainly due to inefficient layout refresh. You will get same performance

@eonil
eonil / gist:4a457009cc8ac2ca9cb7
Last active August 29, 2015 14:12
Unicode Note

Unicode Note

The core part of Unicode is Unicode Scalar Value. This represents core component to build a Unicode text. Also provides most reliable unit to process text data.

Unicode Scalar Value is equal to Code Point except surrogate pairs.

Code Unit is a component of each encoding algorithm. Defined differently by the encodings.

Grapheme Cluster smallest unit to represent human recgonizable symbol.

LLVM Note

Address Sanitizer Support

UIKit Note

Autolayout

  • If you want self-sizing view by its subviews, just do not set its sizing constraint. Then it will become the
@eonil
eonil / gist:1eb1fd993aad2f275f21
Last active August 29, 2015 14:09
Rust Notes

Rust Notes

This Gist is just a note of my current personal understanding, and does not define or claim the actual Rust behaviors. Always can be wrong, and may contain some errors. Do not rely on this information if you're learning Rust.

Swift Note

Swift Note #1

@eonil
eonil / gist:eee843700cb271029734
Last active August 29, 2015 14:06
Git How-To