//
//  Utilities.h
//  TermKit
//
//  Created by Colin Caufield on 2016-01-05.
//  Copyright © 2016 Secret Geometry. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Debug.h"

//
// A category for performing a selector only if it exists.
//

@interface NSObject (SafePerformSelector)

- (id) safePerformSelector:(SEL)selector;
- (void) safeInvokeSelector:(SEL)selector returnValue:(void*)returnValue;

@end

//
// A category for finding the first responder.
//

#ifdef TERMKIT_IOS

    #import <UIKit/UIKit.h>

    @interface UIResponder (FirstResponder)

    + (id) currentFirstResponder;
    - (void) findFirstResponder:(id)sender;

    @end

#endif
