Post

Replies

Boosts

Views

Activity

Xcode Macro Code Highlighting - Choosing The Wrong Target
I have two targets: App Share Extension Each has a preprocessor macro: TARGET_IS_APP TARGET_IS_EXTENSION The App target has a dependency on the share extension. Some source files are compiled in both targets, but I use the preprocessor macros to enable/disable code for each target. lately Xcode hasn't been handling the code coloring very well based on the selected build target. I'll be in a file, my selected target is the App, but it will disable the code in the TARGET_IS_APP macro and enable it for share extension. The attached image shows an example. My selected build target/scheme is the App. But it's disabling that code and enabling the share extension. I've double checked the build settings, they are defined in the right targets.
1
3
495
Mar ’24
NSItemProvider throwing exception related to secure coding
Our app has a share extension. And we recently noticed something with iOS 17.3.1. From Safari, when we receive the plist and try to load it, we are seeing exceptions for classes not allowed to be unarchived. [itemProvider loadItemForTypeIdentifier:[UTTypePropertyList identifier] options:nil completionHandler:^(NSDictionary *jsDict, NSError *error) { } We see these exceptions: value for key 'NS.keys' was of unexpected class 'NSString' (0x1ee7d2970) [/System/Library/Frameworks/Foundation.framework]. Allowed classes are: {( "'NSDictionary' (0x1ee7cad38) [/System/Library/Frameworks/CoreFoundation.framework]" )} (null) Our preprocessing javascript file is basic, and only passes a title and URL as part of the payload. arguments.completionFunction({ "URL": document.URL "title": document.title, });
27
0
2.5k
Feb ’24
Back port uniformAcrossSiblings for collection view compositional layout.
This is more of a request I hope y'all will consider. Please back port uniformAcrossSiblings to iOS 13 (or maybe just 15?) (https://developer.apple.com/documentation/uikit/nscollectionlayoutdimension/4173072-uniformacrosssiblings) It's like the iOS 9 UIStackView problem. Amazing new feature nobody can use. Has anyone else done this themselves with either custom or subclass UICollectionViewCompositionalLayout?
0
0
432
Dec ’23
iOS Share Activity - Add Custom Actions
See the image attached. What are the APIs needed to add an action here that shows up across the system. Not a share extension, but the list of actions that are below that. How did Pinterest add theirs here? And it shows up for almost everything you share. I've been looking around and the only thing that looked like maybe is UIActivity. But when I implemented it doesn't show up across other apps. I was also lookin through app shortcut and app intent documentation but I can't find exactly how Pinterest is providing this action here.
1
0
764
Dec ’23
Protocol implementation of a MainActor delegate requires await keyword on initializer in async code
Why does implementing a delegate that has @MainActor declared on it require the object being created to have an "await" keyword? Here's an example: class MyClass : NSObject, UIScrollViewDelegate {     override init() {         super.init()     } } class MyClass2 : NSObject {     override init() {         super.init()     } } class MyTest : BLTestCase {     func xtest_getBrandDataFails() async {         let obj = MyClass(). // expression is async but not marked with await. let obj1 = await MyClass()         let objc2 = MyClass2()     } } UIScrollViewDelegate is declared with @MainActor. And it causes the initialization to require await. That seems odd to me because my init methods aren't marked as async. It's also odd seeing an await or "suspension point" as stated by the swift concurrency chapter in the swift book, but init is synchronous. Would swift concurrency ever suspend execution here? It seems wrong that it would when I know I don't want a suspension point.
1
0
1.2k
Dec ’22
Warning: Error creating LLDB target at path. the specified architecture 'arm64-*-*' is not compatible with 'x86_64-apple-ios13.2.0-simulator'
Every time my app runs in the simulator I see this error: Warning: Error creating LLDB target at path '/Users/aaronsmith/Library/Developer/Xcode/DerivedData/Babylist-ahvzjxxrpawwqhecszqeyvjstfca/Build/Products/Debug-iphonesimulator/Babylist.app'- using an empty LLDB target which can cause slow memory reads from remote devices: the specified architecture 'arm64--' is not compatible with 'x86_64-apple-ios13.2.0-simulator' in '/Users/aaronsmith/Library/Developer/Xcode/DerivedData/Babylist-ahvzjxxrpawwqhecszqeyvjstfca/Build/Products/Debug-iphonesimulator/Babylist.app/Babylist' What is this? I'm on an M1, no build issues. It makes me think the simulator is running under rosetta with x68_64. But I didn't choose to do that. Mac OS Ventura. Xcode 14 RC.
4
3
5k
Sep ’22
Xcode Beta Simulator on Mac OS Ventura Often Needs to Restart
Noticing that the simulator is often in some state that requires it to Quit and restart it. I often do this: CMD+R to run. Make changes. CMD+R to run (overwrite the existing session). The app (kinda) quits, but the screen is completely black. Like the app hasn't completely quit. The result is that Xcode just constantly says "Launching [App]...". And I have to quit the simulator.
17
9
5.7k
Sep ’22
iOS 16 Beta Vertically Aligns Navigation Bar Title View Differently with Right Bar Items
On iOS 16, I noticed that the navigation bar title view is being aligned vertically to the top, I cannot figure out why. The odd thing is that some view controllers are fine (it's centered vertically). But some it's top aligned. I thought maybe it had something to do with right/left bar button items, but after playing around with it - it doesn't seem to matter. Is there some change in UIKit that is causing this? Centered (In view controller A): Top Aligned (In view controller B): My component is the same in all cases where this heart graphic is - it's a subclass of UIImageView that sets the image to the heart.
9
2
4.9k
Sep ’22
xcodebuild test-without-building Transient Testing Unable to determine the executable path
Has anyone successfully used xcodebuild command test-without-building but without scheme / project? Man pages for xcodebuild has this example: xcodebuild test-without-building -xctestrun MyTestRun.xctestrun -destination 'platform=iOS Simulator,name=iPhone 5s' -destination 'platform=iOS,name=My iPad' // Tests using both the iOS Simulator and the device named iPhone 5s. Test bundle paths and other test parameters are specified in MyTestRun.xctestrun. The command requires project binaries and does not require project source code. What I'm trying to do is automate testing app upgrades. I want to be able to archive the app and tests and run those by themselves. Then again run tests but running them using the scheme / workspace. Like this: Run previous version of app tests from archived app / test-runners / xctestrun files. Run tests for current code base. The error I'm running into from the command is this: Cannot test target “MyTarget” on “iPhone 12 Pro Max”: Unable to determine the executable path for MyTarget.xctest What I've done is copied build products into a new folder and tried running this command from there. test-without-building -xctestrun ./MyTarget-Debug_iphonesimulator14.4-x86_64.xctestrun -destination 'platform=iOS Simulator,name=iPhone 12 Pro Max'
1
0
7.9k
Mar ’21