Skip to content

Instantly share code, notes, and snippets.

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 {

LLDB Note

A key conversation.

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

Remote Debugging Summary

libclang Note

  • Use C API that is intended to be stable long term API.
  • C++ interfaces are not really an API. So it constantly changes.

Xcode Note

Xcode 6.3 (beta)

  • Do not import self module. It causes module-map related link error. For example, if your project's module name is Example1, do not import Example1 in source files in the project.
@eonil
eonil / gist:628121a99c9d2dd85f21
Created June 3, 2015 13:20
Git Submodule How-To

To add a submodule, first move to the container directory, and type this.

git submodule add http://...

To sync the submodule working tree files to current branch'es current commit, type this.

git submodule update
@eonil
eonil / 1. Source Code
Last active October 23, 2015 23:48
Swfit weak reference undefined behaviour case. (Swift 2.0)
class AAA {
deinit {
print("AAA deinit")
callbackOnDeinit!(self)
}
var callbackOnDeinit: (AAA->())?
}
@eonil
eonil / MulticastStation
Created October 25, 2015 09:41
MulticastStation
public class MulticastStation<Parameter>: MulticastChannel<Parameter> {
public override init() {
}
public func cast(parameter: Parameter) {
_cast(parameter)
}
public var onDidRegister: ((Callback)->())? {
get {
return _onDidRegister
//
// FixedViewController.swift
// Editor4
//
// Created by Hoon H. on 2016/05/10.
// Copyright © 2016 Eonil. All rights reserved.
//
import Foundation
import AppKit
@eonil
eonil / gist:f6031d17401bd167f28391ccd0642dbe
Created February 16, 2017 02:48
How to replace string in files in Bash...
find . -name *.json | xargs sed -i -e 's/\"AAA\"/\"BBB\"/g'