Post

Replies

Boosts

Views

Activity

Game Center achievements staying hidden
I’m tracking down a bug report with a game that has a bunch of achievements that do work. I am trying to reveal the name of a hidden achievement once a player learns it is possible, but before they have any progress towards it. GKAchievement* a = [[GKAchievement alloc] initWithIdentifier: anAchievement]; a.percentComplete = 0; [GKAchievement reportAchievements: @[ a ] withCompletionHandler: ^(NSError * _Nullable error) { if (error != nil) { NSLog(@"revealAchievement: %@ failed %@", anAchievement, error); } }]; The documentation says “isHidden is set to NO anytime this method is invoked” but the achievement is not showing up in the UI. The achievement in question is returned by +loadAchievementsWithCompletionHandler:, but it is considered hidden there (lldb) po a <GKAchievement: 0x6000027993e0>id: MonsterKiller.DarkAge 0.000000 (lldb) p a.hidden (BOOL) $3 = YES I am pretty sure this code worked fine (it’s in a game that came out several years ago). Has Game Center changed (I know hidden is technically deprecated now, but I don’t see anything explaining how to reveal an achievement other than by using +reportAchievements:withCompletionHandler:. And yes, the achievement in question is configured on the server (it can be earned, just not revealed with zero progress).
2
0
1.8k
Nov ’22
My Command Line Tool Killed on M1 Mac from Terminal
I’m using Xcode 12.2 to build a tool I normally run from a script. (Previously on macOS 10.14 and earlier.) When I build and run it from Xcode, it runs fine. If I try to run it from Terminal, I get the message Killed This is the first time I’ve used Big Sur, do I now need to worry about signing my own tool? I’ve attempted to have Xcode manage this, and Sign to Run Locally. But nothing seems to make a difference. How can I build a program to be run from command line, for Apple Silicon?
2
0
3.1k
Dec ’20
Preferred Audio Formats in iOS?
I am going to be using AVAudioPlayer to play sound effects and looping music in a game. I haven’t been able to find any recent discussion of what format to use (given I almost certainly need to compress it). https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html#//apple_ref/doc/uid/TP40009767-CH2-SW28 is deprecated (and talks about “AAC” but afconvert -hf shows at least 7 different formats that can be saved in a CAF). Has that guide been updated? Does hardware vs software playback still matter in iOS 9+? I’m not really worried about performance in terms of impacting frame rate.
0
0
949
May ’22
Can I submit 32-bit (Universal) apps to iOS App Store
I just saw a developer claim that the App Store will no longer accept 32-bit builds. Which presumably means we won’t be able to submit universal. I had wanted to continue to support our few remaining iPad 2 customers, but it sounds like that won’t be possible. I haven’t had any luck finding any official statement about this. I’ve been using Xcode 13.1 and it still lets me target iOS 9…
1
0
1.2k
Jan ’22
Suppress line numbers in Code Review?
I just updated to Xcode 13.0. Now every time I choose a file in a File Review window/tab, Xcode decides I want to see line numbers. I have line numbers turned off in Preferences. And since I am using a GUI, and have side-by-side comparisons on, there is no reason I need line numbers. They take up space and make a side-by-side comparison less useful. There doesn’t appear to be a preference, is there a CLI default I can set?
1
0
766
Sep ’21
Dealing with small iPad Mini (6th gen) screen
I just realized that my game has some problems on the iPad mini’s 2266×1488 screen. It’s actually a UIKit app, and I do a fair amount of adapting to different screen sizes. However, my designer made the (then-reasonable) assumption that iPad screens were at least 768 points high. The mini is only 744 points, and so UI screens that were designed to exactly hold their content, don’t have enough room. If this were a Unity game, everything would probably just be scaled down a little from a 1024×768 display. Is there a way to do that as a UIKit app? This wouldn’t be ideal, but it would let mini owners play the game.
4
0
2.4k
Sep ’21
iPhone XR screen shots from Simulator?
I’m preparing an update and can’t post it until I have 6.5 inch (iPhone XR) screen shots. I don’t own a device, so I am trying to take them from Simulator with File &gt; New Screen Shot. This generates 1792 * 828 pixel images, which are rejected for not being 2688 * 1242.How do I get the full resolution screen shot while running Simulator? (Choosing Pixel Accurate doesn’t seem to make a difference.)
2
0
4.0k
Aug ’19
Xcode 11 doesn’t paste tabs (thus breaking indentation)
I recently upgraded to Xcode 11 and ran into a very annoying problem: it is breaking my formatting when I copy &amp; paste lines of code (which happen to be in Lua or a DSL).I had been doing this for years, and what I copied was always pasted intact. I did some searching, and verified that “Re-indent on paste” was unchecked (as was “Indent when typing:” in the Indentation preferences).I am still on macOS Mojave, if that matters.Since I do this a lot, it is extremely frustrating. Is there a way to get the old (correct) behavior back?Note: I just filed FB7422240 since this seems to be a regression with no known workaround.
11
0
4.2k
Nov ’19
WKWebView text size not matching UIWebView (or UILabel)?
I am migrating my game from UIWebView to WKWebView.I use HTML to show the game manual and lore.In the UIWebView version, I specified a font size in my CSS, and (as near as I can tell), UIWebView rendered text at that size.WKWebView is deciding on its own how to render. I have added this line to each HTML file&lt;meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"&gt;but it doesn’t seem to give me consistent results. I actually seem to be getting a different type size depending on the amount of text (i.e. when it scrolls, it is larger!).I looked at https://webkit.org/blog/7367/new-interaction-behaviors-in-ios-10/ which seems to suggest that ignoresViewportScaleLimits is false by default and gives you the iOS 9 behavior (which is good because I need to support iOS 9). But I am not seeing any way to tell WKWebView to do no scaling and just show the font at the size I asked for. This is not arbitrary HTML that WK needs to guess at. It comes from a local file and is intended to match the rest of the UI.
3
0
7.1k
Jan ’20
Trackpad doesn't adjust to landscape-only?
Just gave my game (which is landscape-only, and implemented with UIKit) a trial. My iPad is (naturally) in portrait mode. When I launched my game, the trackpad did not take the rotation into account.Is this a bug, or is there an API I need to use?(If I turn off rotation lock, things seem OK. But users should not have to do that.)
1
0
706
Mar ’20