A Swift package that provides resizable popover windows for macOS applications.
Screen.Recording.2025-05-30.at.10.44.14.mov
- 🔄 Support for resizing popover windows by dragging edges and corners
- 📏 Configurable minimum and maximum size constraints
- 🎯 Precise mouse interaction with cursor feedback
- ⚡ High performance with smooth resizing experience
- macOS 14.0+
- Swift 5.9+
Want to see it in action immediately? Check out the example project in the Example/ folder!
- Open
Example/ResizablePopover.xcodeproj - Build and run
- Experience the resizable popover windows
In your Xcode project:
- Select File → Add Package Dependencies...
- Enter the repository URL:
https://github.com/YourUsername/ResizablePopover.git - Choose version or branch
- Click Add Package
Or add it to your Package.swift file:
dependencies: [
.package(url: "https://github.com/YourUsername/ResizablePopover.git", from: "1.0.0")
]Then add it to your target:
.target(
name: "YourTarget",
dependencies: ["ResizablePopover"]
)class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet var window: NSWindow!
private lazy var contentViewController: NSViewController = {
let contentView = NSView()
let textField = NSTextField(labelWithString: "This is a resizable popover example.")
contentView.addSubview(textField)
textField.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
textField.centerXAnchor.constraint(equalTo: contentView.centerXAnchor),
textField.centerYAnchor.constraint(equalTo: contentView.centerYAnchor)
])
let result = NSViewController()
result.view = contentView
return result
}()
private lazy var popoverController: ResizablePopover = {
let result = ResizablePopover(minSize: NSMakeSize(300, 300), maxSize: NSMakeSize(600, 600))
result.contentViewController = contentViewController
return result
}()
@IBAction func showPopover(_ sender: NSButton) {
popoverController.show(relativeTo: sender.bounds, of: sender, preferredEdge: .maxY)
}
}Issues and Pull Requests are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.