Posts

Post marked as solved
12 Replies
4.6k Views
Hi all, I'm working on my first game, and the first step of getting the authenticator view is not working. To simplify the problem, I made a brand new app which only has the following code in the main view controller: import GameKit class ViewController: UIViewController {     override func viewDidLoad() {         super.viewDidLoad()         GKLocalPlayer.local.authenticateHandler = { viewController, error in             NSLog("GameKit authenticating")             if let vc = viewController {                 NSLog("IT WORKED! \(vc.description)")             } else {                 NSLog(error!.localizedDescription)             }         }     } } I've looked through older, similar issues, and so I made sure that I'd done the following: Game center is enabled in the app's Capabilities in Xcode. I've created an app associated with the bundle ID in App Store Connect. In the app's Services tab, I've created two leader boards, one "classic single". Also in Services, I've created one achievement. In the app's "prepare for submission" panel, I've turned on gamecenter, linked the leaderboards, and linked the achievement. For this test app, I have not yet uploaded a build, but I did do so on the actual game app, and and that didn't fix it. And with all that done, in my logs, it looks like this: 2022-01-16 16:28:01.582366-0800 test1ofgamecenter[6863:1006170] [Account Error] startAuthenticationForExistingPrimaryPlayer:Failed to Authenticate player.Error: Error Domain=GKErrorDomain Code=15 "The requested operation could not be completed because this application is not recognized by Game Center." UserInfo={NSLocalizedDescription=The requested operation could not be completed because this application is not recognized by Game Center.} 2022-01-16 16:28:01.976807-0800 test1ofgamecenter[6863:1006170] GameKit authenticating 2022-01-16 16:28:01.976988-0800 test1ofgamecenter[6863:1006170] The requested operation could not be completed because this application is not recognized by Game Center.``` I notice that my achievements and leaderboard are not "live" and I presume that is because I have not submitted the app for review, but I want to get it working before I submit a build that I would expect and want to be rejected. Is there anything else I need to do? Does this configuration require human intervention by Apple staff members? I started this phase of the development Friday evening, so I guess it'd make sense if waiting until Monday would fix it, but that seems weird. Any help? Vital Stats: - M1 Macbook Air - Xcode 13.2.1 (13C100) - Macos Monterey 12.1 - Testing on an iPhone XR and a 2021 iPad Mini, both with the most recent updates of their respective OS's
Posted Last updated
.
Post not yet marked as solved
0 Replies
978 Views
Hi all, I've got an idea for an interesting twist on a 3d aerial battle game, and so I'm taking the plunge on making my first 3d game. I've got the developer docs queued up and the WWDC videos ready to go, and I've bookmarked a Ray Wenderlich tutorial on SceneKit. Before I get started, since this is all so new to me, do any of y'all have any recommendations for good, up-to-date tutorials or hints and tips that might shortcut any of the process? If it helps, my proof of concept will just allow me to have the player chase a computer-controlled airplane around in 3d space, and view that opponent from the cockpit view. I've already done all my homework on the math of movement in 3d space. Had to dust off some trig, and I haven't worked with radians in a long, long time. But the next step is to get some basic visualizations in, and it looks a little daunting. I truly appreciate any guidance you can point towards!!
Posted Last updated
.
Post marked as solved
2 Replies
1.1k Views
Hi all, I'm working on an app which requires the most accurate AGPS available, so it requires a device with cellular capabilities even if the network is going over wifi, and even if the cellular modem is turned off. The IP-based location services in a non-cellular device (like a wifi-only iPad or an iPod touch just isn't accurate enough for what I'm doing. I know I can put that in the description in the app store, but I'm wondering if there's a way I can account for it in my code, too. Something like the user interface idiom or iOS version checks you can do, but instead specifically isCellularCapable or some such. I just want it to be clear whenever someone fires up the app with an iPod touch or a non-cellular iPad that they're going to have a less-than-ideal experience. I still remember when my kid's friend tried to do Pokemon Go with a non-cellular iPad tethered to my phone, and the device just couldn't figure out where it was supposed to be. I don't want people using my app to have the same experience.
Posted Last updated
.
Post marked as solved
9 Replies
1.7k Views
Hi all, I'm running the latest version of Xcode (12C33) on the latest version of macOS Big Sur 11.1 (20C69) on my new Apple Silicon MacBook Air (16GB, 1TB storage), and while it worked great about a week ago last time I was working on any of my apps, now it beach-balls every couple of minutes for several minutes at a time. There's no apparent error, and it happens with new projects and old projects, regular UIKit apps and SwiftUI apps, ones for just the iPhone and ones that are cross-platform. I've uninstalled everything I could think of that might cause problems, including Chrome and demos of music software (Ableton lite et al) that came with my audio interface, even though Xcode has worked fine since I installed any of those items. I've even uninstalled and re-installed Xcode, but it still happens constantly. I literally can not get anything done and I'm not sure where to look. The only things I have installed since the last time Xcode worked right which I haven't installed are a couple of Apple Arcade games, but I might do those as well. It happens when there are no other apps running, but when it's happening if I run Terminal the load is low, and if I use Activity monitor, there's literally nothing going crazy on any of the eight cores. Not a lot of reads/writes, nor a lot of data moving up and down the pipe. It just seizes up, and then eventually does whatever I asked it to, but a 2-10 minute pause every time I edit half a line of code, or longer if I build the app and deploy it to my phone or a simulator just doesn't work for me. Any ideas? The last time Xcode ran well for me, realize as I write this, was when I tried out a basic hello-world watch app. It displayed great in the swiftui console, but I couldn't get it to deploy to my watch, so eventually gave up. Is it possible this left some cruft in the system that I need to clean out? HELP!! (please)
Posted Last updated
.
Post not yet marked as solved
0 Replies
801 Views
Hi All,I'm working on a custom bookmarking/website diary app which will allow manual input of URLs, but for which I'd like to be able to allow users to do a share action from Safari in order to invoke the app.I've deployed my first share extension, and in my 'didSelectPost' function, I'm trying to examine the info that comes in, and I'm able to see everything but the comments typed into the share form.Here's the code I'm using: override func didSelectPost() { for item in self.extensionContext!.inputItems { if let item = item as? NSExtensionItem { if let x = item.attributedContentText { NSLog("x = \(x)") } let attachments = item.attachments! NSLog("Item: \(item)") let provider = attachments.first! NSLog("PROVIDER \(provider)") if provider.hasItemConformingToTypeIdentifier("public.url"){ provider.loadItem(forTypeIdentifier: "public.url", options: nil, completionHandler: { (attachment, error) in if let url = attachment as? URL{ let link = try! String(contentsOf: url, encoding: .utf8) NSLog("URL: \(url)") // GOT MY URL! NSLog("link: \(link)") // GOT THE CONTENTS OF THE URL } }) } } } self.extensionContext!.completeRequest(returningItems: [], completionHandler: nil) }My question is, where do I look to see what the user typed in the share sheet? Every tutorial I've found on this seems to go into great detail on how to share an image, but I seem to be missing the piece about grabbing the user-generated content.
Posted Last updated
.
Post not yet marked as solved
0 Replies
573 Views
I'm building an app using SwiftUI that is centered around a list of articles which are either a new standalone topic, or which have a hierarchical relationship with an ancestor which was originally one of those new standalone topics.The default view in the List{} structure shows just the titles of the articles, but when tapping on an entry which shows the threaded titles, they're all expanded, via the following logic:if showDetail { ForEach(self.articles, id: \.self) { article in VStack { if article.id != self.articles[0].id { Text(article.title) .font(.caption) .lineLimit(3) } Text(article.summary) .lineLimit(20) } } } else { ForEach(self.articles, id: \.self) { article in if article.id != self.articles[0].id { Text("• \(article.title)") } } }And it works great! Except for one thing: when expanded, the encompassing view gets enough padding at the top and the bottom for several lines of text.. If I drop the article summary's .lineLimit to 1, the padding goes away, but at 3 and above the extra padding is visible and continues to grow until at 20, I get effectivley something like 5-7 blank lines at the top and the bottom.Anyone else seen this? I'm considering filing a radar, but I want to make sure this isn't expected behavior first.
Posted Last updated
.
Post marked as solved
1 Replies
724 Views
Xcode 11b4 is telling me that SwiftUI's relativeWidth property for views is deprecated, but it shows up in a LOT of documentation as if it's still in use.I do this app thing as a part-time hobby, and I'm so excited for SwiftUI's potential, and I know that it's beta, but it seems like having the beta docs synched with the beta SDK would make the learning process a tiny bit less frustrating.
Posted Last updated
.
Post not yet marked as solved
1 Replies
767 Views
Hi AllJust checking in to see if this is affecting other people, or if it's a problem on my side.I'm running the latest Catalina beta (19A512f) and the latest Xcode beta (11M374r) and I'm trying to learn SwiftUI using the tutorials.The first several were AWESOME, but then I had to take a couple of weeks of due to scheduling challenges in my day job, and when I came back, there was a new beta (B3) and things didn't seem to work quite right; items that had compiled and run correctly previously stopped doing so. Using automatic fixes, I muddled through a bit, but decided to wait until the next beta. Now that I'm on B4, I thought I'd try again, and things still don't match up.I'm looking at the Working with UI Controls tutorial, and there are several things that need to be fixed right out of the gate, with a fresh clean download. I even went back to an earlier one (Animating Views and Transitions) and tried to run it, and it failed several ways.So I'm assuming that since this is a young framework, it's just going through changes, which is fine. But before putting this on my back burner or trying to figure out an alternate means of learning this content without too much wasted time, I figured I'd ask to make sure there's not something magical that I could be doing that'd help resolve this. I remember in the early days of the Swift language, there were often one-button ways to update code from one version of the language to another...
Posted Last updated
.