mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-04 06:58:20 +02:00
Add the upload statistic
This commit is contained in:
@@ -39,6 +39,30 @@ static NSMutableDictionary* pendingMediaLoadersByURL = nil;
|
||||
return sharedMediaManager;
|
||||
}
|
||||
|
||||
+ (NSString*)formatSecondsInterval:(CGFloat)secondsInterval {
|
||||
NSMutableString* formattedString = [[NSMutableString alloc] init];
|
||||
|
||||
if (secondsInterval < 1) {
|
||||
[formattedString appendString:@"< 1s"];
|
||||
} else if (secondsInterval < 60)
|
||||
{
|
||||
[formattedString appendFormat:@"%ds", (int)secondsInterval];
|
||||
}
|
||||
else if (secondsInterval < 3600)
|
||||
{
|
||||
[formattedString appendFormat:@"%dm %2ds", (int)(secondsInterval/60), ((int)secondsInterval) % 60];
|
||||
}
|
||||
else if (secondsInterval >= 3600)
|
||||
{
|
||||
[formattedString appendFormat:@"%dh %dm %ds", (int)(secondsInterval / 3600),
|
||||
((int)(secondsInterval) % 3600) / 60,
|
||||
(int)(secondsInterval) % 60];
|
||||
}
|
||||
[formattedString appendString:@" left"];
|
||||
|
||||
return formattedString;
|
||||
}
|
||||
|
||||
+ (UIImage *)resize:(UIImage *)image toFitInSize:(CGSize)size {
|
||||
UIImage *resizedImage = image;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user