All Projects → onlyAngelia → YAAdapterTableViewWithResponderChain

onlyAngelia / YAAdapterTableViewWithResponderChain

Licence: MIT license
No description or website provided.

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to YAAdapterTableViewWithResponderChain

100 Words Design Patterns Java
GoF Design Patterns, each pattern described with story from real life.
Stars: ✭ 117 (+680%)
Mutual labels:  adapter, strategy
Pydesignpattern
Design Pattern that described by Python, This is the source code for the book of Everybody Know Design Patterns.
Stars: ✭ 174 (+1060%)
Mutual labels:  adapter, strategy
oh-my-design-patterns
🎨 Record the articles and code I wrote while learning design patterns
Stars: ✭ 33 (+120%)
Mutual labels:  adapter, strategy
ioBroker.epson stylus px830
Zustand Druckerpatronen im EPSON Stylus PX830 für ioBroker auslesen
Stars: ✭ 18 (+20%)
Mutual labels:  adapter
ARVI
Android library designed to simplify the implementation of the video autoplay in the RecyclerView
Stars: ✭ 69 (+360%)
Mutual labels:  adapter
AdoHideTableSection
An easy way to hide or show section in a tableview
Stars: ✭ 57 (+280%)
Mutual labels:  uitableview
TradingView-Machine-Learning-GUI
Let Python optimize the best stop loss and take profits for your TradingView strategy.
Stars: ✭ 396 (+2540%)
Mutual labels:  strategy
modules
Java & REST API's for creating and running integrations
Stars: ✭ 16 (+6.67%)
Mutual labels:  adapter
Multiple-collectionView-in-Multiple-tableView-cells
UICollectionView is embed in UITableViewCell. The collection views are horizontal scrollable. The UITableView can have a section title for each UICollectionView and the number of UICollectionView is equal to the number of sections.
Stars: ✭ 23 (+53.33%)
Mutual labels:  uitableview
StackableTableView
A UITableView subclass that enables setting an array of views for both headers and footers utilizing UIStackView
Stars: ✭ 72 (+380%)
Mutual labels:  uitableview
presso
Event-driven backtest/realtime quantitative trading system.
Stars: ✭ 59 (+293.33%)
Mutual labels:  strategy
DropDownTableView
Here is a drop-down TableView.
Stars: ✭ 16 (+6.67%)
Mutual labels:  uitableview
ueberauth slack
Slack OAuth2 Strategy for Überauth
Stars: ✭ 23 (+53.33%)
Mutual labels:  strategy
guzzle-psr18-adapter
A simple guzzle PSR-18 adapter
Stars: ✭ 13 (-13.33%)
Mutual labels:  adapter
strato
Algorithmic crypto trading strategy
Stars: ✭ 40 (+166.67%)
Mutual labels:  strategy
ohloh scm
The Ohloh source control management library
Stars: ✭ 58 (+286.67%)
Mutual labels:  adapter
FakeFBWall
This is a fun app to generate fake facebook wall. All the fields visible on the screen are editable. Screenshots attached for better understanding of the app. Code written in Swift 4.
Stars: ✭ 27 (+80%)
Mutual labels:  uitableview
VPAutoComplete
A simple Auto Complete UITextField also support UITableView written in swift 4.2
Stars: ✭ 20 (+33.33%)
Mutual labels:  uitableview
Mentions
An easy way to add mentions and hashtags
Stars: ✭ 24 (+60%)
Mutual labels:  uitableview
TheGreatAdapter
Multiple items adapter made too easy, including headers and footers.
Stars: ✭ 46 (+206.67%)
Mutual labels:  adapter

ARTableView.podspec

CI Status Version License Platform

Example

1.create an adapter extends UITableViewAdapter,overwrite the delegate that you will use

2.Then setting UITableView

 [_tableView setAdapter:[self adapter]]

3.Next overwriting the func in tableView's superclass

- (void)rountEvent:(NSString *)eventName userInfo:(NSDictionary *)userInfo

4.Last create NSInvocation according to eventName

- (void)rountEvent:(NSString *)eventName userInfo:(NSDictionary *)userInfo
{
    NSInvocation *invocation = [self strategyDictionary][eventName];
    [invocation setArgument:&userInfo atIndex:2];
    [invocation invoke];
}
- (NSDictionary *)strategyDictionary{
    
    NSDictionary *strategyDictionary = @{kCCellSeletedEventName:[self createInvocationWithSeletor:@selector(jumpToController:)]};
    return strategyDictionary;
    
}

1.创建一个adapter 继承自UITableViewAdapter,在新创建的adapter中重写可能会用到的类 2.设置tableView和adapter关联一起

 [_tableView setAdapter:[self adapter]]

3.接收tableView的点击事件以及滑动事件,因这里是基于ResponderChain传递,所以只要在tableview的super中实现

- (void)rountEvent:(NSString *)eventName userInfo:(NSDictionary *)userInfo

该方法即可监听tableView的事件。 好处:避免了大量的blockdelegate

4.采用strategy模式避免n多if-else

每个点击事件最终要执行不同的@selector,所以我们可以采用策略模式,直接取消[self performSelector:<#(nonnull SEL)#> withObject:<#(nullable id)#>]@selector定义为更深一层NSInvocation,用NSDictionary存储

- (void)rountEvent:(NSString *)eventName userInfo:(NSDictionary *)userInfo
{
    NSInvocation *invocation = [self strategyDictionary][eventName];
    [invocation setArgument:&userInfo atIndex:2];
    [invocation invoke];
}
- (NSDictionary *)strategyDictionary{
    
    NSDictionary *strategyDictionary = @{kCCellSeletedEventName:[self createInvocationWithSeletor:@selector(jumpToController:)]};
    return strategyDictionary;
    
}

Requirements

you need to import"UITableView+adapter"

Installation

ARTableView.podspec is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ARTableView', '~> 1.0.2'

Then run a pod install inside your terminal

Author

onlyAngelia, 关门滢

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].