Skip to content

通过应用内全局悬浮切换按钮+交易框架改造+多target实现 模拟/真实数据一键切换

License

Notifications You must be signed in to change notification settings

JuneCheng/JCMockSwitchView

Repository files navigation

JCMockSwitchView

模拟/真实数据切换

效果图

使用方法

@interface SceneDelegate ()

@property (nonatomic, strong) JCMockSwitchView *mockView;///<

@end

@implementation SceneDelegate


- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
    UIWindowScene *windowScene = (UIWindowScene *)scene;
    self.window = [[UIWindow alloc] initWithWindowScene:windowScene];
    self.window.frame = windowScene.coordinateSpace.bounds;
    self.window.rootViewController = [ViewController new];
    [self.window makeKeyAndVisible];
    
    [self addMockView];
}

- (void)addMockView {
    // DEBUG模式下显示模拟数据切换按钮
    self.mockView = [[JCMockSwitchView alloc] initWithFrame:CGRectMake(10, 20*5, 0, 0)];
#ifdef DEBUG
    [[UIApplication sharedApplication].keyWindow addSubview:self.mockView];
#endif
}

@end

About

通过应用内全局悬浮切换按钮+交易框架改造+多target实现 模拟/真实数据一键切换

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published