Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
添加 RKOCell类。
Browse files Browse the repository at this point in the history
将RKOCell从原先的控件库转移到工具库。
  • Loading branch information
rakuyoMo committed Sep 8, 2017
1 parent d87f273 commit 0cfb5a7
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 26 deletions.
62 changes: 45 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

自己平时写的一个小工具库,上传到**GitHub**中且支持`CocoaPods`,方便自己使用。不断更新完善中。

**注意:**`1.3.4`之前的版本集成了自己写的一些控件,从`1.3.4`版本开始,这些控件不再集成到`RKOTools`库中了,将会单独提供并支持`CocoaPods`。该页面则做目录之用,将会列出所有控件。
**注意:**`1.4.0`之前的版本集成了自己写的一些控件,从`1.4.0`版本开始,这些控件不再集成到`RKOTools`库中了,将会单独提供并支持`CocoaPods`。该页面则做目录之用,将会列出所有控件。

<p align="center">
<a href=""><img src="https://img.shields.io/badge/pod-v1.3.4-brightgreen.svg"></a>
<a href=""><img src="https://img.shields.io/badge/pod-v1.4.0-brightgreen.svg"></a>
<a href=""><img src="https://img.shields.io/badge/ObjectiveC-compatible-orange.svg"></a>
<a href=""><img src="https://img.shields.io/badge/platform-iOS%208.0%2B-ff69b5152950834.svg"></a>
<a href="https://github.com/rakuyoMo/RKOTools/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat"></a>
Expand All @@ -15,19 +15,19 @@


1. [RKOTools](#rkotools-1)
1. [NetWorkTool](#networktool)
2. [CloseKeyBoard](#closekeyboard)
3. [CollecionLog](#collecionlog)
4. [TopViewController](#topviewcontroller)
5. [CALayer+Additions](#calayeradditions)
6. [ImageWithColor](#imagewithcolor)
7. [~~FastFrame~~](#fastframe)
1. [RKOCell](#rkocell)
2. [NetWorkTool](#networktool)
3. [CloseKeyBoard](#closekeyboard)
4. [CollecionLog](#collecionlog)
5. [TopViewController](#topviewcontroller)
6. [CALayer+Additions](#calayeradditions)
7. [ImageWithColor](#imagewithcolor)
8. [~~FastFrame~~](#fastframe)
2. [RKOControl](#rkocontrol)
1. [RKONetworkAlert](#rkonetworkalert)
2. [RKOCell](#rkocell)
3. [RKOTextView](#rkotextview)
4. [RKOTopAlert](#rkotopalert)
5. [~~RKOTabBar~~](#rkotabbar)
2. [RKOTextView](#rkotextview)
3. [RKOTopAlert](#rkotopalert)
4. [~~RKOTabBar~~](#rkotabbar)
3. [BLOG](#blog)

## RKOTools
Expand All @@ -36,6 +36,38 @@

---------------------------------------------------------------------

### RKOCell

`xib`或者自定义`Cell`中快速获取`Cell`的一个小工具。接口如下所示:

```objc
/**
快速获取 cell
@param tableView 当前的tableView
@return 一个普通的cell
*/
+ (instancetype)cell:(UITableView *)tableView;

/**
从xib中获取cell
@param tableView 当前的tableView
@return 从xib中获取到的cell
*/
+ (instancetype)xibCell:(UITableView *)tableView;

/**
获取一个空白的cell
@param tableView 当前的tableView
@return 一个空白的cell
*/
+ (id)blankCell:(UITableView *)tableView;
```

---------------------------------------------------------------------

### NetWorkTool

自定义封装的`AFNetworking`。初学乍道还不是很完善。
Expand Down Expand Up @@ -284,10 +316,6 @@ UIKIT_EXTERN NSString * const baseURL;

---------------------------------------------------------------------

### RKOCell

---------------------------------------------------------------------

### RKOTextView

---------------------------------------------------------------------
Expand Down
13 changes: 4 additions & 9 deletions RKOTools.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Pod::Spec.new do |s|

s.name = "RKOTools"
s.version = "1.3.4"
s.version = "1.4.0"
s.summary = "One of your own tool libraries"
s.description = <<-DESC
One of your own tool libraries
Expand All @@ -30,11 +30,6 @@ Pod::Spec.new do |s|

# s.subspec 'RKOControl' do |control|

# control.subspec 'RKOCell' do |cell|

# cell.source_files = "RKOTools/RKOControl/RKOCell/*.{h,m}"
# end

# control.subspec 'RKONetworkAlert' do |networkAlert|

# networkAlert.source_files = "RKOTools/RKOControl/RKONetworkAlert/*.{h,m}"
Expand All @@ -53,8 +48,10 @@ Pod::Spec.new do |s|

# end

s.subspec 'RKOCell' do |cell|

# s.subspec 'RKOHelper' do |helper|
cell.source_files = "RKOTools/RKOCell/*.{h,m}"
end

s.subspec 'CALayer+Additions' do |additions|

Expand Down Expand Up @@ -87,6 +84,4 @@ Pod::Spec.new do |s|
imageWithColor.source_files = "RKOTools/ImageWithColor/*.{h,m}"
end

# end

end
38 changes: 38 additions & 0 deletions RKOTools/RKOCell/RKOCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// RKOCell.h
// Summary01_Rakuyo
//
// Created by Rakuyo on 2017/8/14.
// Copyright © 2017年 Rakuyo. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface RKOCell : UITableViewCell

/**
快速获取 cell
@param tableView 当前的tableView
@return 一个普通的cell
*/
+ (instancetype)cell:(UITableView *)tableView;

/**
从xib中获取cell
@param tableView 当前的tableView
@return 从xib中获取到的cell
*/
+ (instancetype)xibCell:(UITableView *)tableView;

/**
获取一个空白的cell
@param tableView 当前的tableView
@return 一个空白的cell
*/
+ (id)blankCell:(UITableView *)tableView;

@end

51 changes: 51 additions & 0 deletions RKOTools/RKOCell/RKOCell.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// RKOCell.m
// Summary01_Rakuyo
//
// Created by Rakuyo on 2017/8/14.
// Copyright © 2017年 Rakuyo. All rights reserved.
//

#import "RKOCell.h"

@implementation RKOCell

// 快速获取 cell
+ (instancetype)cell:(UITableView *)tableView {
NSString *ID = NSStringFromClass(self);
RKOCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];

if (!cell) {
[tableView registerClass:self forCellReuseIdentifier:ID];
cell = [tableView dequeueReusableCellWithIdentifier:ID];
}

return cell;
}

// 从xib中获取cell
+ (instancetype)xibCell:(UITableView *)tableView {
NSString *ID = NSStringFromClass(self);
RKOCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];

if (!cell) {
[tableView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellReuseIdentifier:ID];
cell = [tableView dequeueReusableCellWithIdentifier:ID];
}

return cell;
}

// 获取一个空白的cell
+ (id)blankCell:(UITableView*)tableView {
static NSString *const ID = @"RKOBlanckCellID";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
if (!cell) {
[tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:ID];
cell = [tableView dequeueReusableCellWithIdentifier:ID];
}
return cell;
}

@end

0 comments on commit 0cfb5a7

Please sign in to comment.