Post

Replies

Boosts

Views

Activity

Reply to Cannot register the product
HI that is exactly where the problem lies. and when I get the message. I go to Grant Xcode Cloud access to your source code -and when I click thru, I get the above error. The account is not a GitHub Enterprise account, and as indicated before, Xcode has no problem commiting and pushing code to the repo with the same git account I am using for all other aspects of SCM. I noticed a comment about removing personal access tokens, so I deleted all Personall Access Tokens. created a new one and re-logged in via Xcode.. clicked Grant Access in the "Get Started" prompt for setting up Xcodecloud and received the same error. Is there any other data that I can try other than making the repo Public?
4d
Reply to Cannot register the product
I've been getting this exact same problem, I'm enrolled, have used xcode cloud on other projects I setup fine with no problems. I have created a new project in Xcode, connected it to my GIT account, verified that it exists on GitHub, pushed updates to it via Xcode, and setup an App Store Connect entry for it. The project is define in Aoo Store Connect. When I try to add Xcode Cloud from Xcode, I get to the step to grant access, it launched App Store Connect, but says it can't find the repository - "Repository was not found. Either the repository does not exist or you do not have permission to access it. Learn More". I have the correct git account setup in Xcode, and it shows up fine when I get to teh gran access screen in Xcode for setting up a new xcode cloud workflow, but I still get the above error. As the owner of the GitRepo, what permission do I need to manually add in GitHub if I do NOT want to make my repo public?
4d
Reply to Main actor-isolated property can not be reference from a Sendable closure
Figured it out.. struct ImageCompressor { /// This is a static method that takes three parameters: /// image: The input UIImage that needs to be compressed. /// maxByte: The maximum allowable size for the compressed image in bytes. /// completion: A closure that will be called when the compression is complete, passing the resulting compressed UIImage or nil if an error occurs. static func compress(image: UIImage, maxByte: Int, completion: @Sendable @MainActor @escaping (UIImage?) -> Void) { MainActor.assumeIsolated { guard let currentImageSize = image.jpegData(compressionQuality: 1.0)?.count else { return completion(nil) } var iterationImage: UIImage? = image var iterationImageSize = currentImageSize var iterationCompression: CGFloat = 1.0 while iterationImageSize > maxByte && iterationCompression > 0.01 { let percentageDecrease: CGFloat switch iterationImageSize { case 0..<3000000: percentageDecrease = 0.05 case 3000000..<10000000: percentageDecrease = 0.1 default: percentageDecrease = 0.2 } let canvasSize = CGSize(width: image.size.width * iterationCompression, height: image.size.height * iterationCompression) UIGraphicsBeginImageContextWithOptions(canvasSize, false, image.scale) defer { UIGraphicsEndImageContext() } image.draw(in: CGRect(origin: .zero, size: canvasSize)) iterationImage = UIGraphicsGetImageFromCurrentImageContext() guard let newImageSize = iterationImage?.jpegData(compressionQuality: 1.0)?.count else { return completion(nil) } iterationImageSize = newImageSize iterationCompression -= percentageDecrease } completion(iterationImage) } } } Once I changed my ImageCompressor the save function looks like this - private func save() { ImageCompressor.compress(image: (frontImageSelected?.asUIImage())!, maxByte: 1_048_576) { image in guard image != nil else { print("Error compressing image") return } if let greetingCard { greetingCard.cardName = cardName greetingCard.cardFront = image?.pngData() greetingCard.cardManufacturer = cardManufacturer greetingCard.cardURL = cardURL greetingCard.eventType = eventType } else { let newGreetingCard = GreetingCard(cardName: cardName, cardFront: image?.pngData(), eventType: eventType, cardManufacturer: cardManufacturer, cardURL: cardURL) modelContext.insert(newGreetingCard) } } }
Jun ’24
Reply to Error exporting a PDF
I found this exact code in a Youtube video on how to render a PDF from a view. I have a grid view, that I am trying to use with this, and if the grid is less than a full screen, it seems to work OK, but if my GridView is more than a display's worth of information this hangs, and eventually just dumps out. I have peppered the code with print statements, and found that it is hanging at pdfView.layer.render(in: context.cgContext) ... are you see this same issue? and if so, did you solve?
Nov ’23