#define IS_IPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ?...([UIScreen instancesRespondToSelector:@selector(currentMode)] ?...([UIScreen instancesRespondToSelector:@selector(currentMode)] ?..._5 ([UIScreen instancesRespondToSelector: @selector(currentMode)] ?...CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
|| __CFRunLoopModeIsEmpty(rl, currentMode, rl->_currentMode)) { Boolean did = false; if (currentMode...) __CFRunLoopModeUnlock(currentMode); __CFRunLoopUnlock(rl); return did ?...; rl->_currentMode = currentMode; int32_t result = kCFRunLoopRunFinished; // 通知 Observers...:即将进入 RunLoop(此处有 Observer 会创建 AutoreleasePool) if (currentMode->_observerMask & kCFRunLoopEntry...(rl, currentMode, kCFRunLoopExit); __CFRunLoopModeUnlock(currentMode); __CFRunLoopPopPerRunData
CFRunLoopModeRef _currentMode; //RunLoop 当前执行的是哪个mode CFMutableSetRef _modes; //...if (__CFRunLoopModeIsEmpty(currentMode)) return; /// 1....__CFRunLoopDoObservers(runloop, currentMode, kCFRunLoopBeforeTimers); /// 3....__CFRunLoopDoBlocks(runloop, currentMode); /// 4....sourceHandledThisLoop = __CFRunLoopDoSources0(runloop, currentMode, stopAfterHandle); if
.env.build NODE_ENV = 'production' VUE_APP_CURRENTMODE = 'production' outputDir = 'dist' env.test...NODE_ENV = 'production' VUE_APP_CURRENTMODE = 'test' outputDir = 'test' 二、 域名根据变量【VUE_APP_CURRENTMODE...// axiosURL: 'http://192.168.1.xxx:9003/api/', } } else if(process.env.VUE_APP_CURRENTMODE...== "test") { https={axiosURL:configHttps.testURL} } else if(process.env.VUE_APP_CURRENTMODE == "
CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO) #define ZJDevice_Is_iPhone5...([UIScreen instancesRespondToSelector:@selector(currentMode)] ?...([UIScreen instancesRespondToSelector:@selector(currentMode)] ?...([UIScreen instancesRespondToSelector:@selector(currentMode)] ?...CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO) #define ZJScreen_Bounds
if (__CFRunLoopModeIsEmpty(currentMode)) return; /// 1....__CFRunLoopDoObservers(runloop, currentMode, kCFRunLoopBeforeTimers); /// 3....__CFRunLoopDoBlocks(runloop, currentMode); /// 4....sourceHandledThisLoop = __CFRunLoopDoSources0(runloop, currentMode, stopAfterHandle); ///...执行被加入的block __CFRunLoopDoBlocks(runloop, currentMode); /// 5.
根据屏幕分辨率判断设备,是则返回YES,不是返回NO #define isiPhone5or5sor5c ([UIScreen instancesRespondToSelector:@selector(currentMode...CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO) #define isiPhone6or6s...([UIScreen instancesRespondToSelector:@selector(currentMode)] ?...([UIScreen instancesRespondToSelector:@selector(currentMode)] ?...CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO) 那么我只需要判断这几个值哪一个是
, currentMode, rl->_currentMode)) { // 如果当前 mode 和 runloop 的 mode 都为 nil,则退出 Boolean...did = false; if (currentMode) __CFRunLoopModeUnlock(currentMode); __CFRunLoopUnlock(rl...; rl->_currentMode = currentMode; int32_t result = kCFRunLoopRunFinished; // 判断是否可以运行runloop...(rl, currentMode, kCFRunLoopEntry); // 运行RunLoop result = __CFRunLoopRun(rl, currentMode, seconds...__CFRunLoopModeUnlock(currentMode); __CFRunLoopPopPerRunData(rl, previousPerRun); rl->_currentMode
每次调用 RunLoop 的主函数时,只能指定其中一个 Mode,这个Mode被称作 CurrentMode。如果需要切换 Mode,只能退出 Loop,再重新指定一个 Mode 进入。...if (__CFRunLoopModeIsEmpty(currentMode)) return; /// 1. 通知 Observers: RunLoop 即将进入 loop。...__CFRunLoopDoObservers(runloop, currentMode, kCFRunLoopBeforeTimers); /// 3....__CFRunLoopDoBlocks(runloop, currentMode); /// 4....执行被加入的block __CFRunLoopDoBlocks(runloop, currentMode); /// 5.
、8P #define IS_iPhone678_Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ?...CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO) // 6、6s、7、8...#define IS_iPhone678 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ?...IS_iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ?...IS_iPhone4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ?
一个用于设置暗黑模式样式的工具函数,当传入布尔值时,会同时设置 html 的类名和 theme-color 的 meta 标签(ssr/csr均可用) 使用了来自 VueUse 的 useHead 方法 const currentMode...= ref(readDarkModeInStorage()) const preferredDark = usePreferredDark() watchEffect(() => { if (currentMode.value...preferredDark.value) { setModeClass(true) } else { setModeClass(false) } } else if (currentMode.value...=== 'dark') { setModeClass(true) } else if (currentMode.value === 'light') { setModeClass(...false) } useCookie('darkMode').value = currentMode.value }) 这里便是关键,首先,读入配置并初始化到 currentMode 变量,接着
|| __CFRunLoopModeIsEmpty(rl, currentMode, rl->_currentMode)) { Boolean did = false; if (currentMode...; rl->_currentMode = currentMode; int32_t result = kCFRunLoopRunFinished; /* 调用__CFRunLoopDoObservers...(rl, currentMode, kCFRunLoopEntry); //调用真正执行RunLoop循环的函数 result = __CFRunLoopRun(rl, currentMode...__CFRunLoopModeUnlock(currentMode); __CFRunLoopPopPerRunData(rl, previousPerRun); rl->_currentMode...__CFRunLoopDoBlocks(runloop, currentMode); /// 4.
(doScroll); state = MANUAL_REFRESHING; } } public final boolean hasPullFromTop() { return currentMode...= onRefreshListener) { setRefreshingInternal(true); onRefreshListener.onRefresh(currentMode...protected void setRefreshingInternal(boolean doScroll) { state = REFRESHING; setRefreshLabel(currentMode...= headerLayout) { headerLayout.refreshing(); } if (doScroll) { smoothScrollTo(currentMode =...= MODE_BOTH) { currentMode = mode; } this.mode = mode; } private void init(Context context,
if (__CFRunLoopModeIsEmpty(currentMode)) return; /// 1. 通知 Observers: RunLoop 即将进入 loop。...__CFRunLoopDoObservers(runloop, currentMode, kCFRunLoopBeforeTimers); /// 3....__CFRunLoopDoBlocks(runloop, currentMode); /// 4....sourceHandledThisLoop = __CFRunLoopDoSources0(runloop, currentMode, stopAfterHandle); ///...执行被加入的block __CFRunLoopDoBlocks(runloop, currentMode); /// 5.
__CFRunLoopDoObservers(runloop, currentMode, kCFRunLoopBeforeSources); // 4.RunLoop 触发 Source0 (非port...sourceHandledThisLoop = __CFRunLoopDoSources0(runloop, currentMode, stopAfterHandle) // 5.执行被加入的block...__CFRunLoopDoBlocks(runloop, currentMode); // 6.RunLoop 的线程即将进入休眠(sleep)。...__CFRunLoopDoTimers(runloop, currentMode, mach_absolute_time()) // 10.如果有dispatch到main_queue的block,..., source1, msg); // 12.RunLoop 即将退出 __CFRunLoopDoObservers(rl, currentMode, kCFRunLoopExit); 我们可以看到
是否iPhoneX YES:iPhoneX屏幕 NO:传统屏幕 #define kIs_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode...CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO) 多行逻辑判断 //是否...:传统屏幕 #define kIs_iPhoneX_test ({\ int tmp = 0;\ if ([UIScreen instancesRespondToSelector:@selector(currentMode...)]) {\ if (CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size)) {
image.png + (BOOL)isIPhoneX { return ([UIScreen instancesRespondToSelector:@selector(currentMode)...CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO); } 这么判断的需要修改啦
} /** 子线程任务 */ - (void)subThreadOpetion { NSLog(@"启动RunLoop后--%@",[NSRunLoop currentRunLoop].currentMode...我们只需要在执行任务的时候,打印出该RunLoop的currentMode即可。...因为RunLoop执行任务是会在mode间切换,只执行该mode上的任务,每次切换到某个mode时,currentMode就会更新。...; rl->_currentMode = currentMode; .........这中间也有一堆的逻辑 rl->_currentMode = previousMode; 我测试后,控制台输出的是: 2016-12-02 11:09:47.909 RunLoopDemo[5479:442560
每次运行__CFRunLoopRun()函数的时候都必须要指定Mode,这个Mode就是_currentMode。...|| __CFRunLoopModeIsEmpty(rl, currentMode, rl->_currentMode)) { Boolean did = false;...if (currentMode) __CFRunLoopModeUnlock(currentMode); __CFRunLoopUnlock(rl); return did...; //如果本次mode和上次的mode一致 rl->_currentMode = currentMode; //初始化一个result为kCFRunLoopRunFinished...已退出runloop if (currentMode->_observerMask & kCFRunLoopExit ) __CFRunLoopDoObservers(rl, currentMode
领取专属 10元无门槛券
手把手带您无忧上云