Frameworks

RSS for tag

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

Frameworks Documentation

Pinned Posts

Posts under Frameworks tag

211 Posts
Sort by:
Post not yet marked as solved
5 Replies
1.6k Views
I'm trying to donate an INSendMessageIntent for multiple recipients in a group. No matter what I do, the share sheet shows "1 Person" and a maximum of 1 profile image. How can I get it to show the correct number of people, and all of the profile images I set? Example screenshot: i.stack.imgur.com/VRf5i.png Sample code follows. Click "Donate Group Without Images" => share sheet suggestion shows 3 bubbles but says "1 Person" Click "Donate Group With Individual Images" => share sheet suggestion shows the first person's image (the letter A), not all 3 images, and still says "1 Person" Click "Donate Group with One Image" (...using undocumented setImage:forParameterNamed:...) => share sheet suggestion correctly shows the single group image, but still says "1 Person". Steps to reproduce: Create a new SwiftUI app with the below code as ContentView.swift. Edit Info.plist to include NSUserActivityTypes: ["INSendMessageIntent"] Add a share extension target; edit the target to add INSendMessageIntent under Supported Intents. Run the app on a device. (Share sheet suggestions don't seem to work in the simulator.) Try clicking the buttons to donate intents, and then clicking the share button to activate the share sheet. ContentView.swift: import SwiftUI import Intents import IntentsUI struct ActivityVC: UIViewControllerRepresentable {   func makeUIViewController(context: Context) -> some UIViewController {     return UIActivityViewController(activityItems: [UIImage(systemName: "photo")!], applicationActivities: nil)   }   func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) {} } struct ContentView: View {   @State var showActivityVC = false       var body: some View {     VStack(spacing: 24) {       Button("Donate Single Without Image") {         let person1 = INPerson(personHandle: INPersonHandle(value: "Aid", type: .unknown), nameComponents: nil, displayName: "A", image: nil, contactIdentifier: nil, customIdentifier: "Aid")                   let intent = INSendMessageIntent(recipients: [person1], outgoingMessageType: .outgoingMessageText, content: nil, speakableGroupName: INSpeakableString(spokenPhrase: "Single"), conversationIdentifier: "1", serviceName: nil, sender: nil, attachments: nil)                   INInteraction(intent: intent, response: nil).donate { (err) in           print("Donated single without image: \(err as Any)")         }       }       Button("Donate Group Without Images") {         let person1 = INPerson(personHandle: INPersonHandle(value: "Aid", type: .unknown), nameComponents: nil, displayName: "A", image: nil, contactIdentifier: nil, customIdentifier: "Aid")         let person2 = INPerson(personHandle: INPersonHandle(value: "Bid", type: .unknown), nameComponents: nil, displayName: "B", image: nil, contactIdentifier: nil, customIdentifier: "Bid")         let person3 = INPerson(personHandle: INPersonHandle(value: "Cid", type: .unknown), nameComponents: nil, displayName: "B", image: nil, contactIdentifier: nil, customIdentifier: "Cid")                   let intent = INSendMessageIntent(recipients: [person1, person2, person3], outgoingMessageType: .outgoingMessageText, content: nil, speakableGroupName: INSpeakableString(spokenPhrase: "NoImages"), conversationIdentifier: "2", serviceName: nil, sender: nil, attachments: nil)                   INInteraction(intent: intent, response: nil).donate { (err) in           print("Donated group without images: \(err as Any)")         }       }       Button("Donate Group With Individual Images") {         let person1 = INPerson(personHandle: INPersonHandle(value: "Aid", type: .unknown), nameComponents: nil, displayName: "A", image: INImage(uiImage: UIImage(systemName: "a.circle.fill")!), contactIdentifier: nil, customIdentifier: "Aid")         let person2 = INPerson(personHandle: INPersonHandle(value: "Bid", type: .unknown), nameComponents: nil, displayName: "B", image: INImage(uiImage: UIImage(systemName: "b.circle.fill")!), contactIdentifier: nil, customIdentifier: "Bid")         let person3 = INPerson(personHandle: INPersonHandle(value: "Cid", type: .unknown), nameComponents: nil, displayName: "C", image: INImage(uiImage: UIImage(systemName: "c.circle.fill")!), contactIdentifier: nil, customIdentifier: "Cid")                   let intent = INSendMessageIntent(recipients: [person1, person2, person3], outgoingMessageType: .outgoingMessageText, content: nil, speakableGroupName: INSpeakableString(spokenPhrase: "SeparateImages"), conversationIdentifier: "3", serviceName: nil, sender: nil, attachments: nil)                   INInteraction(intent: intent, response: nil).donate { (err) in           print("Donated group with individual images: \(err as Any)")         }       }       Button("Donate Group with One Image") {         let person1 = INPerson(personHandle: INPersonHandle(value: "Aid", type: .unknown), nameComponents: nil, displayName: "A", image: nil, contactIdentifier: nil, customIdentifier: "Aid")         let person2 = INPerson(personHandle: INPersonHandle(value: "Bid", type: .unknown), nameComponents: nil, displayName: "B", image: nil, contactIdentifier: nil, customIdentifier: "Bid")                   let intent = INSendMessageIntent(recipients: [person1, person2], outgoingMessageType: .outgoingMessageText, content: nil, speakableGroupName: INSpeakableString(spokenPhrase: "OneGroupImage"), conversationIdentifier: "4", serviceName: nil, sender: nil, attachments: nil)                   // This "forParameterNamed: \.speakableGroupName" is totally undocumented, but following the example from: https://developer.apple.com/documentation/foundation/app_extension_support/supporting_suggestions_in_your_app_s_share_extension         intent.setImage(INImage(uiImage: UIImage(systemName: "g.circle.fill")!), forParameterNamed: \.speakableGroupName)                   INInteraction(intent: intent, response: nil).donate { (err) in           print("Donated group with one image: \(err as Any)")         }       }       Button("Delete All") {         INInteraction.deleteAll { (err) in           print("Deleted: \(err as Any)")         }       }               Spacer().frame(height: 24)               Button(action: { showActivityVC = true }) {         Image(systemName: "square.and.arrow.up")       }     }     .sheet(isPresented: $showActivityVC) {       ActivityVC()     }   } } struct ContentView_Previews: PreviewProvider {   static var previews: some View {     ContentView()   } }
Posted
by
Post not yet marked as solved
3 Replies
1.7k Views
I have an SDK that is a static xcframework built against 3 pods (which are configured as static frameworks as well). When I include the SDK bundle in a client project (which also includes the 3 pods as static frameworks) it gives me linkage errors (Undefined Symbol) for every reference in the SDK to these dependencies. The rest of the project (which also relies on them) compiles (and I presume, links) fine. Why can't the SDK xcframework link to them? I'm pretty sure no archs are getting excluded. The XCFramework includes both arm64 for device (iOS) and x8664arm64 for simulator Note, when I convert everything to dynamic frameworks, it works fine.
Posted
by
Post not yet marked as solved
2 Replies
828 Views
Hi, Facing issue while building iOS sdk- Error: Couldn't find Xcode.interfaceBuilderBuildSupport.PlatformDefinition extension for iphonesimulator Couldn't find Xcode.interfaceBuilderBuildSupport.PlatformDefinition extension for macosx Couldn't find Xcode.interfaceBuilderBuildSupport.PlatformDefinition extension for watchos Couldn't find Xcode.interfaceBuilderBuildSupport.PlatformDefinition extension for watchsimulator Could not initialize core cannot find SDK variants with names 'iosmac'
Posted
by
Post not yet marked as solved
7 Replies
4.4k Views
We have an SDK project that contains a static library (.a) with binaries for arm64, armv7 (Device) and x86_64, i386 (Simulator). When we run in M1 Macbooks we are unable to run on arm64 simulators and get the following error: building for iOS Simulator, but linking in file built for iOS Our SDK is built into an XCframework bundle, however this issue still persists. We have tried building the static library into its own XCframework as well by separating the architectures into two different binaries, one for Device and one for Simulator, however we still didn't get it to work. We would like to know if this is a limitation or current issue on Xcode or if there are certain steps we need to follow to get this static library to be supported on arm64 simulators.
Posted
by
Post not yet marked as solved
2 Replies
6k Views
There is a question on stackoverflow for that too: https://stackoverflow.com/questions/66143815/xcode-12-5-spm-dependency-cache-location Xcode 12.5 release notes mention the "per-user-basis" cache for SPM dependencies: https://developer.apple.com/documentation/xcode-release-notes/xcode-12_5-beta-release-notes Is the location outside of DerivedData folder so cache still persists somewhere in ~/Library/Caches and can be reused even for clean build? It's very important to know for CI performance! Any guidance/help is appreciated.
Posted
by
Post not yet marked as solved
1 Replies
1.3k Views
Hi! I've run into some problems with running unit tests for iOS framework project recently. It had worked, but it stopped since one of the command line tool's updates. When I try to run unit tests with a command line (xcodebuild) I get 'Failed to create a bundle instance representing' error. But only for an iOS framework project and when -derivedDataPath is set with a custom path. xcodebuild -project TestFramework.xcodeproj -scheme TestFramework -derivedDataPath ./output  -destination 'platform=iOS Simulator,id=***' clean build test In the Xcode I can run tests without any problems. When I remove -derivedDataPath parameter, it works like a charm as well. On the other hand, unit tests for an iOS application project works from command line and Xcode, whenever I set -derivedDataPath flag or not. Has any of you been dealing with the same problem? Or do you know any solution? Or is it a known issue? Cheers! PS. $ xcodebuild -version  Xcode 12.4 Build version 12D4e $ sw_vers  ProductName: Mac OS X ProductVersion: 10.15.7 BuildVersion: 19H2
Posted
by
Post not yet marked as solved
3 Replies
2.5k Views
When running a cfgutil command I can verify across multiple OS versions, 10.15.7, and 11 that we get the following.  % cfgutil get all objc[2358]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x7fff8ad23a30) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10681a8c0). One of the two will be used. Which one is undefined. objc[2358]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x7fff8ad23a80) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10681a910). One of the two will be used. Which one is undefined. cfgutil: error: Error Domain=NSCocoaErrorDomain Code=3840 "Found non-key inside dict at line 112188" UserInfo={NSDebugDescription=Found non-key inside dict at line 112188, kCFPropertyListOldStyleParsingError=Error Domain=NSCocoaErrorDomain Code=3840 "Malformed data byte group at line 1; invalid hex" UserInfo={NSDebugDescription=Malformed data byte group at line 1; invalid hex}}
Posted
by
Post not yet marked as solved
1 Replies
452 Views
When embedding a framework in an iOS application I noticed some differing behavior when running on an actual device and simulator which I couldn't find an explanation for anywhere in the documentation. The embedded frameworks are loaded from outside (adjacent) to the app package when running on simulator whereas they are loaded from within the app package, within the Frameworks directory when running on an actual device. Here's a link to an example project which logs the path at which the dylib within the framework is loaded: https://github.com/R4N/simulatorLoadFrameworkExample The sample outputs are as follows: On simulator: /Users/username/Library/Developer/Xcode/DerivedData/simulatorLoadFrameworkExample-gmxyfcrvpmdfgqepjbbysebvysmh/Build/Products/Debug-iphonesimulator/libsimple.dylib On device: /private/var/containers/Bundle/Application/9D22C144-848A-4E40-B5B3-707B1CFD3151/simulatorLoadFrameworkExample.app/Frameworks/libsimple.dylib Is this the correct/expected behavior and if so is there any documentation which references this? These are the documentation pages which I've reviewed so far trying to find an answer/explanation: https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/CreationGuidelines.html https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW1 https://developer.apple.com/library/archive/technotes/tn2435/_index.html
Posted
by
R4N
Post not yet marked as solved
2 Replies
844 Views
I have some third party static libraries which I've put into an XCFramework. When I add the framework to another app, the classes in the libraries are visible when I import the framework, but when I compile the app, I get the following error: Undefined symbols for architecture arm64: "_OBJC_CLASS_$_<Class Name>", referenced from: type metadata for Local object.o "_OBJC_METACLASS_$_<Class Name>", referenced from: _OBJC_METACLASS_$__TtC8Local object.o The Environment: IDE: Xcode 12.4 OS: macOS 11.15.4 - Catalina Machine: MacBookPro15,1 The details: The XCFramework is built from a project based upon the Framework template. The libraries, the *.a files, are included in the project and they are "required." Their respective header, *.h files, are included and set to public. They are also listed in the umbrella header file with this notation: #import <FrameworkName/Library name.h> In the build settings, SKIP_INSTALL is set to NO. BUILD_LIBRARY_FOR_DISTRIBUTION is set to YES. I use the following terminal command to archive the framework: xcodebuild archive -scheme Name -archivePath ./Name-iOS SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES I then use the following terminal command to create the Xcframework: xcodebuild -create-xcframework -framework ./NAME-iOS.xcarchive/Products/Library/Frameworks/NAME.framework -output ./NAME.xcframework I take the product of this and drop it into the "Frameworks, Libraries, and Embedded Content" section of the app project where I want to use the libraries. I could drop the libraries into the app outside of a framework (and I have and they work just fine) but I want to build a single portable object so I can move this functionality from one project to another without a lot of copy and pasting. So far, so good. When I reference an object in a swift class, like so: import Foundation import NAME class AppLocalObject: ClassInName { } Everything seems to be fine. I don't get any errors from Xcode saying it can't find the "ClassInName" object. But when I try to compile the app I get the aforementioned error. I'm sure I'm doing something wrong that's simple to fix. But I don't know what that is.
Posted
by
Post not yet marked as solved
2 Replies
996 Views
The new TabularData framework in iOS 15, MacOS 12 and watchOS 8 opens up opportunities for easier, more efficient ingestion of data (and for ML possibilities). However, it does not appear to be possible to directly use a DataFrame's rows for a List or ForEach in SwiftUI: the compiler gives an error that the rows do not conform to RandomAccessCollection Protocol. The documentation for Rows does not state compliance with such, even through there are methods which inherit from the protocol. Using a separate iteration to extract each Row (as a DataFrame.Row) from the DataFrame into a new array works. I make this array identifiable by using the row.index as the id. However, if the DataFrame is large this adds considerably to storage and processing overheads. Any thoughts on directly using the DataFrame's Rows in SwiftUI?
Posted
by
Post not yet marked as solved
0 Replies
1.3k Views
Hi! I've been trying to precompile one of our internal modules for a while, but I can't figure out how to get this done. Info Let's call the library I'm trying to precompile InternalLib. InternalLib is a mixed Swift/Objc static library, that depends on SwiftProtobuf and Protobuf. Our project use InternalLib as dependency. So far I've successfully done these steps: Step 1: Archive InternalLib The Example app in InternalLib fetches the dependencies correctly, and a script generates archives the library from the InternalLib-ExampleApp.xcworkspace. The result are 2 archives (iOS and simulator), compiled with this xcconfig: SKIP_INSTALL = NO BUILD_LIBRARY_FOR_DISTRIBUTION = YES SWIFT_OPTIMIZATION_LEVEL = -Osize OTHER_SWIFT_FLAGS = $(inherited) -verify-emitted-module-interface GCC_PREPROCESSOR_DEFINITIONS = $(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 Step 2: Generate xcframework The next step is generating the xcframework. For this step we have the following script: function create_xcframework { for NAME in "InternalLib" "Protobuf" "SwiftProtobuf" do xcodebuild -create-xcframework \ -framework archives/InternalLib-iOS_sim.xcarchive/Products/Library/Frameworks/$NAME.framework \ -framework archives/InternalLib-iOS.xcarchive/Products/Library/Frameworks/$NAME.framework \ -output products/universal/$NAME.xcframework done } ..which successfully generates 3 XCFrameworks. Step 3: Run cocoapods At this step we regenerate the full project setup, and use cocoapods to connect each module to its dependencies. I've tried a few configurations: dependencies fetched via cocoapods, and specifying the resulting XCFrameworks as separate Podspecs, in order to create the dependencies by having the InternalLib.xcframework depending on XCFrameworks only. Both solutions fail in the same terms. Issues: Preprocessor flags not available: When I compile, the compiler flags present in InternalLib configuration seem unavailable. In this specific case, the headers are trying to resolve the Protobuf dependencies via local #include "Header.h", instead of going to #include <Protobuf/Header.h>, like so, even if the GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS flag is set in the project's preprocessor flags. # #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS # #import <Protobuf/GPBProtocolBuffers.h> # #else # #import "GPBProtocolBuffers.h" # #endif Missing symbols: By overriding the headers in order to forcefully use #import <Protobuf/GPBProtocolBuffers.h>, we get to the very end of the project compilation, just to fail with Undefined Symbol SwiftProtobuf.[...], which means the library of which InternalLib depends on was not found. My questions here are: Why is the preprocessor flag not seen while compiling the app? is this this configuration of having a XCFramework depend on cocoapods libs not supported? I am not sure if this is the best place to ask these questions, as it's using a 3rd party dependency manager, but maybe someone has tried a similar configuration in their project. Thanks!
Posted
by
Post not yet marked as solved
1 Replies
484 Views
Hello, I am currently facing a compilation issue on Simulator with frameworks that I just migrated to .xcframework. My workspace is a little bit complex, I have an iOS application project [A] with an Objective-C/Swift framework target [B] inside. This framework target uses another Objective-C++ framework [C] distributed as a cocoapod (coming from another internal project), and this framework is wrapping multiple C++ .a/libraries [D, E, F, ...]. For multiple years, we created all these libraries and frameworks with all the required architectures using the lipo tool. Few weeks ago I had the following compilation error ld: building for iOS Simulator, but linking in dylib built for iOS so I decided to package all these libraries and frameworks as .xcframework. Now the pod with the Objective-C++ .xcframework seems to compile/run fine on device, but when I try to build the app A (or even the framework 'B' target) for simulator, I get the following error : B.h:10:9: Module 'C' not found Could not build Objective-C module 'B' The .xcframework contains the following files and the module.modulemap files seems missing on simulator, I guess it may be related, but I can't understand why :( % tree B.xcframework B.xcframework ├── Info.plist ├── ios-arm64_armv7 │   └── B.framework │   ├── Headers │   │   └── B.h │   ├── Info.plist │   ├── Modules │   │   └── module.modulemap │   └── B └── ios-arm64_i386_x86_64-simulator └── B.framework ├── Headers │   └── B.h ├── B └── _CodeSignature └── CodeResources 8 directories, 44 files
Posted
by
Post not yet marked as solved
0 Replies
292 Views
Dear all, I am a new by of Xcode and I would like to ask one question. I should import some frameworks in to my project and I have check that in all cases I shall use ViewController. How could I create and use a ViewController in my project without storyboard? Is an possibility to import frameworks without the use of ViewController?
Posted
by
Post not yet marked as solved
0 Replies
257 Views
Hi, i recently switched to an old iMac with high sierra and i'm planning to use it for C/C++ programming but as new to mac as i am, i have some questions. I'm currently trying to port a project that depends on libraries such as SDL2 and Freetype. Downloading the development files for SDL2 was a breeze and i got to install the library in my system by drag and dropping a .framework file. Freetype as far as i could test does not even compile a .framework file, it wants the installation to be classic Unix style: ./configure; make; make install Sure, the classic way works, but it does not feel as correct as drag and dropping was. Installing with brew might be an alternative but in the end it's the same as compiling the unix way. Is the use of .framework files the mac way of doing things? Can i create a .framework file for external libraries myself? How? Should i worry about this or just do everything the unix way? In case it is useful, i'm running macOS 10.13.6 on a mid 2011 21 inch imac. Thank you for your time.
Posted
by
Post not yet marked as solved
0 Replies
549 Views
Hi Team, We are seeing a strange issue on the iPad device with iOS v14.6 where our backend API is not getting invoked. We have verified the same API calling code on multiple iPhone devices & simulators with different iOS versions ranging from v13.0-v14.6 and on iPad simulators with iOS versions ranging from v14.0-v14.5. It seems to be working fine on all except the real iPad device with v14.6. Any help in these is really appreciated.
Posted
by
Post not yet marked as solved
0 Replies
392 Views
Hi, I've set the C++ language dialect in my project to c++2a. Than it failed on compiling .mm file which has the following line @import AppKit; But if replace it with the following line and link with framework from project build phases, than it works. #import <AppKit/AppKit.h> My .mm file is including for adapter swift header file (*-Swift.h) which is auto generated and has this @import directive. is it a known issue, should I file a bug ?
Posted
by
Post not yet marked as solved
0 Replies
256 Views
Hello, We would like 2 sets of users from two different countries use the same App. For e.g. User1 from US would use the App for Supplier onboarding, while User2 from SriLanka would use this App for processing orders. It's the same brand so having 2 different Apps is not an option. Just that the users should see what they are supposed to see in different countries. Can i explain in the description to convince Apple? Or would i hit a rejection? Thx VR
Posted
by
Post not yet marked as solved
6 Replies
711 Views
Runtime crash on macOS 10.13 (High Sierra) with this dyld message: "Incompatible library version: Application requires version 300.0.0 or later, but CoreData provides version 1.0.0" Project configured for 10.12 deployment, and loading seems to work in 10.14 or later - and worked properly built with Xcode prior to 12.5. How do I accommodate 10.12 deliveries? Include the CoreData framework? How's that handled in this case (where included isn't needed for current systems)?
Posted
by
Post not yet marked as solved
0 Replies
253 Views
It's my first time developing in Swift/IOS. Swift itself is pretty nice, but now I have to implement 3rd party framework, which looks like it's Modular C. Folder structure inside framework is like /Header /Modules /Framework <-executable /Info.plist I've tried different ways to include it in to project, into my pod, but non of them lets me import it. I keep getting files not found etc. What would be the correct way to do it ? It feels like it's something trivial to do, but due to lack of skill with xcode I am struggling a lot.
Posted
by