macOS/iOS API解説

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

目次

getRectsExposedDuringLiveResize:count:

ライブリサイズ中に再描画される範囲を返します
-(void)getRectsExposedDuringLiveResize:(NSRect[4])exposedRects:
            count:(int *)count:

解説

ライブリサイズ中に再描画される範囲を返します。

返り値

( void )

なし

引数

( NSRect[4] )exposedRects
( int * )count

フレームワーク

ApplicationKit

クラス

NSView

Instance Methods

使用可能

10.4

参照

-preservesContentDuringLiveResize
-rectPreservedDuringLiveResize
-setPreservesContentDuringLiveResize: (NSWindow)

例文

#import "MyButton.h"

@implementation MyButton
- (void) drawRect:(NSRect)rect
{
	//ライブリサイズか
    if ([self inLiveResize])
    {
       
		
		NSRect rects[4];
        int count;
        [self getRectsExposedDuringLiveResize:rects count:&count];
        while (count-- > 0) 
        {
            [self setNeedsDisplayInRect:rects[count]];
			
			 NSLog(@"Live %f,%f", rects[count].size.width,rects[count].size.height );
        }
		
    }
    else
    {
        NSLog(@"NO Live");
    }

	
[super drawRect: rect ];
}
@end