// Initialization
DMLSelector *selector = [[DMLSelector alloc] initWithFrame:CGRectZero];
selector.dataSource = self;
selector.delegate = self;
// Implement dataSource
- (NSUInteger)numberOfComponentsInSelector:(DMLSelector *)selector
{
return self.selectorComponentDescriptors.count;
}
- (DMLSelectorComponentDescriptor *)selector:(DMLSelector *)selector componentDescriptorForComponentAtIndex:(NSUInteger)index
{
return self.selectorComponentDescriptors[index];
}
// Implement delegate
- (void)selector:(DMLSelector *)selector didSelectComponentAtIndexPath:(DMLSelectorIndexPath *)indexPath
{
NSLog(@"%s\n values:%@", __func__, selector.selectorValues);
}
要运行示例项目,请克隆仓库,并首先从 Example 目录运行 pod install
。
DMLSelector 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod "DMLSelector"
DMLSelector 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。