Skip to content

hideLoading ​

Overview ​

hideLoading:options: hides the loading indicator that is currently being displayed.

This interface is typically used together with showLoading:options:, and is called after an asynchronous task completes, a request ends, or an error occurs, to dismiss the loading indicator on the page.

Type Declaration ​

objectivec
@interface SUDOPHideLoadingOptions : NSObject

@property(nonatomic, assign) BOOL noConflict;

@end

Method Declaration ​

objectivec
/**
 Hides the currently displayed loading indicator.
 @param stateHandle The state handle object that manages the operation state and callbacks.
 @param options The options configuration for hiding the loading indicator (e.g., animated or not).
 */
- (void)hideLoading:(id<SUDOPStateHandle>)stateHandle
            options:(SUDOPHideLoadingOptions *)options;

Parameters ​

SUDOPHideLoadingOptions ​

ParameterTypeRequiredDescription
noConflictBOOLNoWhether to enable the non-conflicting hide strategy. The actual behavior depends on the SDK implementation, and is typically used to avoid hiding a loading indicator being displayed by another business or another caller.

Method Parameters ​

ParameterTypeRequiredDescription
stateHandleid<SUDOPStateHandle>YesThe state handle object, used to manage the current operation state and callbacks.
optionsSUDOPHideLoadingOptions *YesThe configuration object for hiding the loading indicator.

Example ​

objectivec
id<SUDOPStateHandle> stateHandle = self.stateHandle;

SUDOPHideLoadingOptions *options = [[SUDOPHideLoadingOptions alloc] init];
options.noConflict = YES;

[self hideLoading:stateHandle options:options];

Common Usage Together ​

objectivec
id<SUDOPStateHandle> stateHandle = self.stateHandle;

SUDOPShowLoadingOptions *showOptions = [[SUDOPShowLoadingOptions alloc] init];
showOptions.mask = YES;
showOptions.title = @"Loading...";

[self showLoading:stateHandle options:showOptions];

// Hide the loading indicator after the asynchronous task completes
SUDOPHideLoadingOptions *hideOptions = [[SUDOPHideLoadingOptions alloc] init];
hideOptions.noConflict = YES;

[self hideLoading:stateHandle options:hideOptions];

Process Flow ​

  1. A loading indicator displayed via showLoading:options: already exists in the current page or global environment.
  2. The business side creates a SUDOPHideLoadingOptions object.
  3. Set noConflict as needed.
  4. Call hideLoading:options:.
  5. The SDK hides the loading indicator that is currently being displayed.
  6. The execution result or exception information is returned via the state callback.

Notes ​

  • hideLoading:options: should generally be called after showLoading:options:.
  • stateHandle should not be empty; otherwise the SDK may fail to correctly manage the current operation state or callbacks.
  • options should not be empty.
  • If there is no loading indicator currently being displayed, calling this method may not produce any visible effect.
  • The exact semantics of noConflict depend on the actual SDK implementation; if the SDK supports multi-loading scenarios, this field may be used to avoid mistakenly hiding a loading indicator in another calling context.
  • It is recommended to call hide loading in all branches of an asynchronous task—success, failure, cancellation, etc.—to avoid a leftover loading indicator.
  • This method has no synchronous return value; the hide result or exception information should be based on the SDK callback or state callback.