这是一个自定义视图,我用来在将应用发送到 App Store 或生产之前显示开发和 QA 数据。主要目标是提供关于应用运行的实际环境的有关信息。
但主要是,你可以添加任何你想要的信息,并在设备摇晃时显示它。
你可以使用它与 CocoaPods 一起
pod 'ALDebugView'
#import "ALDebugListViewController.h"。但我推荐将其放在 AppDelegate 中。(我将假设如此)ALDebugView 到哪里获取数据。为此您需要[ALDebugListViewController sharedDebugView].delegate = self;[ALDebugListViewController sharedDebugView].datasource = self;ALDebugViewDelegate:
- (NSString *)ALDebugViewTitleForDebugView:(ALDebugListViewController *)aDebugView: 当调试视图出现时设置标题的方法。- (void)ALDebugViewWillCloseView:(ALDebugListViewController *)aDebugView: 允许在关闭调试视图时执行任何操作。ALDebugViewDataSource:
- (NSUInteger)ALDebugViewNumberOfRows:(ALDebugListViewController *)aDebugView: 指示将显示的项目数量。- (NSString *)ALDebugView:(ALDebugListViewController *)aDebugView titleForCellAtRowIndexPath:(NSIndexPath *)aIndexPath: 为给定的行显示标题。- (NSString *)ALDebugView:(ALDebugListViewController *)aDebugView descriptionForCellAtRowIndexPath:(NSIndexPath *)aIndexPath: 为给定的行显示描述。- (NSString *)ALDebugView:(ALDebugListViewController *)aDebugView titleForSection:(NSUInteger)aInteger: 为节显示标题。