Latest 0.1.1
Homepage https://github.com/CharlsPrince/MyComponents
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit, Foundation, CoreGraphics
Authors

CI Status
Version
License
Platform

Example

要运行示例项目,请将仓库clone到本地,cd到仓库根目录,执行pod install即可。

简介


MyComponents (OC版本) 是一个组件集,将开发中常用的组件集合起来,提供快捷操作方法,尽量避免一个项目引入多个库。

安装


MyComponents 可以通过 Cocoapods 进行安装,可以复制下面的文字到 Podfile 中:

如果想要使用组件库中所有的组件时,可以:

target '项目名称' do
    pod "MyComponents", '~> [版本号]'
end

如果想要使用组件库中某个组件时,可以:

target '项目名称' do
    pod "MyComponents/**", '~> [版本号]'
end

按需加载 EasyKVO 组件
target '项目名称' do
    pod "MyComponents/EasyKVO", '~> 0.1.1'
end

组件结构

  • EasyKVO: 便捷的KVO监听方式

使用方法

EasyKVO

便捷的KVO监听方式,在需要使用的位置导入头文件:

Cocoapods导入方式
#import <MyComponents/NSObject+EasyKVO.h> 
拖拽文件导入方式
#import "MyComponents/NSObject+EasyKVO.h"

接口说明:

// 添加KVO监听
- (void)easy_addObserver:(NSObject * _Nonnull)object forKeyPath:(NSString * _Nonnull)keyPath easyBlock:(nullable EasyBlock)block;

// 移除所有的监听者
- (void)easy_removeAllObservers;

// 移除 keyPath 对应的所有监听者
- (void)easy_removeObserverForKeyPath:(nullable NSString *)keyPath;

作者

CharlsPrince, [email protected]

License

MyComponents is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "MyComponents",
    "version": "0.1.1",
    "summary": "u8fd9u662fu79c1u4ebau7684u7ec4u4ef6u5e93",
    "description": "This is a private component library.",
    "homepage": "https://github.com/CharlsPrince/MyComponents",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "CharlsPrince": "[email protected],com"
    },
    "source": {
        "git": "https://github.com/CharlsPrince/MyComponents.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "MyComponents/Classes/*.*",
    "public_header_files": "MyComponents/Classes/*.*",
    "requires_arc": true,
    "frameworks": [
        "UIKit",
        "Foundation",
        "CoreGraphics"
    ],
    "subspecs": [
        {
            "name": "TestObject",
            "source_files": "MyComponents/Classes/TestObject/*.{h,m}",
            "public_header_files": "MyComponents/Classes/TestObject/*.h",
            "frameworks": [
                "UIKit",
                "Foundation"
            ]
        },
        {
            "name": "RewardSuccess",
            "source_files": "MyComponents/Classes/RewardSuccess/*.{h,m}",
            "public_header_files": "MyComponents/Classes/RewardSuccess/*.h",
            "frameworks": [
                "UIKit",
                "Foundation"
            ],
            "resource_bundles": {
                "success_star": [
                    "[email protected]"
                ]
            }
        },
        {
            "name": "EasyKVO",
            "source_files": "MyComponents/Classes/EasyKVO/*.{h,m}",
            "public_header_files": "MyComponents/Classes/EasyKVO/*.h",
            "frameworks": [
                "UIKit",
                "Foundation"
            ]
        }
    ]
}

Pin It on Pinterest

Share This