Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

macos-appkit-interop

/macos-appkit-interop

Łączy SwiftUI z AppKit w wąskim zakresie: reprezentacje, panele, menu i łańcuch respondera na macOS.

Licencja
MIT
Ostatnia zmiana repozytorium
03.11.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
5
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 03.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Łączy SwiftUI z AppKit w wąskim zakresie: reprezentacje, panele, menu i łańcuch respondera na macOS.

Oryginalny opis (EN)

Bridge macOS SwiftUI into AppKit narrowly. Use when implementing representables, reaching NSWindow or panels, handling menus, or using the responder chain.

Jak działa

  1. Quick Start
  2. Choose The Smallest Bridge
  3. Workflow
  4. References
  5. Guardrails
  6. Output Expectations
Sekcje z nagłówków SKILL.md, w oryginale · 65 linii, 376 słów
Podgląd SKILL.md
---
name: macos-appkit-interop
description: Bridge macOS SwiftUI into AppKit narrowly. Use when implementing representables, reaching NSWindow or panels, handling menus, or using the responder chain.
---

# AppKit Interop

## Quick Start

Use this skill when SwiftUI is close but not quite enough for native macOS behavior.
Keep the bridge as small and explicit as possible. SwiftUI should usually remain
the source of truth, while AppKit handles the imperative edge.

## Choose The Smallest Bridge

- Use pure SwiftUI when the required behavior already exists in scenes, toolbars, commands, inspectors, or standard controls.
- Use `NSViewRepresentable` when you need a specific AppKit view with lightweight lifecycle needs.
- Use `NSViewControllerRepresentable` when you need controller lifecycle, delegation, or presentation coordination.
- Use direct AppKit window or app hooks when you need `NSWindow`, responder-chain, menu validation, panels, or app-level behavior.

## Workflow

1. Name the capability gap precisely.
   - Window behavior
   - Text system behavior
   - Menu validation
   - Drag and drop
   - File open/save panels
   - First responder control

2. Pick the smallest boundary that solves it.
   - Avoid porting a whole screen to AppKit when one wrapped control or coordinator would do.

3. Keep ownership explicit.
   - SwiftUI owns value state, selection, and observable models.
   - AppKit objects stay inside the representable, coordinator, or bridge object.

4. Expose a narrow interface back to SwiftUI.
   - Bindings for editable state
   - Small callbacks for events
   - Focused bridge services only when necessary

5. Validate lifecycle assumptions.
   - SwiftUI may recreate representables.
   - Coordinators exist to hold delegate and target-action glue, not as a second app architecture.

## References

- `references/representables.md`: choosing between view and view-controller wrappers, plus coordinator patterns.
- `references/window-panels.md`: window access, utility windows, and open/save panels.
- `references/responder-menus.md`: first responder, command routing, and menu validation.
- `references/drag-drop-pasteboard.md`: pasteboard, file URLs, and desktop drag/drop edges.

## Guardrails

- Do not duplicate the source of truth between SwiftUI and AppKit.
- Do not let `Coordinator` become an unstructured dumping ground.
- Do not store long-lived `NSView` or `NSWindow` instances globally without a strong ownership reason.
- Prefer a tiny tested bridge over rewriting the feature in raw AppKit.
- If a pattern can remain entirely in `macos-swiftui-patterns`, keep it there.

## Output Expectations

Provide:
- the exact SwiftUI limitation being crossed
- the smallest recommended bridge type
- the data-flow boundary between SwiftUI and AppKit
- the lifecycle or validation risks to watch
Pliki w paczce (5)
  • SKILL.md 3 KB
  • references/drag-drop-pasteboard.md 1 KB
  • references/representables.md 2 KB
  • references/responder-menus.md 1 KB
  • references/window-panels.md 1 KB

Wersje

W bazie nie ma innych skilli o nazwie macos-appkit-interop.

Migawka bazy z 13.11.2026 · wersja paczki 06362fa81e4f (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90local-appkit-interop-9793d062
    Łączy SwiftUI z AppKit w wąskim zakresie: reprezentacje, okna i panele, menu oraz łańcuch respondera na macOS.
  • 100appkit-app-architecture-workflow
    Prowadzi decyzje o strukturze aplikacji AppKit na macOS: delegaty, aplikacje paska menu, łańcuch responderów, okna, kontrolery, archiwizacja i mieszanie AppKit z SwiftUI.
  • 90desktop-swiftui
    Pomaga w tworzeniu aplikacji SwiftUI dla macOS: wzorce desktopowe, mostkowanie z AppKit i cykl życia aplikacji.
  • 90desktop-appkit
    Pomaga w tworzeniu aplikacji macOS w AppKit i Cocoa, w tym w Swift AppKit i architekturze natywnych aplikacji Mac.
  • 100axiom-macos
    Pomaga budować aplikacje macOS: okna, menu, sandboxing, dystrybucja, mostkowanie i modernizacja AppKit oraz wzorce SwiftUI specyficzne dla macOS.
  • 100appkit-swiftui-bridge
    Doradza w hybrydowym rozwoju AppKit i SwiftUI: NSViewRepresentable, kontrolery hostujące i zarządzanie stanem między frameworkami.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.