Discuss the different user interface frameworks available for your app.

All subtopics
Posts under UI Frameworks topic

Post

Replies

Boosts

Views

Activity

Page-based layouts with TextKit 2?
In the "old" TextKit, page-based layout is accomplished by providing an array of NSTextContainers to NSLayoutManager, each with its own NSTextView. TextKit 2, NSTextLayoutManager allows only a single text container. Additionally, NSTextParagraph seems to be the only concrete NSTextElement class. Paragraphs often need to break across page boundaries. How would one implement page-based layout in TextKit 2?
4
0
3.6k
Aug ’23
How to Use Quick Notes Using SwiftUI
I am trying to implement Quick Notes through SwiftUI, rather than UIKit or AppKit. I am unsure if the behaviour below is expected, or due to a bug. I have already successfully implemented NSUserActivity for Handoff, Spotlight and Siri Reminders, using the .userActivity() view modifier. These NSUserActivity instances use the NSUserActivity.userInfo dictionary to store and correctly restore the content through the .onContinueUserActivity(perform: ) methods. Quick Notes requires using the .persistentIdentifier or .targetContentIdentifier properties, rather than the .userInfo dictionary alone. However, when I set these either of these to unique identifiers using the code below, they are not correctly stored within the useractivity. MyView() .userActivity(ActivityString, updateUserActivity) private func updateUserActivity(_ activity: NSUserActivity) {     activity.isEligibleForSearch = true     activity.isEligibleForHandoff = true     activity.title = "Title"     activity.targetContentIdentifier = myItemUniqueID     activity.persistentIdentifier = myItemUniqueID     activity.userInfo = ["id": myItemUniqueID]     print(activity.targetContentIdentifier) // Correctly prints     print(activity.persistentIdentifier) // Correctly prints     print(activity.userInfo) // Correctly prints     } The identifiers print correctly when setting the user activity above. However, when restoring the user activity (tested through Handoff and Spotlight Search), the targetContentIdentifier and persistentIdentifier strings are empty. MyView()     .onContinueUserActivity(ActivityString, perform: continueUserActivity) private func continueUserActivity(_ activity: NSUserActivity) {     print(activity.persistentIdentifier) // Nil     print(activity.targetContentIdentifier) // Nil     print(activity.userInfo) // Correctly prints     } Is there something else I must do, or is this unexpected behaviour?
1
0
1.7k
Jul ’23
Saving Color from UIColorPickerViewController with UserDefaults
I've been trying to save a selected color with UserDefaults from UIColorPickerViewController. But I run into a color space fiasco. Anyway, here come my lines of code. class ViewController: UIViewController, UIColorPickerViewControllerDelegate { @IBOutlet weak var imageView: UIImageView! @IBAction func selectTapped(_ sender: UIButton) { let picker = UIColorPickerViewController() picker.delegate = self picker.selectedColor = .yellow picker.supportsAlpha = false present(picker, animated: true, completion: nil) } override func viewDidLoad() { super.viewDidLoad() } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) if let color = UserDefaultsUIColor.shared.readColor(key: "MyColor") { print("Color being read: \(color)") } } func colorPickerViewControllerDidFinish(_ viewController: UIColorPickerViewController) { let color = viewController.selectedColor print("Selected color: \(color)") UserDefaultsUIColor.shared.saveColor(color: viewController.selectedColor, key: "MyColor") } func colorPickerViewControllerDidSelectColor(_ viewController: UIColorPickerViewController) { imageView.backgroundColor = viewController.selectedColor } } class UserDefaultsUIColor { static let shared = UserDefaultsUIColor() func saveColor(color: UIColor, key: String) { let userDefaults = UserDefaults.standard do { let data = try NSKeyedArchiver.archivedData(withRootObject: color, requiringSecureCoding: false) as NSData? userDefaults.set(data, forKey: key) } catch { print("Error UserDefaults: \(error.localizedDescription)") } } func readColor(key: String) -> UIColor? { let userDefaults = UserDefaults.standard if let data = userDefaults.data(forKey: key) { do { if let color = try NSKeyedUnarchiver.unarchivedObject(ofClass: UIColor.self, from: data) { return color } } catch { print("Error UserDefaults") } } return nil } } I first start out with a yellow color (UIColor.yellow). And I select a color whose RGB values are 76, 212, 158, respectively. And the color picker guy returns the following. kCGColorSpaceModelRGB 0.298039 0.831373 0.619608 1 And I get the following in reading the saved color data object. UIExtendedSRGBColorSpace -0.270778 0.84506 0.603229 1 How can I save and read color data objects consistently? I could specify a color space when I save a color. But it doesn't go well. Muchos thankos Señor Tomato de Source
0
0
981
Jun ’23
How do you make the Medium view look the way it's supposed to?
I know this is far after the fact, but in going through the Widgets Code-along, part 2: Alternate timelines code-along, and having done very little SwiftUI, I ran into an issue that I can't seem to figure out. Things like this are one of the biggest reasons I haven't even considered migrating any of my apps to SwiftUI - I just can't get the UI to look the way I want it to. The code in question is very simple: Just a couple of things inside an HStack. For some reason, they added a ZStack around that (the HStack is the only thing inside it), and that ZStack changes the font size of one of the two HStack contents very slightly. For some reason. I'm really not sure why they bothered with the ZStack - it only has one thing inside it. Anyway, the code looks like this: HStack(alignment: .top) { AvatarView(entry.character) .foregroundColor(.white) Text(entry.character.bio) .padding() .foregroundColor(.white) } .padding() .widgetURL(entry.character.url) } .background(Color.gameBackground) .widgetURL(entry.character.url) And on the Panda hero (the only one Izzy demos), it looks fine. But The problem is with literally any other hero - they all have bios that are longer than Panda's, and they all clip their contents. If I put a background or a border on the Text(), it's very clear that while the left side (the AvatarView) takes up the whole height of the widget, the Text does not. That makes sense if its contents are small, but in most cases, the contents are substantially larger, and they clip, while leaving a bunch of blank space underneath. Obviously, that's just simply unacceptable from a UI perspective, and I haven't been able to figure out which of the modifiers I can put on Text will correct this - if any. I'm excited about the potential of SwiftUI to simplify what can often be huge storyboards, but things like this (******, little, should-be-easy things being effectively impossible) make me think that it's not worth the hassle. I did do web searches, including looking on StackOverflow, but what do you even search on for things like this? The terms I searched on, at least, bore no fruit. Thanks in advance for any help you can offer.
2
0
1k
Jun ’23
Core Data sharing with other users
Hi everyone i have an app that has some related entities. throught the different type of tutorial i see that apple incourages to use relationship and inverse relationship in the core data model, and that what i have done. Now, when i reach the point that a user wants to share one particular entity to other users, the inverse relationship spread the share to all the graph of core database shouldn't the inverse relationship be ignored by the share process? if i want to share only that record and the child, not the parent one, should i break the realtionship with the parent (that for me is the inverse relationship) imposing it to a nil value?
0
0
1.1k
Jun ’23
Can we please get a coherent automation framework in macOS?
I'm specifically talking about macOS because the others are very different beasts. Since, well literally the first release of OS X 10.0, there has not been a coherent automation framework on the Mac. The last OS to offer that was Mac OS 9.X To define terms, by coherent, I mean from the command line environment up through the user interface. A single, coherent automation framework that is usable across the entire OS, ala PowerShell on windows. That doesn't exist for current macOS, nor has it ever existed for any variant of macOS since again, Mac OS 9.X At best it has been a pastiche of completely different frameworks, operating modalities and languages all desperately trying to work together via osascript and do shell script. That any of it works at all is like a talking dog: the fact the dog talks is a miracle, bad grammar is minor. Yes, I know Shortcuts exist, but shortcuts are a developer managed bit of pseudo-automation. If I limit myself to Shortcuts, then I have little to no ability to do anything beyond what the developer of that application chooses to allow me to do. For example, at least as of Ventura, Dictionary, Font Book, iMovie and others have no shortcuts. I can't create my own shortcut for those apps, the devs have to do that. (the fact that Apple is not flooding us with Shortcuts shows how little Apple cares as a company about this. Individual teams wax good and bad, but clearly, Apple doesn't think dogfooding here is important.) (Note: if your only comment is to ask why anyone would care about automating , that's absolutely not the point. The idea is to make it possible for everyone, not just developers, to create in ways no one can predict outside of an application's constraints.) "Well, there's always AppleScript/JXA" I will not write down the laughter here, but there is laughter. As of Ventura, there are no less than 32 Apple applications with no scripting dictionary at all, so neither AppleScript/JXA can work. You might be able to use UI scripting, but no guarantee there, and UI scripting is a fragile thing, at best suited to a last resort option. Again, Apple could lead the way, they choose not to. But that's only the UI levels. Below the UI, then there's no coherency at all. You're stuck with shell scripts and whatever a given utility's author chose to allow, and sharing data and information is no better than at the UI level, and neither the command line level nor the UI level know the other exists. The only way to combine the two is again: Do Shell Script Osascript That is not a coherent automation framework. Then of course, there's the lack of documentation. AppleScript has inherited at least the language guide, which is well-written and usable, but the command line level has man pages. Which are the most inconsistent things. Some utilities' man pages are remarkably useful, others don't even have man pages. At all. Other utilities man pages have syntax errors for the command that brings up the help page and that is all the man page does. Ponder the disconnect there: --help provides detailed usage information that is not in the man page. The man page says use ---help which is bad syntax. This seems odd, but why is the --help output not also in the man page? Is that not the purpose of the man page? Man page inconsistencies aside, Apple developer support has only ever barely acknowledged automation/scripting and really never supported it except for accidentally. Even in a language like AppleScriptObjecttiveC, (ASOC) which one can use for real apps in the MAS, the response from DTS for help was "use the mailing list." (not that DTS is that good anyway, I had an issue with CoreWLAN in ventura, and have since been ghosted on any notification that the OS bug that was causing me problems has been fixed. Maybe it has, maybe it hasn't. I can test for it, but why did DTS ghost an actual SwiftUI issue for an app written in Swift? ¯_(ツ)_/¯ This is a solveable problem, Microsoft has solved it in terms of language, documentation and coherency, with PowerShell. Leaving aside architectural issues that make it almost impossible to properly secure windows, the way MS treats PowerShell is the example. Windows as an OS has excellent support for automation, the documentation for PowerShell is amazing, (the documentation for a scripting language is better than Apple's entire developer docs, which is just inexcusable.) The difference between automating either platform is night and day, and in a race with two horses, Apple is a distant fifth. The language syntax here is almost a non-issue. In fact, I think using a "powershell'd" version of Swift would be an excellent idea. Create a simpler version of swift in the way PowerShell is a simpler version of C#. Make it so if you need to call a framework outside of the main automation framework, you can do so with ease, ala PowerShell. For example, PowerShell has no GUI primitives the way AppleScript does, so to create a file choose browser in PowerShell, you instead invoke the correct .NET framework: Add-Type -AssemblyName System.Windows.Forms $FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ InitialDirectory = [Environment]::GetFolderPath('Desktop') } $null = $FileBrowser.ShowDialog() Ironically, you can do this with ASOC, but only for items that have ObjC interfaces, which will be shrinking. Having a coherent automation framework with a primary language that allows people using it to more easily use "full" Swift and its frameworks as needed is a force-multiplier for Apple. It would help people do more with macOS and maybe other platforms depending on implementation, not less. It would not force people to beg the developers of their apps to write Yet Another Shortcut to do this thing that they can't do, (or have to do the dance to convince the dev that their need is worth the trouble), and it would allow people to solve their problems in their own ways for their own needs. But, it requires Apple to care about this at all, and that is where the problem is. This is fixable, Apple has the resources to fix it, what they lack is interest and desire. But creating and fully supporting a proper automation framework would add so much to macOS and the other platforms by extension that there's no logic behind not doing so. Maybe next year. (in the best lol of all, you can't even create an automation tag for a post. sigh.)
0
5
1.2k
Jun ’23
Add controls to large title in navigation bar
Good day together, I am already in despair, I would like to insert a button in the NavigationBar next to the NavigationBarTitle which also automatically shrinks or enlarges. The whole thing can be seen in the App Store under the menu item "search". There, when the user scrolls down, the search bar and the title is given as .inline but not the user button. I am currently trying to implement the whole thing in SwiftUI and can't find a solution. Is there already a solution for this or if someone has the exact documentation for this case I would be very grateful for it :). thank you very much!
2
0
1.9k
Jun ’23
About Font size variants for UIButton when filled style
Hi Team, In my new project I am trying to adopt new UIButton styles like filled. My project will support for iPhone and iPad. So, I need to set different font size in story board. When I checked I count not find any solution (like in older Xcode, I can see + button in front of Font option) when I select UIButton style plain, filled etc, except default. For default UIButton I can see , but I want use new configuration also. How can I achieve this? I am using Xcode 14.1
1
0
846
Apr ’23
Appium Inpector showing XCUIElementTypeAny instead of XCUIElementTypeCell
In a table view, there is a list of multiple Cells we have applied accessibility IDs for that list but when I inspect it through Appium inspector it is showing XCUIElementTypeAny instead of XCUIElementTypeCell and inside the Cell, all child element is also showing XCUIElementTypeAny and due to this I am not able to automate those.
1
0
1.4k
Mar ’23
Where is source code for code-fragments used in WWDC videos
WWDC videos are good. But there is contextual information that is sometimes left out . If one wants to try and build the code fragment being explained in the video, where to take it from. This is esp imp for concurrency and SwiftUI videos. For instance: https://developer.apple.com/videos/play/wwdc2021/10022/, Time:6:50. .dogTagID is not used in the code fragment and is the basis of whole explanation there. It appears that dogTagID is a field that is part of rescueDogs structure - when this assumption starts coming in, it gets difficult to comprehend the details concretely. This is the case with many wwdc videos. Probably there is a code that already exist somewhere in repository. It is not mentioned the video. Thanks for looking into it.
0
0
677
Feb ’23
Swipable fullscreen modal like Apple music lyrics
I would like to have a fullscreen "view" that slides up from the bottom after a user action, and that can be swiped down smoothly like a "sheet". I understand that there are sheets that are swipable, but dont really cover the fullscreen, and then that there is fullscreencover which does cover the full screen but is not swipable. In apple music, whenever you click on a song, a fullscreen "modal" slides up from the bottom, and is swipable. How can I achieve that. I'm guessing if apple does it on their apps, they allow users to have the possibility to achieve the same results.
1
1
3.2k
Feb ’23
Leaving/Stopping CKShare using CoreData
Hello, I am working with sharing over Core Data. I would like to implement my own UI to share records and manage participants. In the CKShare's documentation we can read: However, only the owner can delete a shared hierarchy’s root record. If a participant attempts to delete the share, CloudKit removes the participant. The share remains active for all other participants (https://developer.apple.com/documentation/cloudkit/ckshare). However, when I delete a shared NSManagedObject (as a participant), using self.moc.delete(sharedProject), the object is deleted even for its owner. On the other hand, accoring to the "Sharing Core Data objects between iCloud users" documentation (https://developer.apple.com/documentation/coredata/sharing_core_data_objects_between_icloud_users), to delete a share, we should use the purgeObjectsAndRecordsInZone(with:in:completion:) method. And that works, however, NSManagedObjectContext doesn't merge changes. Moreover, in the same documentation we can read: Manages the participants of the share from the owner side using addParticipant(:) and removeParticipant(:), or stops the sharing by calling purgeObjectsAndRecordsInZone(with:in:completion:). Unfortunately, calling that method from the owner side leads to deletion of the shared record. Do you have any ideas how to receive a similar effect like in the UICloudSharingController?
0
2
1.3k
Jan ’23
Multiple errors 5 minutes into Build a Workout App for Apple Watch
Below is the exact code (though I changed the sports) in the video at https://developer.apple.com/videos/play/wwdc2021/10009/ Why all of these errors? import SwiftUI import HealthKit struct StartView: View {   var workoutTypes: [HKWorkoutActivityType] = [.paddleSports, .sailing, .swimming]       var body: some View {     List(workoutTypes) { workoutType in       NavigationLink(         workoutType.name,         destination: Text(workoutType.nam e)**       ).padding(         EdgeInsets(top: 15, leading: 5, bottom: 15, trailing: 5)       )   }     .listStyle(.carousel)     .navigationBarTitle("Activity") } struct ContentView_Previews: PreviewProvider {   static var previews: some View {     StartView()   } } extension HKWorkoutActivityType: Identifiable {   public var id: UInt {     rawValue   }       var name: String {     switch self {     case .paddleSports:       return "Paddle"     case .sailing:       return "Sail"     case .swimming:       return "Swim"     default:       return ""     }   } } }
0
0
974
Nov ’22
Page-based layouts with TextKit 2?
In the "old" TextKit, page-based layout is accomplished by providing an array of NSTextContainers to NSLayoutManager, each with its own NSTextView. TextKit 2, NSTextLayoutManager allows only a single text container. Additionally, NSTextParagraph seems to be the only concrete NSTextElement class. Paragraphs often need to break across page boundaries. How would one implement page-based layout in TextKit 2?
Replies
4
Boosts
0
Views
3.6k
Activity
Aug ’23
SwiftUI API for captureTextFromCamera ?
Hi, the video was great and on point, but it only featured UIKit apis. 3 years into the SwiftUI transition, I wonder if this is a UIKit only feature or can we also use it if we chose SwiftUI to build our apps ? Thanks
Replies
3
Boosts
0
Views
2.4k
Activity
Jul ’23
How to Use Quick Notes Using SwiftUI
I am trying to implement Quick Notes through SwiftUI, rather than UIKit or AppKit. I am unsure if the behaviour below is expected, or due to a bug. I have already successfully implemented NSUserActivity for Handoff, Spotlight and Siri Reminders, using the .userActivity() view modifier. These NSUserActivity instances use the NSUserActivity.userInfo dictionary to store and correctly restore the content through the .onContinueUserActivity(perform: ) methods. Quick Notes requires using the .persistentIdentifier or .targetContentIdentifier properties, rather than the .userInfo dictionary alone. However, when I set these either of these to unique identifiers using the code below, they are not correctly stored within the useractivity. MyView() .userActivity(ActivityString, updateUserActivity) private func updateUserActivity(_ activity: NSUserActivity) {     activity.isEligibleForSearch = true     activity.isEligibleForHandoff = true     activity.title = "Title"     activity.targetContentIdentifier = myItemUniqueID     activity.persistentIdentifier = myItemUniqueID     activity.userInfo = ["id": myItemUniqueID]     print(activity.targetContentIdentifier) // Correctly prints     print(activity.persistentIdentifier) // Correctly prints     print(activity.userInfo) // Correctly prints     } The identifiers print correctly when setting the user activity above. However, when restoring the user activity (tested through Handoff and Spotlight Search), the targetContentIdentifier and persistentIdentifier strings are empty. MyView()     .onContinueUserActivity(ActivityString, perform: continueUserActivity) private func continueUserActivity(_ activity: NSUserActivity) {     print(activity.persistentIdentifier) // Nil     print(activity.targetContentIdentifier) // Nil     print(activity.userInfo) // Correctly prints     } Is there something else I must do, or is this unexpected behaviour?
Replies
1
Boosts
0
Views
1.7k
Activity
Jul ’23
Saving Color from UIColorPickerViewController with UserDefaults
I've been trying to save a selected color with UserDefaults from UIColorPickerViewController. But I run into a color space fiasco. Anyway, here come my lines of code. class ViewController: UIViewController, UIColorPickerViewControllerDelegate { @IBOutlet weak var imageView: UIImageView! @IBAction func selectTapped(_ sender: UIButton) { let picker = UIColorPickerViewController() picker.delegate = self picker.selectedColor = .yellow picker.supportsAlpha = false present(picker, animated: true, completion: nil) } override func viewDidLoad() { super.viewDidLoad() } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) if let color = UserDefaultsUIColor.shared.readColor(key: "MyColor") { print("Color being read: \(color)") } } func colorPickerViewControllerDidFinish(_ viewController: UIColorPickerViewController) { let color = viewController.selectedColor print("Selected color: \(color)") UserDefaultsUIColor.shared.saveColor(color: viewController.selectedColor, key: "MyColor") } func colorPickerViewControllerDidSelectColor(_ viewController: UIColorPickerViewController) { imageView.backgroundColor = viewController.selectedColor } } class UserDefaultsUIColor { static let shared = UserDefaultsUIColor() func saveColor(color: UIColor, key: String) { let userDefaults = UserDefaults.standard do { let data = try NSKeyedArchiver.archivedData(withRootObject: color, requiringSecureCoding: false) as NSData? userDefaults.set(data, forKey: key) } catch { print("Error UserDefaults: \(error.localizedDescription)") } } func readColor(key: String) -> UIColor? { let userDefaults = UserDefaults.standard if let data = userDefaults.data(forKey: key) { do { if let color = try NSKeyedUnarchiver.unarchivedObject(ofClass: UIColor.self, from: data) { return color } } catch { print("Error UserDefaults") } } return nil } } I first start out with a yellow color (UIColor.yellow). And I select a color whose RGB values are 76, 212, 158, respectively. And the color picker guy returns the following. kCGColorSpaceModelRGB 0.298039 0.831373 0.619608 1 And I get the following in reading the saved color data object. UIExtendedSRGBColorSpace -0.270778 0.84506 0.603229 1 How can I save and read color data objects consistently? I could specify a color space when I save a color. But it doesn't go well. Muchos thankos Señor Tomato de Source
Replies
0
Boosts
0
Views
981
Activity
Jun ’23
How do you make the Medium view look the way it's supposed to?
I know this is far after the fact, but in going through the Widgets Code-along, part 2: Alternate timelines code-along, and having done very little SwiftUI, I ran into an issue that I can't seem to figure out. Things like this are one of the biggest reasons I haven't even considered migrating any of my apps to SwiftUI - I just can't get the UI to look the way I want it to. The code in question is very simple: Just a couple of things inside an HStack. For some reason, they added a ZStack around that (the HStack is the only thing inside it), and that ZStack changes the font size of one of the two HStack contents very slightly. For some reason. I'm really not sure why they bothered with the ZStack - it only has one thing inside it. Anyway, the code looks like this: HStack(alignment: .top) { AvatarView(entry.character) .foregroundColor(.white) Text(entry.character.bio) .padding() .foregroundColor(.white) } .padding() .widgetURL(entry.character.url) } .background(Color.gameBackground) .widgetURL(entry.character.url) And on the Panda hero (the only one Izzy demos), it looks fine. But The problem is with literally any other hero - they all have bios that are longer than Panda's, and they all clip their contents. If I put a background or a border on the Text(), it's very clear that while the left side (the AvatarView) takes up the whole height of the widget, the Text does not. That makes sense if its contents are small, but in most cases, the contents are substantially larger, and they clip, while leaving a bunch of blank space underneath. Obviously, that's just simply unacceptable from a UI perspective, and I haven't been able to figure out which of the modifiers I can put on Text will correct this - if any. I'm excited about the potential of SwiftUI to simplify what can often be huge storyboards, but things like this (******, little, should-be-easy things being effectively impossible) make me think that it's not worth the hassle. I did do web searches, including looking on StackOverflow, but what do you even search on for things like this? The terms I searched on, at least, bore no fruit. Thanks in advance for any help you can offer.
Replies
2
Boosts
0
Views
1k
Activity
Jun ’23
Core Data sharing with other users
Hi everyone i have an app that has some related entities. throught the different type of tutorial i see that apple incourages to use relationship and inverse relationship in the core data model, and that what i have done. Now, when i reach the point that a user wants to share one particular entity to other users, the inverse relationship spread the share to all the graph of core database shouldn't the inverse relationship be ignored by the share process? if i want to share only that record and the child, not the parent one, should i break the realtionship with the parent (that for me is the inverse relationship) imposing it to a nil value?
Replies
0
Boosts
0
Views
1.1k
Activity
Jun ’23
Can we please get a coherent automation framework in macOS?
I'm specifically talking about macOS because the others are very different beasts. Since, well literally the first release of OS X 10.0, there has not been a coherent automation framework on the Mac. The last OS to offer that was Mac OS 9.X To define terms, by coherent, I mean from the command line environment up through the user interface. A single, coherent automation framework that is usable across the entire OS, ala PowerShell on windows. That doesn't exist for current macOS, nor has it ever existed for any variant of macOS since again, Mac OS 9.X At best it has been a pastiche of completely different frameworks, operating modalities and languages all desperately trying to work together via osascript and do shell script. That any of it works at all is like a talking dog: the fact the dog talks is a miracle, bad grammar is minor. Yes, I know Shortcuts exist, but shortcuts are a developer managed bit of pseudo-automation. If I limit myself to Shortcuts, then I have little to no ability to do anything beyond what the developer of that application chooses to allow me to do. For example, at least as of Ventura, Dictionary, Font Book, iMovie and others have no shortcuts. I can't create my own shortcut for those apps, the devs have to do that. (the fact that Apple is not flooding us with Shortcuts shows how little Apple cares as a company about this. Individual teams wax good and bad, but clearly, Apple doesn't think dogfooding here is important.) (Note: if your only comment is to ask why anyone would care about automating , that's absolutely not the point. The idea is to make it possible for everyone, not just developers, to create in ways no one can predict outside of an application's constraints.) "Well, there's always AppleScript/JXA" I will not write down the laughter here, but there is laughter. As of Ventura, there are no less than 32 Apple applications with no scripting dictionary at all, so neither AppleScript/JXA can work. You might be able to use UI scripting, but no guarantee there, and UI scripting is a fragile thing, at best suited to a last resort option. Again, Apple could lead the way, they choose not to. But that's only the UI levels. Below the UI, then there's no coherency at all. You're stuck with shell scripts and whatever a given utility's author chose to allow, and sharing data and information is no better than at the UI level, and neither the command line level nor the UI level know the other exists. The only way to combine the two is again: Do Shell Script Osascript That is not a coherent automation framework. Then of course, there's the lack of documentation. AppleScript has inherited at least the language guide, which is well-written and usable, but the command line level has man pages. Which are the most inconsistent things. Some utilities' man pages are remarkably useful, others don't even have man pages. At all. Other utilities man pages have syntax errors for the command that brings up the help page and that is all the man page does. Ponder the disconnect there: --help provides detailed usage information that is not in the man page. The man page says use ---help which is bad syntax. This seems odd, but why is the --help output not also in the man page? Is that not the purpose of the man page? Man page inconsistencies aside, Apple developer support has only ever barely acknowledged automation/scripting and really never supported it except for accidentally. Even in a language like AppleScriptObjecttiveC, (ASOC) which one can use for real apps in the MAS, the response from DTS for help was "use the mailing list." (not that DTS is that good anyway, I had an issue with CoreWLAN in ventura, and have since been ghosted on any notification that the OS bug that was causing me problems has been fixed. Maybe it has, maybe it hasn't. I can test for it, but why did DTS ghost an actual SwiftUI issue for an app written in Swift? ¯_(ツ)_/¯ This is a solveable problem, Microsoft has solved it in terms of language, documentation and coherency, with PowerShell. Leaving aside architectural issues that make it almost impossible to properly secure windows, the way MS treats PowerShell is the example. Windows as an OS has excellent support for automation, the documentation for PowerShell is amazing, (the documentation for a scripting language is better than Apple's entire developer docs, which is just inexcusable.) The difference between automating either platform is night and day, and in a race with two horses, Apple is a distant fifth. The language syntax here is almost a non-issue. In fact, I think using a "powershell'd" version of Swift would be an excellent idea. Create a simpler version of swift in the way PowerShell is a simpler version of C#. Make it so if you need to call a framework outside of the main automation framework, you can do so with ease, ala PowerShell. For example, PowerShell has no GUI primitives the way AppleScript does, so to create a file choose browser in PowerShell, you instead invoke the correct .NET framework: Add-Type -AssemblyName System.Windows.Forms $FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ InitialDirectory = [Environment]::GetFolderPath('Desktop') } $null = $FileBrowser.ShowDialog() Ironically, you can do this with ASOC, but only for items that have ObjC interfaces, which will be shrinking. Having a coherent automation framework with a primary language that allows people using it to more easily use "full" Swift and its frameworks as needed is a force-multiplier for Apple. It would help people do more with macOS and maybe other platforms depending on implementation, not less. It would not force people to beg the developers of their apps to write Yet Another Shortcut to do this thing that they can't do, (or have to do the dance to convince the dev that their need is worth the trouble), and it would allow people to solve their problems in their own ways for their own needs. But, it requires Apple to care about this at all, and that is where the problem is. This is fixable, Apple has the resources to fix it, what they lack is interest and desire. But creating and fully supporting a proper automation framework would add so much to macOS and the other platforms by extension that there's no logic behind not doing so. Maybe next year. (in the best lol of all, you can't even create an automation tag for a post. sigh.)
Replies
0
Boosts
5
Views
1.2k
Activity
Jun ’23
Figma Design System for visionOS
After the foundation video and UI Design session on the Apple Developers app, I was wondering if you have prepared an official figma ui design system template that we can use?
Replies
0
Boosts
1
Views
1.2k
Activity
Jun ’23
Add controls to large title in navigation bar
Good day together, I am already in despair, I would like to insert a button in the NavigationBar next to the NavigationBarTitle which also automatically shrinks or enlarges. The whole thing can be seen in the App Store under the menu item "search". There, when the user scrolls down, the search bar and the title is given as .inline but not the user button. I am currently trying to implement the whole thing in SwiftUI and can't find a solution. Is there already a solution for this or if someone has the exact documentation for this case I would be very grateful for it :). thank you very much!
Replies
2
Boosts
0
Views
1.9k
Activity
Jun ’23
About Font size variants for UIButton when filled style
Hi Team, In my new project I am trying to adopt new UIButton styles like filled. My project will support for iPhone and iPad. So, I need to set different font size in story board. When I checked I count not find any solution (like in older Xcode, I can see + button in front of Font option) when I select UIButton style plain, filled etc, except default. For default UIButton I can see , but I want use new configuration also. How can I achieve this? I am using Xcode 14.1
Replies
1
Boosts
0
Views
846
Activity
Apr ’23
Appium Inpector showing XCUIElementTypeAny instead of XCUIElementTypeCell
In a table view, there is a list of multiple Cells we have applied accessibility IDs for that list but when I inspect it through Appium inspector it is showing XCUIElementTypeAny instead of XCUIElementTypeCell and inside the Cell, all child element is also showing XCUIElementTypeAny and due to this I am not able to automate those.
Replies
1
Boosts
0
Views
1.4k
Activity
Mar ’23
Where is source code for code-fragments used in WWDC videos
WWDC videos are good. But there is contextual information that is sometimes left out . If one wants to try and build the code fragment being explained in the video, where to take it from. This is esp imp for concurrency and SwiftUI videos. For instance: https://developer.apple.com/videos/play/wwdc2021/10022/, Time:6:50. .dogTagID is not used in the code fragment and is the basis of whole explanation there. It appears that dogTagID is a field that is part of rescueDogs structure - when this assumption starts coming in, it gets difficult to comprehend the details concretely. This is the case with many wwdc videos. Probably there is a code that already exist somewhere in repository. It is not mentioned the video. Thanks for looking into it.
Replies
0
Boosts
0
Views
677
Activity
Feb ’23
Swipable fullscreen modal like Apple music lyrics
I would like to have a fullscreen "view" that slides up from the bottom after a user action, and that can be swiped down smoothly like a "sheet". I understand that there are sheets that are swipable, but dont really cover the fullscreen, and then that there is fullscreencover which does cover the full screen but is not swipable. In apple music, whenever you click on a song, a fullscreen "modal" slides up from the bottom, and is swipable. How can I achieve that. I'm guessing if apple does it on their apps, they allow users to have the possibility to achieve the same results.
Replies
1
Boosts
1
Views
3.2k
Activity
Feb ’23
IOS Skywalk Family or kernel pipe, or interface
Just wondering what this skywalk framework is. It comes up in my finder files in IO KitPersonalities.
Replies
3
Boosts
0
Views
4.3k
Activity
Feb ’23
Leaving/Stopping CKShare using CoreData
Hello, I am working with sharing over Core Data. I would like to implement my own UI to share records and manage participants. In the CKShare's documentation we can read: However, only the owner can delete a shared hierarchy’s root record. If a participant attempts to delete the share, CloudKit removes the participant. The share remains active for all other participants (https://developer.apple.com/documentation/cloudkit/ckshare). However, when I delete a shared NSManagedObject (as a participant), using self.moc.delete(sharedProject), the object is deleted even for its owner. On the other hand, accoring to the "Sharing Core Data objects between iCloud users" documentation (https://developer.apple.com/documentation/coredata/sharing_core_data_objects_between_icloud_users), to delete a share, we should use the purgeObjectsAndRecordsInZone(with:in:completion:) method. And that works, however, NSManagedObjectContext doesn't merge changes. Moreover, in the same documentation we can read: Manages the participants of the share from the owner side using addParticipant(:) and removeParticipant(:), or stops the sharing by calling purgeObjectsAndRecordsInZone(with:in:completion:). Unfortunately, calling that method from the owner side leads to deletion of the shared record. Do you have any ideas how to receive a similar effect like in the UICloudSharingController?
Replies
0
Boosts
2
Views
1.3k
Activity
Jan ’23
Is Speech Framework is available for Apple Tv
We are not able to find speech framework for apple tv. we have to implement Speech to Text in our application. When we are import speech framework in Apple Tv we get Error Like (No such module 'Speech' Please provide solution for this. )
Replies
0
Boosts
0
Views
1.1k
Activity
Jan ’23
Multiple errors 5 minutes into Build a Workout App for Apple Watch
Below is the exact code (though I changed the sports) in the video at https://developer.apple.com/videos/play/wwdc2021/10009/ Why all of these errors? import SwiftUI import HealthKit struct StartView: View {   var workoutTypes: [HKWorkoutActivityType] = [.paddleSports, .sailing, .swimming]       var body: some View {     List(workoutTypes) { workoutType in       NavigationLink(         workoutType.name,         destination: Text(workoutType.nam e)**       ).padding(         EdgeInsets(top: 15, leading: 5, bottom: 15, trailing: 5)       )   }     .listStyle(.carousel)     .navigationBarTitle("Activity") } struct ContentView_Previews: PreviewProvider {   static var previews: some View {     StartView()   } } extension HKWorkoutActivityType: Identifiable {   public var id: UInt {     rawValue   }       var name: String {     switch self {     case .paddleSports:       return "Paddle"     case .sailing:       return "Sail"     case .swimming:       return "Swim"     default:       return ""     }   } } }
Replies
0
Boosts
0
Views
974
Activity
Nov ’22
where should Xcode UI Tests live ?
Where in your opinion UI Test Code should live ? In the app code repository itself In a different UI TEST ONLY repository
Replies
1
Boosts
0
Views
923
Activity
Nov ’22
UICloudSharingController
how can i share all the entities in core data to other icloud user ?
Replies
0
Boosts
0
Views
798
Activity
Oct ’22
"the host declined to create a scene" calling requestSceneSessionActivation
I have a multi-window app. Additional scenes can be properly created from the dock, although I'm not able to create a new scene programmatically via requestSceneSessionActivation. I get the following error: Open window errror: The operation couldn’t be completed. the host declined to create a scene. Any thoughts?
Replies
4
Boosts
0
Views
2.2k
Activity
Oct ’22