macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

drawerShouldClose:

close:で引き出しが閉じられようとした時に呼ばれます
-(BOOL)drawerShouldClose:(NSDrawer *)sender:

解説

close:で引き出しが閉じられようとした時に呼ばれます。closeの場合は呼ばれません。
drawerWillClose:よりも先に呼ばれます。
YESを返すと引き出しは閉じられます。
NOを返すと閉じられません。

返り値

( BOOL )

YES/NO

引数

( NSDrawer * )sender

送信オブジェクト

フレームワーク

ApplicationKit

クラス

NSDrawer

Instance Methods

使用可能

10.0

参照

例文

#import "Drawerdeligate.h"
//drawerのデリゲート
@implementation Drawerdeligate

-(BOOL)drawerShouldClose:(NSDrawer *)sender
{
NSLog(@"drawerShouldClose");
return YES;
}

-(void)drawerWillClose:(NSNotification *)notification
{
NSLog(@"drawerWillClose");
}

@end