Latest 1.0.8
Homepage https://github.com/dgynfi/clang_api
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit, Foundation
Authors

存取bundle中的资源,读取本地化文本,执行选择器和UserDefaults的相关操作,调用通知中心的相关操作等。

安装

支持通过 CocoaPods 安装。

 pod 'clang_api', '~> 1.0.8'

使用说明

1.获取bundle资源文件路径

NSString *path = clang_path_for_resource_from_bundle(@"Info", @"plist", nil, @"Test");
NSLog(@"Info.plist's path: %@", path);
NSLog(@"Info.plist's content: %@", [NSDictionary dictionaryWithContentsOfFile:path]);

2.获取bundle中的图片

UIImage *image = clang_load_image_from_bundle(@"angle-mask", @"angle-mask.bundle", @"Test");
NSLog(@"Image: %@", image);

3.获取bundle中的图片,不缓存内存

UIImage *image2 = clang_image_with_contents_of_file(@"angle-mask", nil, @"angle-mask.bundle", @"Test");
NSLog(@"Image2: %@", image2);

4.获取main bundle中的资源文件路径

NSString *path2 = clang_path_for_resource_from_bundle(@"Info", @"plist", nil, nil);
NSLog(@"info.plist's path2: %@", path2);
NSLog(@"info.plist's content2: %@", [NSDictionary dictionaryWithContentsOfFile:path2]);

5.获取main bundle中的图片,不缓存内存

UIImage *Image3 = clang_image_with_contents_of_file(@"angle-mask", nil, nil, nil);
NSLog(@"Image3: %@", image3);

6.读取本地化内容

NSLog(@"Localized string: %@", clang_localized_string(@"Lan_network_timeout", nil, @"en", @"language", @"Test"));

7.其他

BOOL y1 = clang_equal(@1, @3);
//NSLog(@"y1: %d", y1);
BOOL y2 = clang_equal_to_string(@"try", @"try");
//NSLog(@"y2: %d", y2);

clang_perform_selector(self, @selector(run));
clang_perform_selector_v2(self, @selector(runWithArg:), @10);
clang_delay_perform_selector(self, @selector(update), 1.0);
clang_delay_perform_selector_v2(self, @selector(updateWithArg:), @"update", 1.0);

clang_store_object(@"AppID", @"g7482293", YES);
NSString *appID = clang_read_object(@"AppID");
//NSLog(@"appID: %@", appID);
//clang_remove_object(@"AppID", YES);

clang_add_observer(self, @selector(logInWithResult:), @"DYFLoginNotification", nil);
//clang_remove_observer_v2(self, @"DYFLoginNotification", nil);
//clang_remove_observer(self);
clang_post_notification_name(@"DYFLoginNotification", @1);
clang_post_notification_name_v2(@"DYFLoginNotification", nil, @{@"ret": @0});

Latest podspec

{
    "name": "clang_api",
    "version": "1.0.8",
    "summary": "u5b58u53d6bundleu4e2du7684u8d44u6e90uff0cu8bfbu53d6u672cu5730u5316u6587u672cuff0cu6267u884cu9009u62e9u5668u548cUserDefaultsu7684u76f8u5173u64cdu4f5cuff0cu8c03u7528u901au77e5u4e2du5fc3u7684u76f8u5173u64cdu4f5cu7b49u3002",
    "homepage": "https://github.com/dgynfi/clang_api",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "dyf": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/dgynfi/clang_api.git",
        "tag": "1.0.8"
    },
    "source_files": "clang_api/Classes/**/*.{h,m}",
    "frameworks": [
        "UIKit",
        "Foundation"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This