Posts

Post not yet marked as solved
0 Replies
363 Views
When I display the PKToolPicker in my app it looks similar to the image below If you use one of the apps from Apple like Pages or Freeform you see a picker similar to this one. Notice that the PKToolPicker from the Apple app has 6 tools not including the ruler. With the tool all the way to the left being the writing tool. How do you get the picker to display with the writing tool? I have looked over the API and I can see where you can set if the ruler is displayed or not but I can't find anything for the writing tool
Posted
by kka.
Last updated
.
Post not yet marked as solved
0 Replies
737 Views
I am working on a Mac app that uses Swift Charts to visualize some data. I can initially plot the data fine. The problem is that I want the ability to "zoom" in on the data. to do this I change the range of the x or y axis using the following modifiers .chartXScale(domain: xMin...xMax) .chartYScale(domain: yMin...yMax) I use a drag gesture to change the values of xMin and xMax for example to zoom in on the data. This does have the effect that I want but the problem is it causes the line to start moving out of the chart area like show below. I don't understand why this is happening. I thought by changing the scale it would cause only the data that is visible on the chart to be displayed.
Posted
by kka.
Last updated
.
Post not yet marked as solved
2 Replies
1.8k Views
Is there a way to "zoom" a swift line chart with a gesture? For example like you zoom in and out in Maps. In this case you would would be changing the x or y axis scale as you pinch in or out.
Posted
by kka.
Last updated
.
Post not yet marked as solved
1 Replies
1.6k Views
I have seen many questions on the forum for how to create a second window (or more) using the Swift life cycle on MACOS. None of the solutions seem to be very good and most of them are a year or more old. Has anyone come up with a good solution for this? Maybe using an AppDelegate?
Posted
by kka.
Last updated
.
Post not yet marked as solved
1 Replies
545 Views
The answer to this question might be obvious but it is escaping me. I have a UInt16 how do I convert it to an Int, or Float, or Double in Swift 5. Sorry if this is obvious.
Posted
by kka.
Last updated
.
Post marked as solved
2 Replies
563 Views
I am writing a MacOS application that reads in a binary data file. The file is broke up into two sections. The first section of the file lists all the information about each channel in the file. For example the channel name, the unit of measure, the type of the data. The possible types are know in advance. For example a channel could be UInt8, Int16, float, etc. The second part of the file is the data. Each set of points starts with a timestamp followed by all of the channel values for that sample in the same order that they are in the header. This pattern repeats until the end of the file. I have a class model that will store all of the information about the channel along with an array containing all of the data for that channel. My question is how could I approach the array for the data in each channel. I won't know in advance what type each channel is until I read the file. I could have an array of each possible type in the model but that feels like a bit of a waste. Is there any way I could either create the array at runtime to the proper type or change the array type at runtime? I am using swift 5.
Posted
by kka.
Last updated
.