Category Archives: Apple

XCode Context Sensitive Help is Broke Worse (is that good English?)

Share this:  

I’ve been living with this problem a little awhile now. This problem was introduced with the last upgrade of Xcode:    Version 10.0 (10A255).

Help comes up for sure. Always has for me. I move my mouse over something like a class name that is part of Apple’s eco-system, like (for example): SKAction… I hold down the Option key of my keyboard… the mouse icon turns into a nifty bold question mark… I left mouse-click… a popup comes up… I click the Open in Developer Documentation link at the bottom of the popup… and Behold!   A window pops up about SKAction!

But there is this tree control on the left side of the window… you know the one that I mean… and SKAction is not highlighted in it! This is annoying because by expanding the SKAction node in this tree control (for example), I can see all the methods that belong to this class. And, if I click on one of those method names, then I see the help for it. And that obviously is really handy!

This used to work. Except, when you had help up from a previous search, then whatever you had selected from a previous search would be highlighted (even though the content on the right hand side of the window would be correct).  Annoying, but no problem: I would just close the documentation window and re-do the [Option]-click, and the item I had picked would be properly highlighted in the tree! And I could explore all the related items to my heart’s content.

The past problem was slightly annoying. This problem is Really annoying!

Another annoying problem:  If you pick an option in Objective C, it brings up the help for Swift.  If the context is Swift, it should display the help for Swift, if the context is Objective C, the help for Objective C!  I know, all I need to do is click the [Objective C] link on the page… but this is supposed to be contextual help!

Hopefully devs have been complaining and this will be fixed the next release. It just slows me down. So I am blowing off a little bit of steam by writing this post. 🙂

Current Progress on ‘The Game’

Share this:  

A lot has happened since my last post here:

  • I’ve written a crude SQLite wrapper in Objective C (separate project). And have begun work on a little program that will read words out of a text file and add them to a table in an SQLite database. The column containing the word will be indexed so hopefully there will be a quick lookup!
  • I’ve managed to download a text file that is basically a list of English words (not a dictionary since there are no definitions).
  • I’ve started going through this file removing words that are not applicable (based on the game’s rules). This is going to take awhile. There are a lot of words in this list!
  • I am planning on having another column in the table where the word will appear with all its letters in alphabetical order. This column will be indexed too. This is all part of a crazy idea I have as part of an algorithm for the computer to quickly pick words to form based on the letters it currently has… This is for when the user is playing the computer or the computer is playing itself … Attract Mode.
  • I’m still not done with this little program to build my SQLite database table.
  • Back to work I’ve done on the main Objective C game code…
  • The main game menu is up and running (though at this point only the Create Game button is working).
  • Ive got a general purpose game menu button selection method which purpose is to play a button select animation, which, when done running, will then call the proper method to run based on whichever button was selected. “Part” of the SpriteKit animation is playing a button “click” sound. The sound file being played right now is just a placeholder sound until I can create/get the final sound file.
  • I’ve now gotten an Apple TV version of the project working! Yay! The projects are different, but both iOS and Apple TV projects are pointing to the same source code.
  • I’ve figured out how to run my app in Xcode on my actual Apple TV box that is in the same room! The room where my home office is, is also my wife and I’s den.
  • There is specific code that is called only when running on  Apple TV, iPad, or iPhone.
  • But there is a lot of common code that is run by every platform.
  • Speaking of Apple TV specific code, I was able to get game controller code working for it (at least for the Siri Remote). So, for now, I can use the Siri Remote to navigate through the game menu and select an option.
  • I’ve added to the existing data structures for tile spots and buttons information for how to handle which element should be navigated to based on how the user uses their game pad on their Siri Remote. I’ve only been able to test it with the menu buttons so far and it seems to work pretty good.
  • There is a SpriteKit animation associated with changing the highlighted menu button. Part of it plays a sound file (think of the sound playing as you move for movie poster to movie poster in Apple’s Movie app). The sound right now is just a placeholder sound as well.
  • I would like the animation above to include the tilting of the highlighted item like the Apple Movie and TV apps and the Netflix app does. I plan on using the SKAction they have now to do a “warp” of the sprite. We’ll see how that goes.
  • I’ve added code to create, display, and run a game timer. The player will get 3 minutes for their turn.
  • This game is a multi-player game. And hence it needs functionality coded in to provide that functionality. At this point, I am planning on using Apple’s GameKit to implement these features. Specifically, the features that were mentioned in the talk “What’s New in Game Center” that Megan Gardner gave at the WWDC 2016. Specifically the features around the usage of the new GKGameSession class. You can watch the video of this presentation here. I watched this video a couple months back during the process of doing some initial investigation on what I would need to do to get this game to be a multi-player game. And I found it’s content exciting. What she talked about seemed to be able to do everything that I wanted without me having to compromise anything that I wanted in the game functionality!

