//
//  UIView+Extensions.m
//  DrivoMeter
//
//  Created by Triin Uudam on 3/18/12.
//  Copyright (c) 2012 Mobi Solutions OÜ. All rights reserved.
//

#import "UIView+Extensions.h"

@implementation UIView (Extensions) 

+ (UIView *)loadViewFromXib:(NSString *)xibName {
  UIView *result = nil;
  NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:xibName owner:nil options:nil];
  for (id currentObject in topLevelObjects) {
    if ([currentObject isKindOfClass:[UIView class]]) {
      result = (UIView *) currentObject;
      break;
    }
  }
  
  return result;
}

@end
