Skip to content

Instantly share code, notes, and snippets.

View chajka's full-sized avatar
🏠
Working from home

Чайка chajka

🏠
Working from home
View GitHub Profile
import Cocoa
import CoreAudio
public struct DeviceID {
let deviceID: AudioDeviceID
let UID: String
}// end struct DeviceID
final class AudioDevices: NSObject {
// MARK: Outlets
@chajka
chajka / HexAndNSColorTransformer.swift
Last active August 8, 2018 17:27
HexColor and NSColor byway value transformer
//
// HexAndNSColorTransformer.swift
// Charleston
//
// Created by Чайка on 2018/08/08.
// Copyright © 2018 Чайка. All rights reserved.
//
import Cocoa
@chajka
chajka / Calc height by NSLayoutManager
Last active April 26, 2017 17:13
NSTextCellViewの高さをselfのtextfiledから求めるmethod
- (CGFloat) heightOfView:(CGFloat)width
{
CGFloat width = view.bounds.size.width;
NSTextStorage *storage = [[NSTextStorage alloc] initWithString:comment.comment];
NSTextContainer *container = [[NSTextContainer alloc] initWithContainerSize:NSMakeSize(width, FLT_MAX)];
NSLayoutManager *manager = [[NSLayoutManager alloc] init];
[container setLineBreakMode:NSLineBreakByCharWrapping];
[manager addTextContainer:container];
@chajka
chajka / result
Created May 11, 2013 04:30
役に立たない奇妙なTips ref: http://qiita.com/items/9ab9f315f935820e5c53
nullObject : (null)
@chajka
chajka / info.plist
Created May 3, 2013 13:16
終了時の状態を保存しない設定 ref: http://qiita.com/items/413d1bd5be31767c56a5
<key>NSSupportsAutomaticTermination</key>
<false/>