Please look at the implementation of HUDForView. You will see, that it searches through all subviews for a running HUD. This means that it is not a constructor. It does something different and we need this method in swift. Reimplementing this in swift is also not possible because the hasFinished property is also not exported to swift either. See my comments in #543 and #450
the function is not exported to swift (4.2):
+ (nullable MBProgressHUD *)HUDForView:(UIView *)view;
If renamed to i.e. "findHUDForView" it is accessible from swift by:
MBProgressHUD.find(for: myViewParam)
Instead of renaming you can add the following (new line!) after the definition in the header file:
+ (nullable MBProgressHUD *)HUDForView:(UIView *)view
NS_SWIFT_NAME(find(for:));
With this "annotation" the method can be called from swift 4.2 with:
MBProgressHUD.find(for: myViewParam)
Originally posted by @merkury in https://github.com/jdg/MBProgressHUD/issues/450#issuecomment-450905923
Please look at the implementation of HUDForView. You will see, that it searches through all subviews for a running HUD. This means that it is not a constructor. It does something different and we need this method in swift. Reimplementing this in swift is also not possible because the hasFinished property is also not exported to swift either. See my comments in #543 and #450