@@ -211,13 +211,6 @@ - (void)renameFileForIndexPath:(NSIndexPath *)indexPath {
211211 NSURL *audioURL = [documentsURL URLByAppendingPathComponent: [NSString stringWithFormat: @" YTMusicUltimate/%@ " , self .audioFiles[indexPath.row]]];
212212 NSURL *coverURL = [documentsURL URLByAppendingPathComponent: [NSString stringWithFormat: @" YTMusicUltimate/%@ .png" , [self .audioFiles[indexPath.row] stringByDeletingPathExtension ]]];
213213
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-
221214 UITextView *textView = [[UITextView alloc ] init ];
222215 textView.backgroundColor = [[UIColor blackColor ] colorWithAlphaComponent: 0.15 ];
223216 textView.layer .cornerRadius = 3.0 ;
@@ -375,14 +368,7 @@ - (void)removeAll {
375368 NSURL *documentsURL = [[[NSFileManager defaultManager ] URLsForDirectory: NSDocumentDirectory inDomains: NSUserDomainMask] lastObject ];
376369 NSURL *audiosFolder = [documentsURL URLByAppendingPathComponent: @" YTMusicUltimate" ];
377370
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: ^{
386372 BOOL audiosRemoved = [[NSFileManager defaultManager ] removeItemAtURL: audiosFolder error: nil ];
387373
388374 if (audiosRemoved) {
@@ -393,9 +379,11 @@ - (void)removeAll {
393379 [self .tableView reloadData ];
394380 });
395381 }
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 ];
399387}
400388
401389@end
0 commit comments