diff --git a/ios/RNToasty.m b/ios/RNToasty.m index 1f82e28..7a1c713 100644 --- a/ios/RNToasty.m +++ b/ios/RNToasty.m @@ -45,6 +45,10 @@ - (dispatch_queue_t)methodQueue style.messageFont = [UIFont systemFontOfSize: [titleSize intValue]]; } + if(duration != nil) { + duration = duration.intValue == 0 ? [NSNumber numberWithFloat:1.0] : [NSNumber numberWithFloat:3.0]; + } + const NSString *toastPosition = [self getPosition: position]; UIWindow *window = [[UIApplication sharedApplication] keyWindow]; @@ -52,7 +56,7 @@ - (dispatch_queue_t)methodQueue // toast with all possible options [window makeToast: title - duration: 3.0 + duration: duration.floatValue position: toastPosition title: nil image: drawable