Post

Replies

Boosts

Views

Activity

Reply to NSOpenPanel navigate to connected iPad?
@IBAction func selectLisaIngestPreviewFolder(_ sender: Any) { let openPanel = NSOpenPanel() openPanel.canChooseFiles = false openPanel.canChooseDirectories = true openPanel.message = "Select Lisa Preview folder" let response = openPanel.runModal() switch response.rawValue { case 1000: print(response.rawValue) case 1001: print(response.rawValue) default: return } }
Topic: Programming Languages SubTopic: Swift Tags:
May ’23
Reply to Issue adding Apple ProRaw (DNG) files to Photos Library
I tried a different approach to adding the images to the Photo Library, using: func createStillAssetOnAlbum(asset: URL, album: PHAssetCollection) { let photoURL = asset PHPhotoLibrary.shared().performChanges ({ let creationRequest = PHAssetCreationRequest.forAsset() let placeHolderAsset = creationRequest.placeholderForCreatedAsset creationRequest.addResource(with: .photo, fileURL: photoURL, options: nil) guard let albumChangeRequest = PHAssetCollectionChangeRequest(for: album) else { print("album change request has failed") return } albumChangeRequest.addAssets([placeHolderAsset] as NSArray) }, completionHandler: { success, error in if success { print("photo (and adjustments) saved successfully") self.importCount += 1 } else if let e = error { print("error saving photo (and adjustment): \(e)") self.nonImportedImageCount += 1 } }) } This seems to work as I would expect.
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’23
Reply to Modifying App Bundle
There may be a better (or "more correct") solution but I solved it by copying the file I needed into the user's Documents directory then deleting it when it was no longer needed. (it only needed to be there for fraction of a second.)
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to NSOpenPanel navigate to connected iPad?
@IBAction func selectLisaIngestPreviewFolder(_ sender: Any) { let openPanel = NSOpenPanel() openPanel.canChooseFiles = false openPanel.canChooseDirectories = true openPanel.message = "Select Lisa Preview folder" let response = openPanel.runModal() switch response.rawValue { case 1000: print(response.rawValue) case 1001: print(response.rawValue) default: return } }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Issue adding Apple ProRaw (DNG) files to Photos Library
I tried a different approach to adding the images to the Photo Library, using: func createStillAssetOnAlbum(asset: URL, album: PHAssetCollection) { let photoURL = asset PHPhotoLibrary.shared().performChanges ({ let creationRequest = PHAssetCreationRequest.forAsset() let placeHolderAsset = creationRequest.placeholderForCreatedAsset creationRequest.addResource(with: .photo, fileURL: photoURL, options: nil) guard let albumChangeRequest = PHAssetCollectionChangeRequest(for: album) else { print("album change request has failed") return } albumChangeRequest.addAssets([placeHolderAsset] as NSArray) }, completionHandler: { success, error in if success { print("photo (and adjustments) saved successfully") self.importCount += 1 } else if let e = error { print("error saving photo (and adjustment): \(e)") self.nonImportedImageCount += 1 } }) } This seems to work as I would expect.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to AVPlayerView.beginTrimming Question
I've tried every combination of interface options, sandboxed, unsandboxed, permissions changes to the .mov files... doesn't seem to have helped. Can anyone lend some insight?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Composite two NSImages
I think I discovered that CIFilter allows me to do this with CIImage that I then convert to NSImage. (unless there is a better, simpler way?)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to Modifying App Bundle
There may be a better (or "more correct") solution but I solved it by copying the file I needed into the user's Documents directory then deleting it when it was no longer needed. (it only needed to be there for fraction of a second.)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to MacOs - NSTableView, editing single cell
I'm using a cell based NSTableView.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Sep ’21