Current Problems and Road-Blocks:

  • Sound on Apple TV version of app going away.
    • Initially, this worked fine. But then it suddenly stopped working.
    • When I’d leave the app and go into another app, their sound effects still worked just fine.
    • I had not turned the volume down on my Apple TV.
    • I checked the code just to make sure that I had not somehow removed the code that played the sound effect. I had not.
    • When running the iPad version of the game, it still plays the sound effect (shared code).
    • This problem is not at the top of my list, but it is annoying and it will need to be figured out eventually.
  • The Big Problem: Finding GameKit documentation including code examples (especially using the GKGameSession class).
    • This problem is causing a lot of anxiety and frustration for me. I can imagine that its doing/done the same for other iOS/macOS/tvOS developers out there too. I (like them) would rather be solving problems in my game itself, not having to be an API forensic anthropologist untangling a confusing web of sparse clues! And I’m really reluctant to use one of my Apple Developer support tickets for something like this which (in my opinion) is really Apple’s fault.
    • Maybe I’m blind in one eye and can’t see out of the other, but Apple does not provide any on-line code examples for GameKit/Game Center. None. If its out there, its hidden really good!
    • The API’s syntax documentation is very sparse.
    • If you look up a class such as GKGameSession, in addition to the sparse documentation, and no examples, it says it Deprecated! Really??
    • Okay, they do mention on the page that it was deprecated for iOS 10.0, macOS 10.12, and tvOS 10.0. iOS 10.0 came out on September 13, 2016 (just found that out now). If this is true, this means that all these cool, new, and sexy features did not even last 6 months. I don’t know, that is hard for me to believe.
    • When I saw this I thought “well, there has to be a presentation in 2017 or 2018 (this year) where they mention the new changes and which classes have been deprecated.” There were none. In fact there were no new presentations on Game Center/Kit since 2016.
    • Okay, it seems that Apple gave GKGameSession the boot. If it did, it was real quiet-like. The 2016 presentation that that Megan Gardner gave mentioned at least one class that was being deprecated and how they were taking away the Game Center app. So, it would make sense that if as of September 13, 2016, that the GKGameSession class was deprecated, that at least there would be a presentation during WWDC 2017 covering any changes… and why those changes were made… Or perhaps at least a web page explaining all this?
    • I’ve seen in various spots on the web people asking questions about GKGameSession. Rarely getting any answers. And certainly none from Apple (even on their developer forum).
    • I can’t find any how-to tutorial info on the web on the subject. Lots of info on stuff like SpriteKit though.
    • No books covering the subject (at least not recently covered).
    • No courses in Lynda.com or Udemy.
    • I did find some stuff of interest out on Github that I am looking into. But it is definitely not something a dev could easily figure out how to piece it all together. What interests me is where did they get some of the pieces of code to help them fit it together? Somewhere that I don’t know about at least!
    • To be honest, I did find some code examples and a tutorial on using GameKit on raywenderlich.com. But this tutorial was created in 2014. I want to use the newer features of 2016.
    • Well, I have several lines of inquiry for this problem. Mainly involving an attempt to contact certain people in hopes that they can connect me with folks who DO know the answers to these questions. Wish me luck!

Well, I went on a lot longer than I expected in this post! If you know where I can find the information I’m looking for, any help would be greatly appreciated.

iOS Game App Dev Log Entry # 2

Share this:  

For this game, I am using the layout of Scrabble on the iPhone and the iPad as a frame of reference. I am not copying it exactly. BTW, this is not a Scrabble knock-off! It is a word game though, and I’m sure it will be something you would find under the “Word” category in “Games” on the app store!

Hopefully, this app will be so good, that you find it featured by Apple!

For reference, today, I needed a screen shot from Scrabble on my iPhone where the game board is “zoomed in.” So I…

Read more

iOs game app – Dev Log Entry # 1

Share this:  

Today I am wanting to get iOS app for friend that I am working on (see previous post), displaying sprites for game board properly (with the right widths and heights, and at the right positions).

If I can get just THAT done today, that will make me feel like I am getting somewhere.

If I can get gradients too that would be nice. But Orville… dude… the other stuff is more important!!

#journal #ios #app #objc Read more

Back to Work on an iOS Game!

