Post

Replies

Boosts

Views

Activity

Reply to Apple's spam policy
Do your apps have the same icon ? Read those older posts: https://developer.apple.com/forums/thread/46910 https://developer.apple.com/forums/thread/114079 Did you consider inApp purchase, as recommended in guidelines ? 4.3 Spam Don’t create multiple Bundle IDs of the same app. If your app has different versions for specific locations, sports teams, universities, etc., consider submitting a single app and provide the variations using in-app purchase. Also avoid piling on to a category that is already saturated; the App Store has enough fart, burp, flashlight, fortune telling, dating, drinking games, and Kama Sutra apps, etc. already. We will reject these apps unless they provide a unique, high-quality experience. Spamming the store may lead to your removal from the Apple Developer Program.
Oct ’21
Reply to CoreFoundation/ UIKit thousands crashes in iOS 15
Could you show the error message you get ? In an older thread eskimo explained the error is due to wrong use of observer : https://developer.apple.com/forums/thread/100012 or https://stackoverflow.com/questions/17969493/cfrunloop-is-calling-out-to-an-observer-callback-function-18-23-corefoundati Could be that iOS 15 is less tolerant to such error than previous iOS.
Oct ’21
Reply to CallKit is too limited
We need this because this feature is crucial for the application that we are developing right now. Maybe, but you have to follow iOS rules… There are some possibilities, described by whatsapp h t t p s : / / faq.whatsapp.com/iphone/how-to-link-to-whatsapp-from-a-different-app?lang=en but with restrictions (user has to launch the call anyway): https://stackoverflow.com/questions/41999491/how-can-i-place-a-whatsapp-call-from-an-ios-app
Topic: App & System Services SubTopic: General Tags:
Oct ’21
Reply to IOKit: Retrieving USB Name, Vendor ID and Product ID after Serial Connection.
Hoping that may help, here is what I do for MacOS, to retrieve some infos (serial number, capacity and vendor): Dictionary entry is "DADeviceVendor" ; device name "DAVolumeName" ; whet do you expect in ProductID ? func getSerialAndSize(_ url: URL) -> (String, Int, String) { if let session = DASessionCreate(nil) { if let disk : DADisk = DADiskCreateFromVolumePath(nil, session, url as CFURL) { // We found a mount point... let ioService : io_service_t = DADiskCopyIOMedia(disk) let key = "USB Serial Number" let options : IOOptionBits = IOOptionBits(kIORegistryIterateParents) | IOOptionBits(kIORegistryIterateRecursively) if let sSerial : CFTypeRef = IORegistryEntrySearchCFProperty(ioService, kIOServicePlane, key as CFString, nil, options) { let dico: CFDictionary = DADiskCopyDescription(disk)! let vendor = (dico as NSDictionary)["DADeviceVendor"] as? String ?? "--" let driveCapacity = (dico as NSDictionary)["DAMediaSize"] as? Int ?? 0 return (String(describing: sSerial), driveCapacity, vendor) } else { return ("", 0, "") } } } return ("", 0) }
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to Modifying the Y-position of navigation bar isn't possible in iOS 15.1 Beta / iOS 15 simulators
@karlingen I see an option: design a custom view that will mimic the navigation bar when you start scrolling, hide the navigation bar show this custom view (with all the same buttons that were in navbar): buttons still to be active once scroll started move the custom view according to scroll position when scroll return to original position, unhide navigation bar and hide custom view…
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’21
Reply to Two NSTextView inside the same NSScrollView
So, what you want is to sync the scrolls ? You would have to do it in code, by adjusting the other view contentView bounds (or visibleRect) when you scrolled. You may have to create your own notification as in this example (that's Xamarin, so may be not totally relevant): h t t p s : / / social.msdn.microsoft.com/Forums/en-US/23035d90-987e-4201-b8be-11f424271699/how-to-detect-when-nstextview-scrolls-vertically?forum=xamarinios This is a complete case, a bit tricky https://stackoverflow.com/questions/6596567/synchronize-two-nsscrollview
Topic: UI Frameworks SubTopic: AppKit Tags:
Oct ’21
Reply to Two NSTextView inside the same NSScrollView
If that may help, this is what I did to sync the vertical scroll of 2 tableViews (would be very similar): IBOutlets for the 2 BorderedScrollView @IBOutlet weak var rowHeaderScrollView: NSScrollView! @IBOutlet weak var dataScrollView: NSScrollView! In     override func windowDidLoad() { dataScrollView.contentView.postsBoundsChangedNotifications = true NotificationCenter.default.addObserver(self, selector: #selector(boundsDidChangeNotification), name: NSView.boundsDidChangeNotification, object: dataScrollView.contentView) rowHeaderScrollView.contentView.postsBoundsChangedNotifications = true NotificationCenter.default.addObserver(self, selector: #selector(boundsDidChangeNotification), name: NSView.boundsDidChangeNotification, object: rowHeaderScrollView.contentView) To calculate bounds: func calculeBounds() { let totalHeight = dataTableView.frame.height let headerHeight = dataTableView.headerView!.frame.height contentUpperBound = -headerHeight let totalScrollHeight = dataScrollView.frame.height contentLowerBound = totalHeight - totalScrollHeight } And responding to notifications: @objc func boundsDidChangeNotification(_ notification: Notification) { if notification.object as? NSClipView == dataScrollView.contentView { let origin = (notification.object as! NSClipView).bounds.origin.y rowHeaderScrollView.contentView.bounds.origin.y = origin } else if notification.object as? NSClipView == rowHeaderScrollView.contentView { let origin = rowHeaderScrollView.contentView.bounds.origin.y if rowHeaderScrollView.contentView.bounds.origin.y > contentLowerBound || rowHeaderScrollView.contentView.bounds.origin.y < contentUpperBound { return } dataScrollView.contentView.bounds.origin.y = origin } } Hope that will help.
Topic: UI Frameworks SubTopic: AppKit Tags:
Oct ’21
Reply to Calculations using picker options in swiftUI
When you post a question, you should explain what you expect, what you get, where in code the exact miscalculation occurs. provide complete code (calculate() is nowhere used) In anycase, calculate is flawed (and prevents from compiling): heightCms is declared as Double and you set as String In addition, please use Paste and Match Style to avoid all the extra blank lines that make code nearly impossible to grasp. That was already a comment on your previous post. BTW: you never provided feedback on this previous post. Was it solved ? struct ContentView: View { @State var height = "" @State var heightCms: Double = 0.0 var heightOptions = ["cms", "inches"] @State private var heightselection = "cms" var body: some View { VStack { HStack { Text("Height:") .font(.title) .foregroundColor(.black) Spacer() TextField("Height", text: $height) .frame(width: 150, height: 50) Picker("Select Height Units: ", selection: $heightselection, content: { ForEach(heightOptions, id: \.self) { Text($0) } }) Spacer() } Text("You selected: \(heightselection)") Text("Height in Cms: \(heightCms)") }.padding() } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } extension ContentView { func calculate() { heightCms = heightselection == "cms" ? String(Double(height)) : (String(Double(height)) * 2.54) } } This should work better (You need also to calculate when text is entered): struct ContentView: View { @State var height = "" @State var heightCms: Double = 0.0 var heightOptions = ["cms", "inches"] @State private var heightselection = "cms" func calculate() { // You can also put it in an extension as you did in your code heightCms = heightselection == "cms" ? (Double(height) ?? 0.0) : 2.54 * (Double(height) ?? 0.0) } var body: some View { VStack { HStack { Text("Height:") .font(.title) .foregroundColor(.black) Spacer() TextField("Height", text: $height) .frame(width: 150, height: 50) .onChange(of: height) { _ in calculate() } Picker("Select Height Units: ", selection: $heightselection, content: { ForEach(heightOptions, id: \.self) { Text($0) } }) .onChange(of: heightselection) { _ in calculate() } Spacer() } Text("You selected: \(heightselection)") Text("Height in Cms: \(heightCms)") }.padding() } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to Apple's spam policy
Do your apps have the same icon ? Read those older posts: https://developer.apple.com/forums/thread/46910 https://developer.apple.com/forums/thread/114079 Did you consider inApp purchase, as recommended in guidelines ? 4.3 Spam Don’t create multiple Bundle IDs of the same app. If your app has different versions for specific locations, sports teams, universities, etc., consider submitting a single app and provide the variations using in-app purchase. Also avoid piling on to a category that is already saturated; the App Store has enough fart, burp, flashlight, fortune telling, dating, drinking games, and Kama Sutra apps, etc. already. We will reject these apps unless they provide a unique, high-quality experience. Spamming the store may lead to your removal from the Apple Developer Program.
Replies
Boosts
Views
Activity
Oct ’21
Reply to CoreFoundation/ UIKit thousands crashes in iOS 15
Could you show the error message you get ? In an older thread eskimo explained the error is due to wrong use of observer : https://developer.apple.com/forums/thread/100012 or https://stackoverflow.com/questions/17969493/cfrunloop-is-calling-out-to-an-observer-callback-function-18-23-corefoundati Could be that iOS 15 is less tolerant to such error than previous iOS.
Replies
Boosts
Views
Activity
Oct ’21
Reply to Softwareupdate not working
Did you try to update directly from System Preferences ?
Replies
Boosts
Views
Activity
Oct ’21
Reply to CallKit is too limited
We need this because this feature is crucial for the application that we are developing right now. Maybe, but you have to follow iOS rules… There are some possibilities, described by whatsapp h t t p s : / / faq.whatsapp.com/iphone/how-to-link-to-whatsapp-from-a-different-app?lang=en but with restrictions (user has to launch the call anyway): https://stackoverflow.com/questions/41999491/how-can-i-place-a-whatsapp-call-from-an-ios-app
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Xcode13 autocompletion not suggest the most frequently used word
There is a systematic order: macro first then Class or Struct … See details in this post: https://developer.apple.com/forums/thread/131642 You could always file an improvement request to ask for a way to configure it and hope it gets provided.
Replies
Boosts
Views
Activity
Oct ’21
Reply to IOKit: Retrieving USB Name, Vendor ID and Product ID after Serial Connection.
Hoping that may help, here is what I do for MacOS, to retrieve some infos (serial number, capacity and vendor): Dictionary entry is "DADeviceVendor" ; device name "DAVolumeName" ; whet do you expect in ProductID ? func getSerialAndSize(_ url: URL) -> (String, Int, String) { if let session = DASessionCreate(nil) { if let disk : DADisk = DADiskCreateFromVolumePath(nil, session, url as CFURL) { // We found a mount point... let ioService : io_service_t = DADiskCopyIOMedia(disk) let key = "USB Serial Number" let options : IOOptionBits = IOOptionBits(kIORegistryIterateParents) | IOOptionBits(kIORegistryIterateRecursively) if let sSerial : CFTypeRef = IORegistryEntrySearchCFProperty(ioService, kIOServicePlane, key as CFString, nil, options) { let dico: CFDictionary = DADiskCopyDescription(disk)! let vendor = (dico as NSDictionary)["DADeviceVendor"] as? String ?? "--" let driveCapacity = (dico as NSDictionary)["DAMediaSize"] as? Int ?? 0 return (String(describing: sSerial), driveCapacity, vendor) } else { return ("", 0, "") } } } return ("", 0) }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Shortcuts with command keys etc.
Pretty hard to understand your question from the image. What is highlighted ? When you type what ? Why a XcodeKit tag ? Is this when you run Xcode ? Did you look at System Preferences > Keyboard > shortcuts to see which to remove ?
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Can I get the current active user information (for macOS)?
Could this answer your question or at least give a hint? https://stackoverflow.com/questions/64033482/mac-os-how-to-programmatically-detect-the-mac-user-logged-in-user-is-admin-u
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Modifying the Y-position of navigation bar isn't possible in iOS 15.1 Beta / iOS 15 simulators
@karlingen I see an option: design a custom view that will mimic the navigation bar when you start scrolling, hide the navigation bar show this custom view (with all the same buttons that were in navbar): buttons still to be active once scroll started move the custom view according to scroll position when scroll return to original position, unhide navigation bar and hide custom view…
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Physical Payment via an app
So you would play the role of a deposit bank ? IMO it is not authorised unless you have all the bank credentials.
Replies
Boosts
Views
Activity
Oct ’21
Reply to Two NSTextView inside the same NSScrollView
I probably miss what you are trying to do. I could insert 2 TextViews in a ScrollView: And here is the object in Library I can type text inside and scroll both of them at will:
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Two NSTextView inside the same NSScrollView
So, what you want is to sync the scrolls ? You would have to do it in code, by adjusting the other view contentView bounds (or visibleRect) when you scrolled. You may have to create your own notification as in this example (that's Xamarin, so may be not totally relevant): h t t p s : / / social.msdn.microsoft.com/Forums/en-US/23035d90-987e-4201-b8be-11f424271699/how-to-detect-when-nstextview-scrolls-vertically?forum=xamarinios This is a complete case, a bit tricky https://stackoverflow.com/questions/6596567/synchronize-two-nsscrollview
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Two NSTextView inside the same NSScrollView
If that may help, this is what I did to sync the vertical scroll of 2 tableViews (would be very similar): IBOutlets for the 2 BorderedScrollView @IBOutlet weak var rowHeaderScrollView: NSScrollView! @IBOutlet weak var dataScrollView: NSScrollView! In     override func windowDidLoad() { dataScrollView.contentView.postsBoundsChangedNotifications = true NotificationCenter.default.addObserver(self, selector: #selector(boundsDidChangeNotification), name: NSView.boundsDidChangeNotification, object: dataScrollView.contentView) rowHeaderScrollView.contentView.postsBoundsChangedNotifications = true NotificationCenter.default.addObserver(self, selector: #selector(boundsDidChangeNotification), name: NSView.boundsDidChangeNotification, object: rowHeaderScrollView.contentView) To calculate bounds: func calculeBounds() { let totalHeight = dataTableView.frame.height let headerHeight = dataTableView.headerView!.frame.height contentUpperBound = -headerHeight let totalScrollHeight = dataScrollView.frame.height contentLowerBound = totalHeight - totalScrollHeight } And responding to notifications: @objc func boundsDidChangeNotification(_ notification: Notification) { if notification.object as? NSClipView == dataScrollView.contentView { let origin = (notification.object as! NSClipView).bounds.origin.y rowHeaderScrollView.contentView.bounds.origin.y = origin } else if notification.object as? NSClipView == rowHeaderScrollView.contentView { let origin = rowHeaderScrollView.contentView.bounds.origin.y if rowHeaderScrollView.contentView.bounds.origin.y > contentLowerBound || rowHeaderScrollView.contentView.bounds.origin.y < contentUpperBound { return } dataScrollView.contentView.bounds.origin.y = origin } } Hope that will help.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to XCode 13 issue - Thread 1: EXC_BAD_ACCESS (code=1, address=0x10)
What type is titleLbl ? Is it UILabel! ? Do you get the problem on simulator as well ? I tested the following in Xcode 13, iOS15 simulator:      @IBOutlet weak var label        : UILabel!  in viewDidLoad:     label.attributedText = nil No crash.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Calculations using picker options in swiftUI
When you post a question, you should explain what you expect, what you get, where in code the exact miscalculation occurs. provide complete code (calculate() is nowhere used) In anycase, calculate is flawed (and prevents from compiling): heightCms is declared as Double and you set as String In addition, please use Paste and Match Style to avoid all the extra blank lines that make code nearly impossible to grasp. That was already a comment on your previous post. BTW: you never provided feedback on this previous post. Was it solved ? struct ContentView: View { @State var height = "" @State var heightCms: Double = 0.0 var heightOptions = ["cms", "inches"] @State private var heightselection = "cms" var body: some View { VStack { HStack { Text("Height:") .font(.title) .foregroundColor(.black) Spacer() TextField("Height", text: $height) .frame(width: 150, height: 50) Picker("Select Height Units: ", selection: $heightselection, content: { ForEach(heightOptions, id: \.self) { Text($0) } }) Spacer() } Text("You selected: \(heightselection)") Text("Height in Cms: \(heightCms)") }.padding() } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } extension ContentView { func calculate() { heightCms = heightselection == "cms" ? String(Double(height)) : (String(Double(height)) * 2.54) } } This should work better (You need also to calculate when text is entered): struct ContentView: View { @State var height = "" @State var heightCms: Double = 0.0 var heightOptions = ["cms", "inches"] @State private var heightselection = "cms" func calculate() { // You can also put it in an extension as you did in your code heightCms = heightselection == "cms" ? (Double(height) ?? 0.0) : 2.54 * (Double(height) ?? 0.0) } var body: some View { VStack { HStack { Text("Height:") .font(.title) .foregroundColor(.black) Spacer() TextField("Height", text: $height) .frame(width: 150, height: 50) .onChange(of: height) { _ in calculate() } Picker("Select Height Units: ", selection: $heightselection, content: { ForEach(heightOptions, id: \.self) { Text($0) } }) .onChange(of: heightselection) { _ in calculate() } Spacer() } Text("You selected: \(heightselection)") Text("Height in Cms: \(heightCms)") }.padding() } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21