@@ -211,13 +211,6 @@ - (void)renameFileForIndexPath:(NSIndexPath *)indexPath {
211
211
NSURL *audioURL = [documentsURL URLByAppendingPathComponent: [NSString stringWithFormat: @" YTMusicUltimate/%@ " , self .audioFiles[indexPath.row]]];
212
212
NSURL *coverURL = [documentsURL URLByAppendingPathComponent: [NSString stringWithFormat: @" YTMusicUltimate/%@ .png" , [self .audioFiles[indexPath.row] stringByDeletingPathExtension ]]];
213
213
214
- // UITextField *textField = [[UITextField alloc] init];
215
- // textField.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;
216
- // textField.clearButtonMode = UITextFieldViewModeWhileEditing;
217
- // textField.borderStyle = UITextBorderStyleRoundedRect;
218
- // textField.text = [self.audioFiles[indexPath.row] stringByDeletingPathExtension];
219
- // textField.placeholder = [self.audioFiles[indexPath.row] stringByDeletingPathExtension];
220
-
221
214
UITextView *textView = [[UITextView alloc ] init ];
222
215
textView.backgroundColor = [[UIColor blackColor ] colorWithAlphaComponent: 0.15 ];
223
216
textView.layer .cornerRadius = 3.0 ;
@@ -375,14 +368,7 @@ - (void)removeAll {
375
368
NSURL *documentsURL = [[[NSFileManager defaultManager ] URLsForDirectory: NSDocumentDirectory inDomains: NSUserDomainMask] lastObject ];
376
369
NSURL *audiosFolder = [documentsURL URLByAppendingPathComponent: @" YTMusicUltimate" ];
377
370
378
- UIAlertController *alert = [UIAlertController alertControllerWithTitle: nil
379
- message: [NSString stringWithFormat: LOC (@" DELETE_MESSAGE" ), LOC (@" ALL_DOWNLOADS" )]
380
- preferredStyle: UIAlertControllerStyleAlert];
381
-
382
- [alert addAction: [UIAlertAction actionWithTitle: LOC (@" CANCEL" ) style: UIAlertActionStyleDefault handler: ^(UIAlertAction *action) {
383
- }]];
384
-
385
- [alert addAction: [UIAlertAction actionWithTitle: LOC (@" DELETE" ) style: UIAlertActionStyleDestructive handler: ^(UIAlertAction *action) {
371
+ YTAlertView *alertView = [NSClassFromString (@" YTAlertView" ) confirmationDialogWithAction: ^{
386
372
BOOL audiosRemoved = [[NSFileManager defaultManager ] removeItemAtURL: audiosFolder error: nil ];
387
373
388
374
if (audiosRemoved) {
@@ -393,9 +379,11 @@ - (void)removeAll {
393
379
[self .tableView reloadData ];
394
380
});
395
381
}
396
- }]];
397
-
398
- [self presentViewController: alert animated: YES completion: nil ];
382
+ }
383
+ actionTitle: LOC (@" DELETE" )];
384
+ alertView.title = @" YTMusicUltimate" ;
385
+ alertView.subtitle = [NSString stringWithFormat: LOC (@" DELETE_MESSAGE" ), LOC (@" ALL_DOWNLOADS" )];
386
+ [alertView show ];
399
387
}
400
388
401
389
@end
0 commit comments