I keep noticing that some bugs that I reported or features that I suggested have been corrected or added to the latest OS. For one of these I replied asking why I wasn't notified and never got an answer. Isn't Apple interested in closing as many feedbacks as possible? Now I cannot even say that perhaps I formulated them in such a way that they don't understand, because they don't seem to reply altogether.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
For many months now, projects that I download from most of the feedbacks I submit don't build anymore: some settings in the Xcode project get changed for some reason at some stage so that the directory structure is wrong. The top level folder named after the project is highlighted in red and the only compiler error is about the missing entitlements file, even though all the files are in the project folder. I already reported this months ago but this is still happening. What's the problem and why is there no solution to this yet?
I have this code in my project
#if os(macOS)
import Cocoa
typealias Image = NSImage
#elseif os(iOS)
import UIKit
typealias Image = UIImage
#endif
Because of this, in a file with import SwiftUI I would have to use SwiftUI.Image to disambiguate. Is it possible to declare that whenever I use Image in that file, it should not use my internal declaration but the SwiftUI type instead?
Here is the code:
UIView.setAnimationsEnabled(false)
let _ = textView.becomeFirstResponder()
UIView.setAnimationsEnabled(true)
Is there a way I can make the text view first responder without triggering an animation, so that I can set a custom scroll offset at the same time?
Is it possible?
When tapping the Handoff icon of my app on the Mac or on the iPad, Xcode logs this error:
[default personal] [ERROR] +[NSURL(BRAdditions) br_documentURLFromBookmarkableString:error:]: (passed to caller) error: Error Domain=BRCloudDocsErrorDomain Code=8 "Not Entitled" UserInfo={NSDescription=Not Entitled}
When setting a breakpoint at NSApplicationDelegate.application(_:continue:restorationHandler:), I can see that userInfo.activityType is the one specified with the key NSUbiquitousDocumentUserActivityType under the Info.plist Document Types, but userActivity.userInfo is empty, so the document url is apparently not sent. Is there something else I have to set up?
On Mac we can with NSFontManager.shared.font(withFamily:traits:weight:size:), but I couldn't find any way on iOS, not even with UIFontDescriptor.
Often performing the swipe right gesture in order to show the previously opened file doesn't work immediately. When this happens, which it does countless times a day, I have to repeat it exactly 3 times before it works.
I submitted a bug report in May 2018, 3.5 years ago, and it is still marked as "Similar reports: None" and "Resolution: Open". I asked for updates a couple of times and never received a response. This makes me angry. My brain has been rewired so that when (if) this issue is finally solved I will probably continue swiping 3 times for another 2 years. At the same time, it makes me extremely sad. How can the engineers at Apple possibly leave me in the dark about if they could reproduce the issue, are working on it, or just find it unnecessary to fix it?
I'm using NSView.scroll(_:) but then the scrollers flash. Is there a way to scroll without making them flash, like when using UIView.contentOffset?
I'm using this code to create a rectangle (that will eventually be a more complex shape):
let vertices = [simd_float3(x: 1, y: 1, z: 0), simd_float3(x: 1, y: -1, z: 0), simd_float3(x: -1, y: -1, z: 0), simd_float3(x: -1, y: 1, z: 0)]
let vertexSource = SCNGeometrySource(data: Data(bytes: vertices, count: MemoryLayout<simd_float3>.size * vertices.count), semantic: .vertex, vectorCount: vertices.count, usesFloatComponents: true, componentsPerVector: 3, bytesPerComponent: MemoryLayout<Float>.size, dataOffset: 0, dataStride: MemoryLayout<simd_float3>.stride)
let indices: [Int32] = Array(0..<Int32(vertices.count))
let element = SCNGeometryElement(data: Data(bytes: indices, count: MemoryLayout<Int32>.size * indices.count), primitiveType: .polygon, primitiveCount: 1, bytesPerIndex: MemoryLayout<Int32>.size)
let geometry = SCNGeometry(sources: [vertexSource], elements: [element])
which logs this error in the Xcode console:
[SceneKit] Error: SCNGeometryElement initialization - Invalid polygon edge count (0)
There also doesn't seem to be any documentation about how to use this .polygon mode. When using .triangleStrip with a primitiveCount of 2, no error is logged.
I'm trying to create a class that can save different closures (or methods) with an argument of a specific subtype of Decodable that should be called later. This way I can predefine what actions, or methods, can be called on that class in response to some input. For example, the line addCallback(setOption(_:), SetOptionRequest.self) should result in the subsequent call to try! performCallback("setOption", JSONEncoder().encode(SetOptionRequest()) to call setOption(data) where the argument data has type SetOptionRequest.
Here is the code I have so far (I took the bit about DecodableWrapper from here). The problem is that at runtime the cast callback.callback as! (ActionRequest) throws -> Void fails, since the type of the closure is not (ActionRequest) throws -> Void but (SetOptionRequest) throws -> Void. But I have no idea if and how I can cast the closure back to its original type. I considered using Selectors but I would like to keep the compile-time check that I'm binding methods with their correct argument type.
struct DecodableWrapper: Decodable {
static var baseType: ActionRequest.Type!
var base: ActionRequest
init(from decoder: Decoder) throws {
self.base = try DecodableWrapper.baseType.init(from: decoder)
}
}
open class Server {
private var actionCallbacks = [String: (callback: Any, dataType: ActionRequest.Type)]()
open func setup() {
addCallback(setOption, action: SetOptionRequestResponse.self)
}
public func addCallback<T: ActionRequest>(_ callback: @escaping (_ data: T) throws -> Void, action: T.Type) {
actionCallbacks[T.action] = (callback, T.self)
}
private func performCallback(action: String, data: Data) throws {
let callback = actionCallbacks[action]!
DecodableWrapper.baseType = callback.dataType
let data = try! JSONDecoder().decode(DecodableWrapper.self, from: data).base
try (callback.callback as! (ActionRequest) throws -> Void)(data)
}
private func setOption(_ data: SetOptionRequest) {
}
}
protocol ActionRequest {
static var action: String
}
struct Request: SetOptionRequest {
}
It often happens that after a successful build I do some small changes that cause some compiler errors, but undoing those changes with Cmd-Z still leave the errors there. Building also doesn't remove them. Only cleaning the project and building again (which is very time consuming) or doing a small edit on the line that Xcode still thinks is wrong (such as adding a whitespace and immediately undoing it) finally gives a successful compilation again.
I filed a bug report in September 2018, more than 3 years ago, and never got a response. Can it really be that I'm the only one experiencing this and why does it take so long to fix such annoying bugs and why does nobody care to give some reassurance that somebody is working on this?
First: is there a way of gracefully animating the popover's size to the size of the view controller pushed onto the navigation controller, like Pages does for the three dots menu? When setting the navigation controller's preferredContentSize inside the pushed table view controller's viewWillAppear, first the push animation is run, and when it finishes, the popover is resized.
Second: how to get the correct size to set as preferredContentSize? That would probably be the table view's contentSize (which, unless calling reloadData(), is .zero in viewWillAppear) plus the navigation view's title bar height. How can one calculate this, without having to sum the different parts manually?
It seems that whenever my app goes to the background and is then activated again, the navigation item's titleView's superview is nil, even though the navigation item's titleView property is still set. Is this expected?
In order to support a custom paste behaviour, In my UITextView, which I set as its own UITextPasteDelegate in awakeFromNib(), I implemented textPasteConfigurationSupporting(_:,transform:).
When pressing the paste button above the software keyboard, in the callback of item.itemProvider.loadItem(forTypeIdentifier: UTType.rtf.identifier) I get an error
Error Domain=NSItemProviderErrorDomain Code=-1000 "Cannot load representation of type public.rtf" UserInfo={NSLocalizedDescription=Cannot load representation of type public.rtf, NSUnderlyingError=0x28374e8e0 {Error Domain=PBErrorDomain Code=13 "Operation not authorized." UserInfo={NSLocalizedDescription=Operation not authorized.}}}
even though the item.itemProvider.registeredTypeIdentifiers are
"iOS rich content paste pasteboard type", "Apple Web Archive pasteboard type", "com.apple.uikit.attributedstring", "com.apple.rtfd", "com.apple.flat-rtfd", "public.utf8-plain-text", "public.rtf", "public.html", "com.apple.WebKit.custom-pasteboard-data"
and item.itemProvider.canLoadObject(ofClass: NSAttributedString.self) returns true.
Even item.itemProvider.loadObject(ofClass: NSAttributedString.self) returns a similar error:
Error Domain=NSItemProviderErrorDomain Code=-1200 "Could not coerce an item to class NSAttributedString" UserInfo={NSLocalizedDescription=Could not coerce an item to class NSAttributedString, NSUnderlyingError=0x283497b70 {Error Domain=PBErrorDomain Code=13 "Operation not authorized." UserInfo={NSLocalizedDescription=Operation not authorized.}}}.