Last active
August 29, 2015 14:27
-
-
Save yimingtang/08e2e48969e42935b42c to your computer and use it in GitHub Desktop.
NSBundle + Framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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