Is there a (legal) way to capture the ENTIRE screen under iOS?

前端 未结 5 583
悲哀的现实
悲哀的现实 2021-01-19 01:10

I\'ve tried several techniques to capture a screenshot of an app from within that app. None of the techniques appear to capture the status bar -- it ends up being black.

5条回答
  •  没有蜡笔的小新
    2021-01-19 01:59

    Your actual issue, determining if a network interface is active, can be resolved with BSD networking functions. BEHOLD.

    #include 
    #include 
    #include 
    
    BOOL IsNICTurnedOn(const char *nicName) {
        BOOL result = NO;
    
        struct ifaddrs *addrs = NULL;
        if (0 == getifaddrs(&addrs)) {
            for (struct ifaddrs *addr = addrs; addr != NULL; addr = addr->ifa_next) {
                if (0 == strcmp(addr->ifa_name, nicName)) {
                    result = (0 != (addr->ifa_flags & (IFF_UP | IFF_RUNNING)));
                    break;
                }
            }
            freeifaddrs(addrs);
        }
    
        return result;
    }
    

    To use this function:

    BOOL isWWANEnabled = IsNICTurnedOn("pdp_ip0");
    BOOL isWiFiEnabled = IsNICTurnedOn("en0");
    

提交回复
热议问题