iossvprogresshud

AdColony + SVProgressHUD Conflict


I'm experiencing some odd behavior when integrating AdColony's 2.2.4 library with an application using SVProgressHUD. If the standard configuration call is made in the app delegate...

[AdColony configureWithAppID:kAdColonyAppID zoneIDs:@[kAdColonyZoneID] delegate:nil logging:true];

SVProgressHUD no longer pops up in the app by calling

[SVProgressHUD showWithStatus@"Status..."];

Simply commenting out the AdColony configureWithAppID call causes SVProgressHUD to function again normally. Has anyone else encountered this, or found a way to make them both work in the same application?


Solution

  • It looks like the SVProgressHUD code is doing a check on line 436 that doesn't take into account that there can be multiple UIWindows in existence belonging to the UIWindowLevelNormal level. The consequence of this is that the HUD view is being added to the wrong window. In order to get the SVProgressHUD working, you can modify the for loop starting on line 436 as follows:

    for (UIWindow *window in frontToBackWindows) {
        if (window.keyWindow) {
            [window addSubview:self.hudView];
            break;
        }
    }
    

    Please feel free to contact us (support@adcolony.com) with any further integration questions you may have.