I am trying to create a custom CGColorSpace in Swift on macOS but am not sure I really understand the concepts.
I want to use a custom color space called Spot1 and if I extract the spot color from a PDF I get the following:
"ColorSpace<Dictionary>" = {
"Cs2<Array>" = (
Separation,
Spot1,
DeviceCMYK,
{
"BitsPerSample<Integer>" = 8;
"Domain<Array>" = (
0,
1
);
"Filter<Name>" = FlateDecode;
"FunctionType<Integer>" = 0;
"Length<Integer>" = 526;
"Range<Array>" = (
0,
1,
0,
1,
0,
1,
0,
1
);
"Size<Array>" = (
1024
);
}
);
};
How can I create this same color space using the CGColorSpace(propertyListPlist: CFPropertyList) API
func createSpot1() -> CGColorSpace? {
let dict0 : NSDictionary = [
"BitsPerSample": 8,
"Domain" : [0,1],
"Filter" : "FlateDecode",
"FunctionType" : 0,
"Length" : 526,
"Range" : [0,1,0,1,0,1,0,1],
"Size" : [1024]]
let dict : NSDictionary = [
"Cs2" : ["Separation","Spot1", "DeviceCMYK", dict0]
]
let space = CGColorSpace(propertyListPlist: dict as CFPropertyList)
if space == nil {
DebugLog("Spot1 color space is nil!")
}
return space
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Created
I have suddenly started getting this error when trying to compile an app that has been compiling fine for days under Xcode 16.
I have tried deleting the derived data folder and cleaning the project build folder, restarting Xcode but all to no avail.
Any other suggestions - perhaps I need to log a bug report with Apple ?!
Topic:
Developer Tools & Services
SubTopic:
Xcode
The WWDC2024 custom data store example doesn't provide any details on how one would go about creating a DataStoreSnapshot. The example uses a DefaultSnapshot for persisting the data in the DefaultSnapshot format directly in the JSON file.
There appears to be no documentation or examples of how one might create a DataStoreSnapshot from data from another database.
The Apple documentation for DefaultSnapshot provides no examples of how one might create such a snapshot from data retrieved elsewhere.
Can anyone provide a simple example of how one might create such a snapshot from a remote database such that it can be returned as part of the response to a fetch request.
For the purpose of this example let's assume I have a CSV file with rows of data and code to read the data from this file. How would I create a snapshot or snapshots for each of the rows of data.
I am trying to figure out if AppKit provides any support for Async/Await when presenting ViewControllers.
Typically one has to use a completionHandler that gets called when the viewController is dismissed.
Any way to used Async/Await for achieving the same thing ?
Does anyone know where I can find an example of creating a NSView subclass with custom bindings. I need to be able to bind to the object in interface builder.
This is the only reference in Apple documents but as is often the case there appear to be no examples.
https://developer.apple.com/documentation/objectivec/nsobject/nskeyvaluebindingcreation
Topic:
Developer Tools & Services
SubTopic:
Xcode
Anyone else notice that Finder no longer shows most photos exif data when in column mode - usually it appears below the photos image.
I am trying to follow the guide for automating creation of a DMG for distribution of a macOS application but can't figure out how to get the ExportOptions.plist from a manual export.
I am trying to follow this guide:
https://developer.apple.com/documentation/security/customizing-the-xcode-archive-process
What is a 'manual export' and what are the steps for creating a manual export.
`# Ask xcodebuild(1) to export the app. Use the export options
# from a previous manual export that used a Developer ID.
/usr/bin/xcodebuild -exportArchive -archivePath "$ARCHIVE_PATH" -exportOptionsPlist "$SRCROOT/ExportOptions.plist" -exportPath "$EXPORT_PATH"`
Where is "$SRCROOT" ? presumably I have to copy this ExportOptions.plist to this location.
Thanks - I am sure this must be blindingly obvious because there seems to be no reference as to how you do this 'manual export' or where one finds the resulting options file.