Rapture In Venice, LLC

:: Freelance iOS Development & Team Augmentation

When dismissing a modal causes your view to drop 20 pixels…

Today, I ran into a problem where I have a view displaying and I present a modal. Everything is fine, but when I dismiss the modal, the original view has now moved up about 20 pixels — very noticeably the height of a status bar.

I’ve run into this problem a few times during a few different projects. Each time, I did some quick investigation, but time pressure and opportunity induced me to just make a quick workaround fix instead. The problem has been that while I’ve seen a ton of developers report the problem, there are still no solutions!

Well, I was able to remedy it. I can’t tell you what the underlying problem is (iOS is closed source), but I eventually fixed it by pulling things and out and eventually comparing to a new iPad project. All of this happened after a couple of hours of tweaking code and my XIB with no success. In my mind, this was something deeper and out of my control, perhaps the tools.

My first hypothesis was that the XIB was being corrupted by Interface Builder. So, I created a new XIB to hook up to the view controller. I kept it empty except for a search bar at the top simply so I could gauge if it was displaying right. To my shock, even this XIB was moving down! What?!

So, I determined that it must be a problem with the UIWindow XIB. I created a new iPad project and compared it with all of the top-level pieces of my app. Everything was the same. The top level view wanted to be full screen, the size was the same, everything. What gives?

And here’s where I found my answer. It came from a hail mary, really. I noticed that whenever I’ve run into this issue, it’s always the top-level view that drops down the 20 pixels. Children always behave as expected. And so, the one difference between my app and the new app is that the new app creates the top level view controller from the UIWindow as it outlets it. I create it with code. I changed my strategy so that instead of creating the top-level view controller via code, I did it the same way and…

IT WORKS!!!!!!!!

This makes no sense to me. Something in Apple’s code, probably the timing where the view controller is created in relation to the window, at the same time versus later, seems to be misunderstanding the Y=0 position in relation to the status bar. I simply can’t identify what the bug probably is.

Yet, it does tell me what some people see it and some don’t. I generally create new projects as Window-based rather than View-based. With View-based projects, Apple creates the view controller in the XIB. I’m willing to bet the iOS developers who see this bug are creating theirs in code.

So, give it a try and lemme know. :-)

  • Print
  • Facebook
  • Twitter

, , ,

Do you have clients — or customers?

Read an interesting article last week (though I’ve lost track of it now) that asked the question if consultants have “clients” or “customers”. At first, the question seemed like on of terminology, but it really goes to the point of how you treat your business partners.

I’ve historically used the term client. My clients. Why? I don’t know why. It’s just industry slang I’ve picked up over time. I represent them. I work for them, but I’m not an employee to their business.

However, now, I’m in agreement that they are customers. For one thing, I am performing a service for them and am (hopefully) doing it in a way that makes them want to come back to me for future work. They are attracted to my business through referrals or finding my work online. That’s a customer to me, but also sounds like a client.

The difference? We aim to *satisfy* our customers. We merely *work* with clients.

From now on, my clients are now my customers.

  • Print
  • Facebook
  • Twitter

Trying to Invent the iPad — Back in 2001

One of my clients is headed to CES in a few short days with some Rapture In Venice software in tow (in progress right now!) and it’s reminded me of my last experience with CES. It happened back in 2001…

Back then, I worked for a company called Qubit Technology. I’d left InfoBeat the year before to take what I considered to be a “dream job.” A lot of us have had these before, but this was different. You see, I was the world’s biggest BeOS fanboy and it just so happened that the only company in the world that was going to be writing BeIA code outside of Be headquarters was located in Lakewood, CO. Just minutes from my apartment in Denver. I loved my job, but this was a once-in-a-lifetime opportunity and so I took it.

Qubit’s goal was to create the iPad. WHOA, WHAT?! Yes. We were trying to create an iPad in 2001. We didn’t have Apple’s hardware chops (or software chops as it were), but we were leveraging some Motorola hardware and Be’s new BeIA system software to make a wifi web experience for the home. We were competing with Sony at the time. They were known to be creating the eVilla, a not-so-mobile device that was nonetheless positioned at the forefront of the toaster revolution.

I had so much fun. I ported over the Jabber client I’d written for BeOS to the BeIA platform. To this day I believe I was, and am, the only 3rd-party BeIA developer in the world. BeIA wasn’t available to anyone publicly (as opposed to BeOS for the desktop), and Sony had no in-house BeIA developers as far as I knew — they were contracting the work through Be. But, here I was, writing Jabber for BeIA. We integrated it into the architecture and our software stack was coming along. (I’d also ported Galaga and The Brain to BeIA as well.)

