Hi,
How can I pause/play the now playing song with MedaiRemote framework
Thanks!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi,
How can I override property shadowColor from NSShadow?
thanks!
Hi,
How can I add vibrancy to image/NSButton for example my play button (macOS)
I found a SwiftUI library for this but I don't use swift UI
https://github.com/lucasbrown/swiftui-visual-effects
My app
Hi,
I'm trying to resize my rect with CABasicAnimation and the animation go to up and not down
How can I change it?
Video:
https://streamable.com/nw4ekc
Thank you!
let newFrame = NSRect(x: blueRect.frame.origin.x, y: blueRect.frame.origin.y - 100,width: blueRect.frame.size.width, height: 200)
let animation = CABasicAnimation(keyPath: "bounds")
animation.fromValue = NSValue(rect: blueRect.frame)
animation.toValue = NSValue(rect: newFrame)
animation.duration = 0.5 // Animation duration in seconds
blueRect.layer?.add(animation, forKey: "sizeAnimation")
// Update the rect view's size and origin
blueRect.frame = newFrame
Hi,
Is it possible to turn on airplane mode on watchOS using swift? or possible to know the state of airplane mode?
thank you
Hi.
Is it possible to get all Safari/Chrome open tabs with AppleScript? Is it also possible to check if tab audio is enable/play video/music?
macOS
Thank you!
Hi,
How is it possible to check if I have a new mail? Is it possible to do it with ScriptingBridge?
Thank you!
Hi,
I made a "Finder view" with SwiftUI, how is it possible to call viewModel.selectFileWithAnimation(file) when .contextMenu show?
Thank you!
@StateObject private var viewModel = FilesViewModel() // Use the view model to manage data and logic
var body: some View {
VStack {
// Horizontal scrolling of files and folders
ScrollView(.horizontal, showsIndicators: false) {
if viewModel.sortedAndFilteredFolderContents.isEmpty {
// Show "No Results" if no files or folders found
Text("No Results")
.font(.headline)
.foregroundColor(.almostWhite)
.padding()
} else {
HStack(spacing: 20) {
ForEach(viewModel.sortedAndFilteredFolderContents, id: \.self) { file in
VStack {
ZStack {
// Selection effect without matchedGeometryEffect
if viewModel.selectedFile == file {
RoundedRectangle(cornerRadius: 10)
.fill(Color.blue.opacity(0.2))
.transition(.opacity)
.frame(width: 80, height: 100)
.animation(.easeInOut(duration: 0.3), value: viewModel.selectedFile)
}
VStack {
Image(nsImage: viewModel.getFileIcon(for: file))
.resizable()
.frame(width: 64, height: 64)
.onTapGesture(count: 2) {
// Select and open file/folder on double-tap
viewModel.selectFileWithAnimation(file)
viewModel.openFileOrFolder(file)
}
.onTapGesture {
viewModel.selectFileWithAnimation(file)
}
.onLongPressGesture(minimumDuration: 0.5) {
// Rename file with long press
viewModel.rename(file)
}
.contextMenu {
// Define your context menu buttons here
Button(action: {
viewModel.showInFinder(file)
}) {
Text("Show in Finder")
Image(systemName: "folder")
}
Button(action: {
viewModel.moveToTrash(file)
}) {
Text("Move to Trash")
Image(systemName: "trash")
}
Button(action: {
viewModel.rename(file)
}) {
Text("Rename")
Image(systemName: "pencil")
}
Button(action: {
viewModel.makeAlias(for: file)
}) {
Text("Make Alias")
Image(systemName: "link")
}
Button(action: {
viewModel.compress(file)
}) {
Text("Compress \(file.lastPathComponent)")
Image(systemName: "archivebox")
}
Button(action: {
viewModel.copyFile(file)
}) {
Text("Copy")
Image(systemName: "doc.on.doc")
}
Button(action: {
viewModel.shareFile(file, in: dynaClip.view)
}) {
Text("Share")
Image(systemName: "square.and.arrow.up")
}
}
Text(file.lastPathComponent)
.font(.caption)
.lineLimit(1)
.truncationMode(.tail)
.frame(width: 80)
}
}
}
}
}
.padding(.top, 20)
}
}
Hi,
I'm using NSPanel that his level is .popUpMenu and when I use .quickLookPreview in SwiftUI it make the the Quick Look behind the nspanel how can I fix it without change the level of NSPanel?
Hi,
I'm working on integrating iCloud Drive functionality into my app. I noticed that the folder for my app appears under /Users/USERNAME/Library/Mobile Documents/MY_CONTAINER, but it doesn't show up in iCloud Drive.
Am I missing a step in the setup or configuration? Any guidance would be appreciated!
Thanks!
Hi
After I added iCloud container and iCloud documents my UITests can't run anymore what is this problem and how can I solve it?
Thanks!
Hi,
How can I make NSTextField vibracny?
I added a NSVisualEffectView and add a label
how can I make my label vibrancy
https://imgur.com/a/Y6axxms
Thanks!
Hi,
I just updated to macOS Monterey and Xcode 13.1 and the NSButtons on my view not work anymore I tap and nothing work
let visualEffect = NSVisualEffectView()
//var theme = NSAppearance(appearanceNamed: NSAppearance.Name.vibrantDark, bundle: nil)
visualEffect.translatesAutoresizingMaskIntoConstraints = false
visualEffect.blendingMode = .behindWindow
visualEffect.state = .active
visualEffect.wantsLayer = true
visualEffect.layer?.cornerRadius = roundvalueDefault.value(forKey: "roundvaluekey") as! CGFloat
visualEffect.layer?.opacity = 0.0
window?.isOpaque = false
window?.backgroundColor = .clear //Make window transpraent
window?.isMovableByWindowBackground = true
checkAlt() //Check if floating
//Custom toolbar
let customToolbar = NSToolbar()
customToolbar.isVisible = true
window?.titleVisibility = .hidden
window?.styleMask.insert(.fullSizeContentView)
window?.titlebarAppearsTransparent = true
customToolbar.showsBaselineSeparator = false
window?.contentView?.wantsLayer = true
window?.toolbar = customToolbar
//Change windows radius
//Add the blur effcet to the window
window?.contentView?.addSubview(visualEffect)
guard let constraints = window?.contentView else {
return
}
visualEffect.leadingAnchor.constraint(equalTo: constraints.leadingAnchor).isActive = true
visualEffect.trailingAnchor.constraint(equalTo: constraints.trailingAnchor).isActive = true
visualEffect.topAnchor.constraint(equalTo: constraints.topAnchor).isActive = true
visualEffect.bottomAnchor.constraint(equalTo: constraints.bottomAnchor).isActive = true
}
@IBAction func airplayTapped(_ sender: Any) {
print("AAA")
}
Hi,
How can I release my NSWindow manually? when the user tap on red close button?
@objc func windowWillClose() {
// Handle the window closing event here
// You can perform any necessary cleanup or ask the user for confirmation
// Return true to allow the window to close
_window?.contentViewController = nil
_window?.delegate = nil
_window = nil
NotificationCenter.default.removeObserver(self, name: NSWindow.willCloseNotification, object: nil)
}
//Settings cell tap
@objc func settingsItemClicked () {
//_window:NSWindow?
NotificationCenter.default.addObserver(self, selector: #selector(windowWillClose), name: NSWindow.willCloseNotification, object:_window)
if _window?.isVisible == false {
// Load the view controller from the storyboard
let storyboard = NSStoryboard(name: "Main", bundle: nil)
guard let ViewController = storyboard.instantiateController(withIdentifier: "SettingsViewController") as? SettingsViewController else {
fatalError("Unable to instantiate SettingsViewController from storyboard.")
}
// _window.delegate = self
// Set the view controller as the content view controller of the window
_window?.contentViewController = ViewController
_window?.isReleasedWhenClosed = false
_window?.hidesOnDeactivate = true
// Set the window's title
_window?.title = "DynamicLake"
// Show the window
_window?.makeKeyAndOrderFront(self)
}else{
print("The settings view is already open")
}
}
I'm trying to capture audio samples from the selected output device on macOS using ScreenCaptureKit?
Thank you