macOS/iOS API解説

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

目次

arrangeInFront:

INDEX>AppKit>NSApplication

ウインドウメニューにリストされているウインドウを他のウインドウの前に持ってきます

Objective-C

- (void)arrangeInFront:(id)sender

Swift

func arrangeInFront(_ sender: AnyObject?)


他のすべてのウィンドウの前面にウィンドウ]メニューにリストされているウィンドウを配置します。



解説

ウインドウメニューにリストされているウインドウを他の(アプリケーションの)ウインドウの前に持ってきます。

返り値

なし

引数

( id )sender

Swift

_ sender: AnyObject?

送信オブジェクト

フレームワーク

ApplicationKit

クラス

NSApplication

使用可能

10.0

編集時のバージョン

10.10

例文

#import "MyObject.h"

@implementation MyObject

NSTimer *timer=nil;
- (IBAction)myAction:(id)sender
{
	//5秒ごとにこのアプリのウインドウが全面になる
	timer = [NSTimer scheduledTimerWithTimeInterval:5.0
											 target:self
										   selector:@selector(timerControl:)
										   userInfo:nil
											repeats:YES];
}


-(void) timerControl:(NSTimer *)timer
{
	NSLog(@"fire");
	[NSApp arrangeInFront:nil];
}


@end

Swift

//NSApplication arrangeInFront
    @IBAction func function039(sender: AnyObject) {
        //共有アプリケーションインスタンスを取得
        let anApplication = MyApplication.sharedApplication()
        //
        anApplication.arrangeInFront(self)
        NSLog("NSApplication arrangeInFront")
    }