Post

Replies

Boosts

Views

Activity

Reply to A serious bug in PencilKit that make all apps with PencilKit useless in iOS16
I am the developer of Pencil it in, also an indie and pretty worried about this. I haven't downloaded Xcode 14 yet so I can't test, but I have a feeling the issue is in the backing CAMetalLayer, since it only happens when writing, possibly related to drawableSize. If you have Xcode 14, it might be worth building and logging the drawableSize or other CAMetalLayer properties (bounds, frame, ...) between iOS 15/16. Getting a reference to the metal layer can be a bit tricky; it's within a private view. The hierarchy is PKCanvasView -> PKTiledView -> PKMetalView. You can access it with something like: for v in canvasView.getAllSubviews() { for l in v.layer.sublayers ?? [] {     if let metalLayer = l as? CAMetalLayer {         print("Layer is ", metalLayer)          }      } } Where the helper function getAllSubviews() can be found on Stack Overflow I will keep this forum updated on any progress made and would appreciate anyone else experiencing this do the same.
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’22
Reply to Calendar List is empty after authorization
I don't know if it's a bug or not but store.reset() does not seem to actually reset the store like the comments suggests, It essentially is as if you released the store and then created a new one. It brings it back to its initial state. If we actually do create a new store, the issue seems to be resolved. So the access handler should look something like this: store.requestAccess(to: .event) { (granted, error) in if granted { self.store = EKEventStore() ... } I found the answer on this post. Stack Overflow - https://stackoverflow.com/questions/58873603/ekeventstore-calendars-is-always-empty-after-clean-install.
Topic: App & System Services SubTopic: General Tags:
Jan ’21
Reply to Define Array of protocol which conforms to Identifiable
If the id type is the same, you can use "Type Erasure", but as the name implies, you will be dealing with a reduced type, which is probably not what you want. class AnyIdentifiable<T>: Identifiable {     var id: T { _id }     private let _id: T     init<U: Identifiable>(_ identifiable: U) where U.ID == T {         _id = identifiable.id     } } struct TypeA: Identifiable {     var id = UUID() } struct TypeB: Identifiable {     var id = UUID() &#9;&#9;var name = "b" } let a = TypeA() let b = TypeB() let anyA  = AnyIdentifiable(a) /** - Note: `anyB` does not have a `name` property as it is of type AnyIdentifiable*/ let anyB = AnyIdentifiable(b) let anyIDs: [AnyIdentifiable<UUID>] = [anyA, anyB] You can apply similar logic above creating an AnyPlayable which will also need to forward your play() but again, you will be dealing with a reduced type. So only the properties in AnyPlayable will be available, ie. id and play().
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’20