Frameworks

RSS for tag

Ask questions about APIs that can drive features in your apps.

Posts under Frameworks tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

What exactly an Xcode framework does?
I created 2 iOS projects in Xcode: Project 1: 4 targets (main app + 3 app extensions) 4 static libraries the main app's target dependencies include - 3 app extensions and the 4 libs. the main app's binary is linked to all 4 libs similarly, each extension is linked to all 4 libs Project 2: 5 targets (main app + 3 app extensions + 1 framework) 4 static libraries the main app's target dependencies include - 3 app extensions and the framework each extension is dependent only on the framework the framework's target dependencies include all the 4 static libs As per my understanding, the app bundle size for Project 2 should be less than that of Project 1, since we eliminate duplicating the static libs for each target by using a framework instead. However, I have found that the bundle size is more for Project 2 as compared to the bundle size of project 1. I do not understand, why?
1
0
117
13h
TextKit 2 undocumented and unexpected behavior in textViewportLayoutControllerDidLayout
The NSTextViewportLayoutControllerDelegate.textViewportLayoutControllerDidLayout(_:) documentation states that Layout information on textViewportLayoutController is up-to-date at the point of this call. however it is easy to put the NSTextViewportLayoutController in a state where after calling textViewportLayoutControllerDidLayout, the value of viewportRange is nil (unexpected) and value of the property viewportBounds is .zero The TextKit2 sample application found at https://developer.apple.com/documentation/uikit/using-textkit-2-to-interact-with-text makes that assumption as well, and in few places force unwrap the value of viewportRange, that leads to runtime crashes. This behavior is also discussed in Developer Forum thread about TextKit2 viewport relocation: https://developer.apple.com/forums/thread/761364?answerId=800516022#800516022 How to reproduce: Run Mac target of LayoutWithTextKit2 sample project found at https://developer.apple.com/documentation/uikit/using-textkit-2-to-interact-with-text locate menu.rtf file and duplicate its content several times - the goal is to increase the length of the layout text quickly resize application window - that results in viewport layouts - that result in out-of-bound viewport - that results ina crash OR quickly scroll down/up to the end of the document using scroller bar on the right side of the window Reproducible 100% The situation occurs when the document is not fully laid out, the estimated size (height) of the content exceeds the final (correct) height, and the layoutViewport() function is executed quickly. Resulting in partial viewport layout, and once the viewport moves outside of the document's total height, the viewportLayoutController starts to report viewportRange = nil. FB19698121 Why does it happen? Is it expected? How to recover from that state? And most importantly, how to make the NSTextLayoutManager display the portion of the document that is currently scrolled to. and how to do it without for ce layout the full document on each viewportLayout()
1
0
105
1w
Compile Error
When I added the ExcelIO library to my app and compiled it, the following error occurred: Framework 'SwiftSpreadsheet' not found Linker command failed with exit code 1 (use -v to see invocation) I added the following to my Podfile and installed it, but the error persists. (No errors occurred during pod install.) platform :ios, '9.0' Pods for medical_expense target 'medical_expense' do Comment the next line if you don't want to use dynamic frameworks use_frameworks! pod 'SwiftyTesseract', '~ 2.0' pod 'SwiftSpreadsheet' end Pods for Petty_staff target 'Petty_staffTests' do inherit! :search_paths pod 'ReachabilitySwift' Pods for testing end target 'Petty_staffUITests' do inherit! :search_paths Pods for testing end Note that "SwiftSpreadsheet" exists in /Users/ymdakr/MyAppli/Medical_Expense/Pods/Target Support Files/Pods-medical_expense/Pods-medical_expense.debug.xcconfig and /Users/ymdakr/MyAppli/Medical_Expense/Pods/Target Support Files/Pods-medical_expense/Pods-medical_expense.release.xcconfig Only in [Files/Pods-medical_expense/Pods-medical_expense.debug.xcconfig] What should I do?
1
0
20
1w
iOS 26 | UIBarButtonItem UI issues with isEnabled and hidesSharedBackground
UIBarButtonItem setting isEnabled = false, but the item is still tappable and animating. Is this a new UI behavior or an issue? Do the following steps: On tapping on a UIBarButtonItem, disable by setting isEnabled = false and setting hidesSharedBackground = true Enable the button by setting isEnabled = true and setting hidesSharedBackground = false => The button appears with bigger shared background is this an issue? please find the attachments for more details. ViewController.swift.txt
0
1
164
2w
NSStatusItem Visibility Issue in AU Audio Plugin - Logic Pro vs Other Hosts
Target: MacOS 11.1 and above C++, Juce 8, XCode 16.2 Testing: Sonoma 14.5 Logic Pro (latest version), Reaper 7.34, Pro Tools 2023.12 and 2025.6 I'm developing an audio plugin that creates an NSStatusItem ("menu bar status icon" or MBSI for short) to provide visual feedback for one of the components. I've encountered a Logic Pro-specific behavior that I'd like to fix. I'm building for Mac-only, Intel and Silicon, and for AU/VST3/AAX. Summary: The NSStatusItem for the MBSI is created successfully and functions properly in some hosts (Reaper (AU and VST3), Pro Tools (AAX)) but isn't visible in Logic Pro, despite identical API behavior. Details: NSStatusItem Creation: implementation using [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] All API calls report success in both working (Reaper) and non-working (Logic Pro) hosts. Logging shows Logic Pro and Reaper create the NSStatusItem with the same properties: Window frame: {{0, -36}, {38, 36}} (both hosts) statusItem.visible: YES (both hosts) Button exists and responds to state changes (both hosts) Y coordinate is -36 pixels (above visible screen, both hosts) In Reaper, I can see the MBSI but in Logic Pro I can't. Note: the MBSI has no functionality beyond visual feedback. It's not clickable nor does it create a corresponding menu. Questions: Are there known differences in how Logic Pro's AU hosting service handles system UI elements compared to other hosts? And if so, is there guidance on AU plugins accessing system UI elements like the menu bar? Link to NSStatusItemTest.component: https://app.box.com/s/i3rq0hii3qf43iojrayc17fsfq7fnssd Link to video showing issue: https://app.box.com/s/icefqk898timqov77t468lqtio0rjqul Link to Console output for testing in Reaper vs Logic Pro: https://app.box.com/s/ph6nv1lmozo3phtjx3md6abdms5atgg6
Topic: Design SubTopic: General Tags:
0
0
259
Jul ’25
App store connect validation failed with CFBundleIdentifier Collision
We have a client with an application that includes a main application, NSEs (Notification Service Extensions) as an extension, and framework1 embedded within the main application. The NSEs also require framework1 as a dependency. When we embedded framework1 within the NSEs, the App Store Connect validation failed with the following error: Validation failed (409) CFBundleIdentifier Collision. There is more than one bundle with the CFBundleIdentifier value 'com.test.xyz-LoggerUtility' under the iOS application 'test.app'. (ID: -----------) We've observed an issue specifically when uploading to App Store Connect. We're able to debug and distribute the application without any problems using our enterprise distribution.
3
0
81
Jul ’25
How to use protocols to support managing SwiftUI views from different modules ?
In out project, we are creating a modular architecture where each module conform to certain protocol requirements for displaying the UI. For example: public protocol ModuleProviding: Sendable { associatedtype Content: View /// Creates and returns the main entry point view for this module /// - Parameter completion: Optional closure to be called when the flow completes /// - Returns: The main view for this module @MainActor func createView(_ completion: (() -> Void)?) -> Content } This protocol can be implemented by all different modules in the app, and I use a ViewProvider structure to build the UI from the module provided: public struct ViewProvider: Equatable { let id = UUID() let provider: any ModuleProviding let completion: () -> Void public init(provider: any ModuleProviding, completion: @escaping () -> Void) { self.provider = provider self.completion = completion } @MainActor public func layoutUI() -> some View { provider.createView(completion) } This code throws an error: Type 'any View' cannot conform to 'View' To solve this error, there are two ways, one is to wrap it in AnyView, which I don't want to do. The other option is to type check the provider with its concrete type: @ViewBuilder @MainActor private func buildViewForProvider(_ provider: any ModuleProviding, completion: (() -> Void)?) -> some View { switch provider { case let p as LoginProvider: p.createView(completion) case let p as PostAuthViewProvider: p.createView(completion) case let p as OnboardingProvider: p.createView(completion) case let p as RewardsProvider: p.createView(completion) case let p as SplashScreenProvider: p.createView(completion) default: EmptyView() } } This approach worked, but it defeats the purpose of using protocols and it is not scalable anymore. Are there any other approaches I can look at ? Or is this limitation in SwiftUI ?
3
0
107
Jul ’25
Receiving messages from TelephonyMessagingKit
I'm currently experimenting with TelephonyMessagingKit on iOS 26 Beta 3 (in the EU). I've managed to register my example project as the default Carrier messaging app, and sending/receiving SMS inside the app also appeared to work. However, I do not see any way to receive notifications/messages while the app is not running. Is this intentional? Not being able to notify users about an incoming message would be a competitive disadvantage compared to Apple's messages app, which is why I'd expect there to be an API to do this, given the EU rules. I'd appreciate any help here. Thanks!
1
0
396
Jul ’25
Webkit dynamic linking failing on iPadOS 26 beta 3
I am using XCODE-BETA (Version 26.0 beta (17A5241e)) on a Mac (running Sequoia 15.5) to develop an app using FoundationModel. I am testing on an iPad (iPad Pro 11 in, 2nd Gen, running iPadOS 26 Beta 3). My app works fine when I run it in the simulator (iPad 26.0). So I upgraded my iPad Pro to iPadOS 26 beta 3 to try it on a real device. When I run it on the device, I get an error about symbols not found. [See details below] Any idea what I need to change in my development configuration to allow me to run/test my app on a real device running iPadOS 26 beta 3? Thanks in advance, Charlie dyld[1132]: Symbol not found: _$s6WebKit0A4PageC4loadyAC12NavigationIDVSg10Foundation10URLRequestVF Referenced from: <65E40738-6E3A-3F65-B39F-9FD9A695763C> /private/var/containers/Bundle/Application/34F9D5CE-3E54-4312-8574-10B506C713FA/Blossom.app/Blossom.debug.dylib Expected in: /System/Library/Frameworks/WebKit.framework/WebKit Symbol not found: _$s6WebKit0A4PageC4loadyAC12NavigationIDVSg10Foundation10URLRequestVF Referenced from: <65E40738-6E3A-3F65-B39F-9FD9A695763C> /private/var/containers/Bundle/Application/34F9D5CE-3E54-4312-8574-10B506C713FA/Blossom.app/Blossom.debug.dylib Expected in: /System/Library/Frameworks/WebKit.framework/WebKit dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libLogRedirect.dylib:/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/usr/lib/libViewDebuggerSupport.dylib Symbol not found: _$s6WebKit0A4PageC4loadyAC12NavigationIDVSg10Foundation10URLRequestVF Referenced from: <65E40738-6E3A-3F65-B39F-9FD9A695763C> /private/var/containers/Bundle/Application/34F9D5CE-3E54-4312-8574-10B506C713FA/Blossom.app/Blossom.debug.dylib Expected in: /System/Library/Frameworks/WebKit.framework/WebKit dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libLogRedirect.dylib:/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/usr/lib/libViewDebuggerSupport.dylib
1
0
119
Jul ’25
Socket exception errSSLPeerBadCert CFStreamErrorDomainSSL Code -9825
Problem : Connection error occurs in iOS26 beta while connecting to the device's softap via commercial app (Socket exception errSSLfeerBadCert CFSreamErrorDomainSSL code -9825). iOS 18 release version does not occur. Why does it cause problems? Does the iOS 26 version not cause problems? Is there a way to set it up in the app so that the iOS 26 beta doesn't cause problems? error : "alias":"SOCKET_LOG", "additional":{"currentNetworkStatus":"socket e=errSSLPeerBadCert ns WifiStatus: Connected Error Domain kCFStreamErrorDomainSSL Code-9825 "(null)" UserInfo={NSLocalizedRecoverySuggestion=Error code definition can be found in Apple's SecureTransport.h} Description : It's an issue that happens when you connect our already mass-produced apps to our home appliances (using SoftAP), and it's currently only happening in iOS 26 beta. This particular issue didn't appear until iOS 18 version. Let me know to make sure that this issue will persist with the official release of iOS 26? If the issue continues to occur with the official version, would you share any suggestions on how to mitigate or avoid it. Also, it would be helpful to find out if there are known solutions or processes such as exemptions to fix this issue.
10
0
157
Jul ’25
How do I maintain different navigation selections on a per-scene basis in SwiftUI?
I’ll preface this by saying I’ve submitted a DTS ticket with essentially this exact text, but I thought I’d also post about it here to get some additional input. Apple engineers: the case ID is 14698374, for your reference. I have an observable class, called NavigationModel, that powers navigation in my SwiftUI app. It has one important property, navigationSelection, that stores the currently selected view. This property is passed to a List in the sidebar column of a NavigationSplitView with two columns. The list has NavigationLinks that accept that selection as a value parameter. When a NavigationLink is tapped, the detail column shows the appropriate detail view per the navigationSelection property’s current value via a switch statement. (This navigationSelection stores an enum value.) This setup allows for complete programmatic navigation as that selection is effectively global. From anywhere in the app — any button, command, or app intent — the selection can be modified since the NavigationModel class uses the @Observable Swift macro. In the app’s root file, an instance of the NavigationModel is created, added as an app intent dependency, and assigned (might be the wrong verb here, but you get it) to ContentView, which houses the NavigationSplitView code. The problem lies when more than one window is opened. Because this is all just one instance of NavigationModel — initialized in the app’s root file — the navigation selection is shared across windows. That is, there is no way for one window to show a view and another to show another view — they’re bound to the same instance of NavigationModel. Again, this was done so that app intents and menu bar commands can modify the navigation selection, but this causes unintended behavior. I checked Apple’s sample projects, namely the “Accelerating app interactions with App Intents” (https://developer.apple.com/documentation/appintents/acceleratingappinteractionswithappintents) and “Adopting App Intents to support system experiences” (https://developer.apple.com/documentation/appintents/adopting-app-intents-to-support-system-experiences) projects, to see how Apple recommends handling this case. Both of these projects have intents to display a view by modifying the navigation selection. They also have the same unintended behavior I’m experiencing in my app. If two windows are open, they share the navigation selection. I feel pretty stupid asking for help with this, but I’ve tried a lot to get it to work the way I want it to. My first instinct was to create a new instance of NavigationModel for each window, and that’s about 90% of the way there, but app intents fail when there are no open windows because there are no instances of NavigationModel to modify. I also tried playing with FocusedValue and SceneStorage, but those solutions also didn’t play well with app intents and added too much convoluted code for what should be a simple issue. In total, what I want is: A window/scene-specific navigation selection property that works across TabViews and NavigationSplitViews A way to reliably modify that property’s value across the app for the currently focused window A way to set a value as a default, so when the app launches with a window, it automatically selects a value in the detail column The navigation selection to reset across app and window launches, restoring the default selection Does anyone know how to do this? I’ve scoured the internet, but again, no dice. Usually Apple’s sample projects are great with this sort of thing, but all of their projects that have scene-specific navigation selection with NavigationSplitView don’t have app intents. 🤷‍♂️ If anyone needs additional code samples, I’d be happy to provide them, but it’s basically a close copy of Apple’s own sample code found in those two links.
0
0
74
Jul ’25
Creating RTP-MIDI Sessions via MIDINetworkSession C API (dlopen/dlsym) on macOS 15?
I’m an amateur developer working on a free utility for composers/producers, for which the macOS release needs to create and name RTP-MIDI sessions in Audio MIDI Setup from the command line (so I can ship a small C helper instead of telling users to click through the UI). Here’s what I’ve tried so far, without luck: • Plist hacks: Injecting entries into ~/Library/Audio/MIDI Configurations/*.mcfg works when AMS is closed, but AMS immediately locks and reverts my changes when it’s open. • CoreMIDI C API: I can create virtual ports with MIDISourceCreate, but attempting MIDIObjectGetDataProperty on the apple.midirtp.session plugin always returns err –10836. • Obj-C & Swift: Loading MIDINetworkSession and calling defaultSession, init, setNetworkName: and setting enabled = YES doesn’t produce a new session object in the Network panel. • dlopen/dlsym: I extracted the real CoreMIDI binary out of the dyld shared cache and tried binding _MIDINetworkSessionCreate, _SetName, _SetEnabled, etc., but all the symbols come back null or my tool segfaults. • Plugin registration: I’ve pulled the factory UUID (70C9C5EA-7C65-11D8-B317-000393A34B5A) from /System/Library/Extensions/AppleMIDIRTPDriver.plugin/Contents/Info.plist and called CFPlugInRegisterFactories, but it still never exposes the session-creation calls. At this point I’m convinced I’m either loading the wrong binary or missing one critical step in registering the RTP-MIDI plugin’s private API. Can anyone point me to: The exact path of the dylib or bundle that actually exports the MIDINetworkSessionCreate/MIDINetworkSessionSetName/MIDINetworkSessionSetEnabled symbols? A minimal working snippet (C or Obj-C) that reliably creates and names a Network-MIDI session? Any pointers, sample code, or even ideas about where Apple hides this functionality on macOS 15 would be hugely appreciated. Thanks!
0
1
57
Jun ’25
On iPadOS 26 beta, the navigation bar can appear inset underneath the status bar (FB18241928)
On iPadOS 26 beta, the navigation bar can appear inset underneath the status bar (FB18241928) This bug does not happen on iOS 18. This bug occurs when a full screen modal view controller without a status bar is presented, the device orientation changes, and then the full screen modal view controller is dismissed. This bug appears to happen only on iPad, and not on iPhone. This bug happens both in the simulator and on the device. Thank you for investigating this issue.
6
0
310
3w
Module not found when using inheritance
PLATFORM AND VERSION Development environment: Xcode 16.4 (16F6), macOS 15.5 (24F74) Run-time configuration: iOS 18.3.1 DESCRIPTION OF PROBLEM I cannot build my app due to a module not found error when I'm importing Sample-Swift.h header to an ObjectiveC file. I need to use Swift code to ObjectiveC file with Swift code using an external XCFramework. It seems to be related to a mix with ObjectiveC and Swift code when Swift code uses class inheritance from FZWorkoutKit class. With a full Swift project, no issue. STEPS TO REPRODUCE Project https://fizzup.s3.amazonaws.com/files/public/Sample-WK.zip Open the provided project and try to build it. The issue occurs. In MyObject.m file, if you comment the first import (Sample-Swift.h), no issue occurs but I cannot use my Swift code (MyFile class). Uncomment the line commented in step 1. Go to MyFile.swift and change class inheritance from GoModeController (from FZWorkoutKit framework) to UIView (from UIKit). No issue occurs.
0
0
58
Jun ’25
ffmpeg xcframework not working on Mac, but working correctly on iOS
I have an app (currently in development stage) which needs to use ffmpeg, so I tried searching how to embed ffmpeg in apple apps and found this article https://doc.qt.io/qt-6/qtmultimedia-building-ffmpeg-ios.html It is working correctly for iOS but not for macOS ( I have made changes macOS specific using chatgpt and traditional web searching) Drive link for the file and instructions which I'm following: https://drive.google.com/drive/folders/11wqlvb8SU2thMSfII4_Xm3Kc2fPSCZed?usp=share_link Please can someone from apple or in general help me to figure out what I'm doing wrong?
1
0
92
Jun ’25
Xcode 16.4 CoreHaptics watchOS
Unable to import CoreHaptics Starting from scratch: Downloaded Xcode 16.4, selected new project (watch-only app), accepted all defaults. Can write code and run simulator, but cannot import CoreHaptics. Searching for an answer for hours without luck. Would appreciate any help. CoreHaptics is in my Frameworks directory. Can import Foundation, Combine, etc. Have reinstalled Xcode 16.4. Have restarted the MacBook Pro (2019,Intel i9, Sequoia 15.5). No luck so far.
3
1
59
Jun ’25
Archiving a Swift SDK with SPM Dependencies for XCFramework Distribution
Hello, I’m building a Swift-based SDK (using SwiftUI) that will be distributed as a single .xcframework, and consumed by a React Native application. The SDK has multiple internal module dependencies (e.g., Essentials, CoreModels, CoreRepository), each of which is currently implemented as a local Swift Package (SPM). When I attempt to archive the main SDK framework using xcodebuild archive with BUILD_LIBRARY_FOR_DISTRIBUTION=YES, the archive process fails during SwiftEmitModule for these SPMs. I understand this likely relates to module stability requirements for .xcframework distribution. My key question: Is it mandatory to convert all Swift Packages (SPMs) into Xcode framework targets in order to successfully archive and bundle them into a distributable .xcframework? Or alternatively, is there a recommended approach to make Swift Packages archive-compatible for use in a compiled, closed-source SDK, without converting them into Xcode framework targets? Awaiting your guidance.
0
0
72
Jun ’25
How to test ManagedAppConfigurationProvider without MDM
How to test ManagedAppConfigurationProvider without MDM ? Task { /* Configuration provider task */ for await configuration in configurationProvider.configurations(MyAppConfiguration.self) { self.configuration = configuration ?? MyAppConfiguration.defaultConfiguration } } Can the existence of a configuration be simulated, e.g. by storing a mocked configuration in UserDefaults? The UserDefaults key "com.apple.configuration.managed" seems not relevant here.
0
0
49
Jun ’25