Quantcast
Channel: @blog.justoneplanet.info
Viewing all articles
Browse latest Browse all 46

iOSでキーボードの表示と非表示に応じた処理をする

$
0
0
- (void)keyboardDidShow:(NSNotification *)note {
    // something
}
- (void)keyboardDidHide:(NSNotification *)note {
    // something
}
- (id)init {
    self = [super init];
    if (self) {
        // キーボードが表示された時
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil];
        // キーボードが隠れた時
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];
    }
    return self;
}

Viewing all articles
Browse latest Browse all 46

Trending Articles