Share this:  

I promised a friend quite some time ago that I would work on converting his physical board game into an iOS game.

I’ve worked on it in fits and starts. I even has somewhat of a UI set up that I’d shown him (like maybe 2 years ago)… I know… not so good.

But now I can work on it full time!  I am bound and determined to finish this sucker and get it into the app store!

Although I’ve played around with Swift somewhat, the original code was done in Objective C and I’m going to stick with that. The original code was using SpriteKit… and will continue to do so.

I’ve been spending the past few days studying the existing code, adding comments to it, and jotting down notes on how I want to handle coding the game.

I realize now that for the kind of game it is, that needs just basic geometric shapes, that I really have no need for bitmapped images (at least for the most part), and, by using some simple math, I can have my game’s graphics scale nicely without needed all sorts of images with different resolutions included in my project.

SO, onward I go! My goal is to have it out in the Apple App store for sale for my friend by the end of this July.

“I Lost My Underwear” App Version 2 Has Been Released to Apple App Store

Share this:  

So far, the only app I have ever finished and placed in the App Store is not my own app. It is an app I have written for a friend. He wrote a book of humorous poems with illustrations called “I Lost My Underwear Today and other flights of imagination.” You can find this book for sale on Amazon. He asked me to create an interactive version of the book as an app for the iPad. This is when the iPad was brand new!

Now I have finished version 2. Not only does it run on the iPad, but the iPhone and iPod Touch as well. It now has little splashes of color, some sound effects, and the page turning looks like you are turning pages in a book as opposed to flipping pages of a legal pad (which is what it looked like in version 1).

So, it is out in the app store and I know that some people that I know have bought it and left reviews. So far, in the App Store, no sales show up nor any ratings or reviews are showing up. I wonder how long it takes before those things start to be visible.

Give it a try, its only 99 cents! 🙂

If you can leave some feedback below that would be very cool too.

Here is a link:

https://itunes.apple.com/us/app/i-lost-my-underwear-today/id366405118?ls=1&mt=8

Programmatically Determining if in Full Screen Mode in Mobile Safari

Share this:  

Building a site that you want to be a web app on an iPhone, iPad, or iPod Touch?

Full Screen Detection:

Consider this meta tag:

<meta name="apple-mobile-web-app-capable" content="yes" />

If you add this to your Mobile Safari web page your page will open in full screen mode…  IF you added your page as a shortcut to your Home screen and IF you launched it from that shortcut! Otherwise if you open the page from the standard mobile Safari icon it will not be in full screen!

You might have seen how some sites have a popup balloon that points to the    button with a message on how to add to the Home screen. The popup only shows up when your not in full screen mode. How do they do this?

Mobile Safari has the following property:

window.navigator.standalone

If this property is true, we are in full screen. False, we are not in full screen!

Consider adding to your JavaScript function called by the page’s onload event something like the following:

if ("standalone" in window.navigator && !window.navigator.standalone) {   
   // code here to create a div displaying our help balloon and positioning it
   // properly on the screen.
} // end if 

Recommended Post:

Do you want to look into this subject in more detail? Ben Nadel has written an excellent post on his blog: Detecting iPhone’s App Mode (Full Screen Mode) For Web Applications.

A JavaScript Library:

Looking for  a JavaScript library that you can add to your project to do the work for you? Matteo Spinelli on his site cubiq.org has created one for you. Go to his Add to Home Screen page to find out all the details. He’s even got a QR barcode that you can use with your iPhone to test it out!

If you go to the test page on your iPhone in Mobile Safari it will do this little balloon animation on the screen where it slides from the top down so    that it ends up pointing at the  button (see screen shot below):

The JS Library is downloadable for free but Matteo will take donations via PayPal or Flattr.

Code. I have to say I downloaded the library and looked at the code. Matteo put a lot of effort into this thing. it supports multiple languages and does all sorts of fancy stuff! Enough said.

How to Fix Base SDK Missing Problem in XCode

Share this:  


In this article I cover how you can fix the Base SDK Missing problem you might have had using the iOS SDK 5.2. The video above is easiest to see in full screen mode.

Background:
I downloaded Apple’s iOS SDK 5.2 and installed it on my Mac. After that process was over , I decided to load an existing project of mine into XCode. Ok, good. Then I tried to do a build. Kaboom! It did not work! No worries I thought, I will just go to the drop-down and pick the latest SDK 5.2. But the option was not there! The thought came to me that I might have to create a new project and import all my files from my existing project just to get it to work. Not a very nice thought to say the least! Read more

1 2 3