{"id":6106,"library":"pyobjc-framework-fileproviderui","title":"PyObjC Framework FileProviderUI","description":"PyObjC is a bidirectional bridge between Python and Objective-C, enabling Python scripts to use and extend macOS's Cocoa frameworks. `pyobjc-framework-fileproviderui` provides Python wrappers for the `FileProviderUI` framework on macOS, allowing developers to interact with File Provider UI extensions. The PyObjC project, including this framework wrapper, maintains an active development cycle with frequent minor releases and major versions often aligning with new macOS SDKs.","status":"active","version":"12.1","language":"en","source_language":"en","source_url":"https://github.com/ronaldoussoren/pyobjc","tags":["macos","objective-c","cocoa","ui","framework"],"install":[{"cmd":"pip install pyobjc-framework-fileproviderui","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"This package is a wrapper for a macOS framework and requires the core PyObjC bridge functionality.","package":"pyobjc-core","optional":false},{"reason":"Requires Python 3.10 or later.","package":"Python","optional":false}],"imports":[{"symbol":"FileProviderUI","correct":"import FileProviderUI"}],"quickstart":{"code":"import FileProviderUI\nimport Foundation # Often needed for basic Cocoa objects like NSString, NSObject\n\ndef main():\n    print(f\"FileProviderUI module loaded: {FileProviderUI}\")\n    # Try to access a known class from the framework and print its description\n    # FPUIActionExtensionContext is a common class in FileProviderUI\n    if hasattr(FileProviderUI, 'FPUIActionExtensionContext'):\n        context_class = FileProviderUI.FPUIActionExtensionContext\n        print(f\"FPUIActionExtensionContext class: {context_class}\")\n        print(f\"Description of FPUIActionExtensionContext: {context_class.description()}\")\n    else:\n        print(\"FPUIActionExtensionContext not found. This might indicate an older macOS SDK or an internal API.\")\n\nif __name__ == \"__main__\":\n    main()","lang":"python","description":"This quickstart demonstrates how to import the `FileProviderUI` framework and access a common class, `FPUIActionExtensionContext`, to print its description. This verifies the successful loading and bridging of the framework. This script should be run on macOS."},"warnings":[{"fix":"Upgrade to Python 3.10 or newer. Check `requires_python` in `pyproject.toml` or PyPI for the specific version range.","message":"PyObjC 12.0 dropped support for Python 3.9. PyObjC 11.0 dropped support for Python 3.8. Ensure your Python version meets the `>=3.10` requirement.","severity":"breaking","affected_versions":"11.0, 12.0+"},{"fix":"If subclassing Objective-C classes, consider using the `SomeClass(...)` instantiation pattern introduced in PyObjC 10.3 instead of `alloc().init...()`. If implementing a custom `__new__`, ensure it correctly handles object creation and delegates to super if necessary, or upgrade to 10.3.1+ if relying on `__init__` with a custom `__new__`.","message":"The behavior of `__init__` for Objective-C classes subclassed in Python changed in PyObjC 10.3, leading to breakage for projects using `__init__` in conjunction with a `__new__` provided by PyObjC. This was partially reverted in 10.3.1 to allow `__init__` when a user-defined `__new__` is present, but code relying on PyObjC's default `__new__` still cannot use `__init__`.","severity":"breaking","affected_versions":"10.3"},{"fix":"If using Python 3.13+ with free-threading, thoroughly test concurrent Objective-C interactions. Consult PyObjC documentation for any specific guidelines on free-threading.","message":"PyObjC 11.0 introduced experimental support for free-threading (PEP 703) with Python 3.13. While this aims to improve concurrency, it involved significant changes in the core bridge and might introduce unexpected behavior or require specific handling in multithreaded applications.","severity":"gotcha","affected_versions":"11.0+"},{"fix":"Add `pyobjc-core; sys_platform == \"darwin\"` and other `pyobjc-framework-*` packages with the same platform specifier to your project's dependencies.","message":"When pinning dependencies for cross-platform projects, `pyobjc-core` (and by extension framework wrappers) should be explicitly restricted to macOS using `sys_platform == \"darwin\"` in `requirements.txt` or similar, as installation will fail on non-macOS platforms.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refer to Apple's documentation for the specific Objective-C class you intend to subclass and verify if it supports subclassing. Avoid subclassing classes marked as non-subclassable.","message":"Some Cocoa classes are marked as non-subclassable in the macOS SDK. Attempting to subclass these from Python via PyObjC can lead to crashes.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update your code to avoid relying on the `isAlloc` attribute of `objc.selector`.","message":"The `isAlloc` attribute of `objc.selector` has been deprecated and is scheduled for removal in PyObjC 12.","severity":"deprecated","affected_versions":"<12.0"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z","problems":[]}