Posts

Post not yet marked as solved
0 Replies
560 Views
let videoURL = URL(fileURLWithPath: path ?? "") let asset = AVURLAsset(url: videoURL, options: nil) let imageGenerator = AVAssetImageGenerator(asset: asset) imageGenerator.appliesPreferredTrackTransform = true let time = CMTimeMultiplyByRatio(asset.duration, multiplier: 1, divisor: 2) // THIS LINE GIVES ISSUE: "'duration' was deprecated in iOS 16.0: Use load(.duration) instead". I CANNOT FIGURE OUT THE CORRECT SYNTAX FOR CHANGING asset.duration TO REPLACE WITH load(.duration). HELP WITH THE CORRECT SYNTAX WOULD BE HELPFUL.
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.6k Views
I thought this would be a no brainer and automatically work when AVPlayerViewController was implemented. Here is the implementation of AVPlayerViewController on iPad and Picture in Picture works perfectly: (void)finishCellSelectVideo:(id)videoPath {     NSURL *videoURL = [[NSURL alloc] initFileURLWithPath:videoPath];     AVPlayer *videoPlayer = [AVPlayer playerWithURL:videoURL];     videoPlayer.allowsExternalPlayback = YES;     AVPlayerViewController *videoPlayerViewController = [AVPlayerViewController new];     videoPlayerViewController.delegate = self;     videoPlayerViewController.player = videoPlayer;    [self presentViewController:videoPlayerViewController animated:YES completion:nil];        [videoPlayer play]; } However, with this same code Picture in Picture doesn't work on the iPhone in iOS 14. Does this code only work on iPad? Any clues as to what I am doing wrong with the iPhone code?
Posted Last updated
.
Post not yet marked as solved
1 Replies
752 Views
I am presenting a IUContextMenu on a UIImageView but it always shows up in the right upper hand corner of the image and not at the place touched on the UIImageView (i.e. "location"). The coordinates for "location" are correct but the menu still shows up in the right upper hand corner of the UIImageView. Project built in XCode 11 Beta 6. I can't figure out why. - (nullable UIContextMenuConfiguration *)contextMenuInteraction:(UIContextMenuInteraction *)interaction configurationForMenuAtLocation:(CGPoint)location { UIContextMenuConfiguration *configuration = [UIContextMenuConfiguration configurationWithIdentifier:nil previewProvider:nil actionProvider:^UIMenu * _Nullable(NSArray<UIMenuElement *> * _Nonnull suggestedActions) { return [self makeContextMenu]; }]; return configuration; } - (UIMenu *)makeContextMenu { UIAction *copy = [UIAction actionWithTitle:@"Copy Image" image:[UIImage systemImageNamed:@"doc.on.doc"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { [self performSelector:@selector(performCopy) withObject:nil afterDelay:1.0]; }]; return [UIMenu menuWithTitle:@"" children:@[copy]]; } - (void)performCopy { UIPasteboard *appPasteBoard = [UIPasteboard generalPasteboard]; appPasteBoard.image = imageView.image; }
Posted Last updated
.
Post not yet marked as solved
8 Replies
2.9k Views
Adding a single tap gesture to a PDFView doesn't work correctly. Code is not executed when tapping on the document in the PDFView: In viewDidLoad() ->//single tap gesturelet singleTap = UITapGestureRecognizer(target: self, action: #selector(singleTapped))singleTap.numberOfTapsRequired = 1pdfView.addGestureRecognizer(singleTap)func singleTapped() { //code to be executed_}Note though that if one taps on the light gray border around the document in the PDF view, the single tap code is executed. It‘s just that the single tap code isn’t executed when tapping on the document in the PDF view. This is still the case in iPadOS 13 beta 4. Note that the single tap gesture and the same code worked perfectly in iOS 12 when tapping on the document in the PDF view.This clearly appears to be a bug and I have filed a feedback/bug report with Apple.
Posted Last updated
.