Updated on 2024-07-30 GMT+08:00

Displaying a Toast Message

showToast

API Description

This API is used to display a toast.

Method Definition

1
- (void)showToast:(HWMUISDKToastInfoModel *)info;

Parameter Description

Table 1 Parameter description

Parameter

Mandatory

Type

Description

info

Yes

HWMUISDKToastInfoModel

Message information.

Table 2 HWMUISDKToastInfoModel description

Parameter

Type

Description

content

NSString *

Toast message.

duration

NSInteger

Display duration, in seconds.

Return Values

None

Sample Code
1
2
3
4
5
HWMUISDKToastInfoModel * info = [[HWMUISDKToastInfoModel alloc] init];
// Obtain the message and duration from the text box.
info.content = self.toastContentView.textField.stringValue;
info.duration = self.toastDurationInfoView.textField.intValue;
[[HWMBizSdk getBizOpenApi] showToast:info];