FontWellの再実装¶
FontWellをswiftで再実装した。
BSFontWellを参考にしたつもりで、NSButtonとNSButtonCellのサブクラスから作成した。
Interface builder関連のコードやcocoa binding関連のコードを変更したら、BSFontWellとはコード上の関連は無くなってしまった。その上、コードの意味が分かりにくくなった気がする。

ソースはこれ。( ControlSikenjo3.zip
)
IB上からのbindingの設定方法¶
"value"等の既存の値でGUI上でbindingを作る。
"open as"で、.xibや.storybordファイルをxmlファイルとして開く
"connections/binding"を探して、"value"から"fontValue"へ書き換える
これを
<connections>
<binding destination="yT7-o4-ML5" name="value" keyPath="self.modelFont2" id="m1U-oD-u8W"/>
</connections>
こうする
<connections>
<binding destination="yT7-o4-ML5" name="fontValue" keyPath="self.modelFont2" id="m1U-oD-u8W"/>
</connections>
"open as"で、.xibや.storybordファイルをIBファイルとして開く
そーすると、以下のようにGUIで設定できるようになってる。

Comments
comments powered by Disqus