//
//  UIView+OJAKit.m
//  OJAKitDemo
//
//  Created by luxiaoming on 16/10/12.
//  Copyright © 2016年 luxiaoming. All rights reserved.
//

#import "UIView+OJAKit.h"


@implementation UIView (OJAKit)

+ (instancetype)loadFromNib {
    NSArray *nibViews = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class])
                                                      owner:self
                                                    options:nil];
    return [nibViews firstObject];
}

@end



@implementation UITableViewCell (OJAKit)

+ (UINib *)nib {
    return [UINib nibWithNibName:NSStringFromClass([self class]) bundle:nil];
}

+ (NSString *)oja_reuseIdentifier {
    return NSStringFromClass(self);
}

- (void)configureWithData:(id)data indexPath:(NSIndexPath *)indexPath {
    NSLog(@"need subclass implementation");
}

@end



@implementation UICollectionReusableView (OJAKit)

+ (UINib *)nib {
    return [UINib nibWithNibName:NSStringFromClass([self class]) bundle:nil];
}

+ (NSString *)oja_reuseIdentifier {
    return NSStringFromClass(self);
}

- (void)configureWithData:(id)data indexPath:(NSIndexPath *)indexPath {
    NSLog(@"need subclass implementation");
}

@end