Sadly, just weeks before CES, someone at Qubit sounded the panic button and we opted to use QnX for our wireless platform instead. (We had toaster devices competing directly with the eVilla which continued to use BeIA.) LITERALLY, with just two weeks to go, we switched to using a web framework that we’d been building for an ADT Security product. It left me with no time to do any engaging, native development.

So, I kid you not, we went to CES with our tablets using an empty framework and a set of IMAGE FILES to hint at what was “to come.” The device did nothing. It displayed JPGs, which our graphics designer made, of what a contact list might look like, or a calendar, or a todo list…that was it.

It’s no surprise that Qubit sent about three quarters of the company to CES that year. The developers all went because we were still writing the pretend software when we got there. We had our entire computer systems shipped, too. It was my first time in Las Vegas, but I spent the first day holed up in my hotel room with room service as my lifeline. Not a happy camper I was.

The next night, the night before CES was set to start, the dev team got to go to the tent where we had our booth. Our booth was huuuuuuuuuuge! (This was the boom after all.) I remember we were located between Palm and Transmeta. I remember wondering if Linus Torvalds (of Linux fame) would be there in person with his new company. All the while, I was still working on the software we were set to demo the next day. You know, the glorified image viewer. :-) We were so, so tired.

Sadly (but expectedly), the story at CES that year didn’t end up being about us. However, here’s a bit of trivia. We took 2nd place for Most Innovative New Product that year. Yes, the judges (we seemingly paid off) loved our image viewer! And had it not been for one company…ONE COMPANY…we would have won. Can you guess who that was? Which ONE COMPANY edged out our image viewer for Most Innovative New Product.

It was a then unknown company named XM Satellite Radio.

Can you imagine?

Whatever happened to them? :-)

Qubit Technology went out of business, quite literally, on 9/11. That’s an interesting story for another day, but I distinctly remember that when I found out that we were going out, and that I had a 7-week severance package for my troubles, I was overjoyed. I was Charlie going to the chocolate factory! By then, all BeIA development had been cut off and I had spent months miserably writing QnX code and hating every last moment of it.

We never did invent the iPad. Apple did 8 years later. But those lasting memories of taking our little dream to CES, however badly executed on, will last forever for me.

To my client, Jason, down there in Tennessee right now — I hope I redeem myself for you in just 3 short days. :-)

  • Print
  • Facebook
  • Twitter

, , , ,

Use Latest iOS

One of the quiet new features in the newest XCode release is a new BaseSDK option “Use Latest iOS”. Not all iOS developers will appreciate this unless they’ve been developing for at least 6 months or so.

The problem Apple has solved was an infuriating one. Since an XCode project (a target specifically) can only have one Base SDK, and since the newest SDK changes every couple months or so, we’re constantly loading up old projects (or sample code) and being met with the dreaded “Base SDK Not Found” message. ARGGGGGGGGGGG!!!!!

So, for example, say you want to run an old project to see how you implemented your camera code or something like that. You load the project, but it was running on iOS 4.0. The new XCode only has 4.1. So, no Base SDK found! You have to double-click the target (or targets), and change the Base SDK to the newest one. In fact, 99% of the time, you *always* want the newest one.

Now, as of the newest XCode, you can set the Base SDK to “Use Latest iOS” and, in theory, you’ll never have to change it again unless you have a perverse need to keep your app held back to an older SDK — in which case you are hanging on to an older XCode, too.

I say — thank you, Apple! One day, you’ll figure out how to include old SDK’s in the newest XCode builds, but in the meantime this does save me some grief! :-)

  • Print
  • Facebook
  • Twitter

,

The Fred (1.e4 f5 2.exf5 Kf7??)

A little break from development, I have something to share from my love of chess. :-)

Many years ago, a friend of mine at our local chess club discovered The Fred in a book. I’m not sure what book, but suffice to say it probably wasn’t the MCO! It’s the most ridiculous defense I’ve ever seen given a moniker. I recall trying to explain it to my girlfriend and I couldn’t stop laughing — she’d just give me an odd look.

For many weeks thereafter, just for fun, we’d play it against each other in hopes of a victory that would be one for the ages. (And we were bored.)

Tonight, out of the blue, I decided to play this line again on Lichess. Whomever I was playing must have had feelings of annoyance when they saw it. That they were playing a young child perhaps. I actually hadn’t considered playing this over the Internet before, and I think you lose something in translation not being able to look in your opponent’s eyes and try to keep a straight face. :-) However, there was an amazing amount of satisfaction in taking this line into a very strategic, locked, defensive battle which would eventually break him/her. I wish I could talk with my opponent, who seemed like a good chess player, and ask them their feelings after confronting this defense and, ultimately, losing to it.

Tonight, I share with my chess fans, victory with The Fred defense!

  • Print
  • Facebook
  • Twitter

,

Previous Posts Next posts