Skip to content

Instantly share code, notes, and snippets.

@yimingtang
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yimingtang/08e2e48969e42935b42c to your computer and use it in GitHub Desktop.
Save yimingtang/08e2e48969e42935b42c to your computer and use it in GitHub Desktop.
NSBundle + Framework
//
// NSBundle+MyLibrary.h
// Pods
//
// Created by Yiming Tang on 8/4/15.
// Copyright (c) 2015 Yiming Tang. All rights reserved.
//
@import Foundation;
@interface NSBundle (MyLibrary)
+ (NSBundle *)my_myLibraryBundle;
+ (NSURL *)my_myLibraryBundleURL;
@end
//
// NSBundle+MyLibrary.m
// Pods
//
// Created by Yiming Tang on 8/4/15.
// Copyright (c) 2015 Yiming Tang. All rights reserved.
//
#import "NSBundle+MyLibrary.h"
#import "MYSomeClass.h"
@implementation NSBundle (MyLibrary)
+ (NSBundle *)my_myLibraryBundle {
return [self bundleWithURL:[self my_myLibraryBundleURL]];
}
+ (NSURL *)my_myLibraryBundleURL {
NSBundle *bundle = [NSBundle bundleForClass:[MYSomeClass class]];
return [bundle URLForResource:@"MyLibrary" withExtension:@"bundle"];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment