<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>IOS 7 on A&#43; programming moments</title>
    <link>https://aplus.rs/tags/ios-7/</link>
    <description>Recent content in IOS 7 on A&#43; programming moments</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 13 Apr 2014 00:00:00 +0000</lastBuildDate>
    
	<atom:link href="https://aplus.rs/tags/ios-7/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Improving Shift key design on iOS 7 keyboard</title>
      <link>https://aplus.rs/2014/improving-shift-key-design-on-ios-7-keyboard/</link>
      <pubDate>Sun, 13 Apr 2014 00:00:00 +0000</pubDate>
      
      <guid>https://aplus.rs/2014/improving-shift-key-design-on-ios-7-keyboard/</guid>
      <description>&lt;p&gt;I consider pre-iOS 7 keyboard design to be the best looking and affordably designed on-screen keyboard ever. The colors (subtle gradients) and animations when a key is activated were just perfect. When iOS 7 came, I was pretty annoyed how much uglier it looked like and consequently how it &amp;ldquo;felt&amp;rdquo; during use.&lt;/p&gt;
&lt;p&gt;Which is why I casually followed the hubbub over the many changes during the 7.1 beta and the &lt;a href=&#34;http://www.imore.com/how-tell-if-shift-key-lower-case-upper-case-or-caps-lock-ios-71&#34;&gt;final result&lt;/a&gt; we were all given. Lots of people discussed it, mostly lamenting the result but I didn&amp;rsquo;t find any actual proposal for the better apart from Stefan Laketa&amp;rsquo;s &lt;a href=&#34;http://laketa.com/one-solution-for-the-shift-key-on-ios-7/&#34;&gt;colored button&lt;/a&gt; approach. Granted, I did not look much as I already said, but if there was something it would&amp;rsquo;ve blip on my twitter timeline (I follow over a hundred iOS devs and designers).&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s my proposal for the visual change but also a discussion about a larger issue with the keyboard behavior I did not notice before.&lt;/p&gt;
&lt;h2 id=&#34;state-of-the-keyboard&#34;&gt;State of the keyboard&lt;/h2&gt;
&lt;p&gt;Ok, so this is the normal state of the light keyboard:&lt;/p&gt;

&lt;link rel=&#34;stylesheet&#34; href=&#34;https://aplus.rs/css/hugo-easy-gallery.css&#34; /&gt;
&lt;div class=&#34;box&#34; &gt;
  &lt;figure  itemprop=&#34;associatedMedia&#34; itemscope itemtype=&#34;http://schema.org/ImageObject&#34;&gt;
    &lt;div class=&#34;img&#34;&gt;
      &lt;img itemprop=&#34;thumbnail&#34; src=&#34;https://aplus.rs/images/2014/light-ios7-keyboard-default.png&#34; /&gt;
    &lt;/div&gt;
    &lt;a href=&#34;https://aplus.rs/images/2014/light-ios7-keyboard-default.png&#34; itemprop=&#34;contentUrl&#34;&gt;&lt;/a&gt;
  &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;and this is its look with Shift key tapped:&lt;/p&gt;


&lt;div class=&#34;box&#34; &gt;
  &lt;figure  itemprop=&#34;associatedMedia&#34; itemscope itemtype=&#34;http://schema.org/ImageObject&#34;&gt;
    &lt;div class=&#34;img&#34;&gt;
      &lt;img itemprop=&#34;thumbnail&#34; src=&#34;https://aplus.rs/images/2014/light-ios7-keyboard-shift.png&#34; /&gt;
    &lt;/div&gt;
    &lt;a href=&#34;https://aplus.rs/images/2014/light-ios7-keyboard-shift.png&#34; itemprop=&#34;contentUrl&#34;&gt;&lt;/a&gt;
  &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;As others have &lt;a href=&#34;https://medium.com/coding-design/b9fbc46a0e3c&#34;&gt;already discussed&lt;/a&gt;, this abrupt change from grey to white and combined with glyph&amp;rsquo;s even more abrupt color change is nowhere to be found in iOS 7. It does not seem to follow any guideline for how the active state should behave. If anything, it should be grey glyph on white background when tapped, certainly not black.&lt;/p&gt;
&lt;p&gt;The main problem with this design is &lt;em&gt;that large, filled glyph in the normal state is too jarring&lt;/em&gt;. When the keyboard appears, the white glyph is the first thing my eye is drawn to, which is the reason people call it confusing. In that split second when it appears, instead of actually starting to type what I wanted, I am forced to think &lt;em&gt;&amp;ldquo;is Shift on? better turn it off&amp;rdquo;&lt;/em&gt;. And then I tap it and it changes entirely thus increasing the cognitive load and annoying me to no end for the wasted time. It&amp;rsquo;s all in the space of a second or two, but man - does it add up over time.&lt;/p&gt;
&lt;h3 id=&#34;visual-solutions&#34;&gt;Visual solutions&lt;/h3&gt;
&lt;p&gt;The obvious solution would be to lessen the white area of the glyph and use a thin line:&lt;/p&gt;


&lt;div class=&#34;box&#34; &gt;
  &lt;figure  itemprop=&#34;associatedMedia&#34; itemscope itemtype=&#34;http://schema.org/ImageObject&#34;&gt;
    &lt;div class=&#34;img&#34;&gt;
      &lt;img itemprop=&#34;thumbnail&#34; src=&#34;https://aplus.rs/images/2014/light-ios7-keyboard-default-me.png&#34; /&gt;
    &lt;/div&gt;
    &lt;a href=&#34;https://aplus.rs/images/2014/light-ios7-keyboard-default-me.png&#34; itemprop=&#34;contentUrl&#34;&gt;&lt;/a&gt;
  &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;With this small change, the Shift ON state would actually be the current OFF state:&lt;/p&gt;


&lt;div class=&#34;box&#34; &gt;
  &lt;figure  itemprop=&#34;associatedMedia&#34; itemscope itemtype=&#34;http://schema.org/ImageObject&#34;&gt;
    &lt;div class=&#34;img&#34;&gt;
      &lt;img itemprop=&#34;thumbnail&#34; src=&#34;https://aplus.rs/images/2014/light-ios7-keyboard-default.png&#34; /&gt;
    &lt;/div&gt;
    &lt;a href=&#34;https://aplus.rs/images/2014/light-ios7-keyboard-default.png&#34; itemprop=&#34;contentUrl&#34;&gt;&lt;/a&gt;
  &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;Simply fill-in the glyph and loosely follow the active-state guideline for the iOS 7 icons. Actually, I did nothing special or new here - the design I propose is &lt;em&gt;exactly what that older beautiful pre-iOS7 keyboard used&lt;/em&gt;. It was already a solved problem and for the life of me I can&amp;rsquo;t figure out why they messed with it.&lt;/p&gt;
&lt;p&gt;Another thought is - why are Shift and Backspace keys using white glyphs on grey background while &lt;code&gt;Return&lt;/code&gt; and &lt;code&gt;.?123&lt;/code&gt; use black glyphs? Why not draw them all using black lines and all would be better as well? Or with white line, doesn&amp;rsquo;t matter.&lt;/p&gt;
&lt;p&gt;One reason for this design decision could be that those keys are more powerful - they either dismiss the keyboard or switch the entire keyboard layout, while the Shift/Backspace are altering/actioning on existing state. Still, food for thought.&lt;/p&gt;
&lt;h2 id=&#34;the-hidden-problem&#34;&gt;The hidden problem&lt;/h2&gt;
&lt;p&gt;While working on this though, I realized that iPhone keyboard is &amp;ldquo;broken&amp;rdquo; on deeper level than just the Shift key visual design. And this issue exists since original iPhone OS.&lt;/p&gt;
&lt;p&gt;You see, when you tap the Shift key, nothing else changes except the Shift key. No other key is visually changed, but the result of tapping any of the letter is changed.&lt;/p&gt;
&lt;p&gt;Do you see where I&amp;rsquo;m going with this? The &lt;strong&gt;keyboard is lying&lt;/strong&gt; to you - it always displays uppercase letters even though 99% of the time it will output lowercase letters. This happens only with the letters - switch to numbers and punctuations and try any of the keys - what you see on the key is what will be outputted. But not with the letters.&lt;/p&gt;
&lt;p&gt;And this is the second, hidden source of confusion - because of this you have no other avenue than to decipher the Shift key so you know what will you actually type.&lt;/p&gt;
&lt;p&gt;Things would be so much better if this was the Shift-OFF state:&lt;/p&gt;


&lt;div class=&#34;box&#34; &gt;
  &lt;figure  itemprop=&#34;associatedMedia&#34; itemscope itemtype=&#34;http://schema.org/ImageObject&#34;&gt;
    &lt;div class=&#34;img&#34;&gt;
      &lt;img itemprop=&#34;thumbnail&#34; src=&#34;https://aplus.rs/images/2014/light-ios7-keyboard-default-me-lowercase.png&#34; /&gt;
    &lt;/div&gt;
    &lt;a href=&#34;https://aplus.rs/images/2014/light-ios7-keyboard-default-me-lowercase.png&#34; itemprop=&#34;contentUrl&#34;&gt;&lt;/a&gt;
  &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;and this the ON state:&lt;/p&gt;


&lt;div class=&#34;box&#34; &gt;
  &lt;figure  itemprop=&#34;associatedMedia&#34; itemscope itemtype=&#34;http://schema.org/ImageObject&#34;&gt;
    &lt;div class=&#34;img&#34;&gt;
      &lt;img itemprop=&#34;thumbnail&#34; src=&#34;https://aplus.rs/images/2014/light-ios7-keyboard-default.png&#34; /&gt;
    &lt;/div&gt;
    &lt;a href=&#34;https://aplus.rs/images/2014/light-ios7-keyboard-default.png&#34; itemprop=&#34;contentUrl&#34;&gt;&lt;/a&gt;
  &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;I&amp;rsquo;m off now to file a &lt;em&gt;radar&lt;/em&gt; for this.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Beware: a crasher lurks with UINavigationController transitions</title>
      <link>https://aplus.rs/2013/beware-a-crashing-bug-lurks-with-uinavigationcontroller-transitions/</link>
      <pubDate>Thu, 05 Dec 2013 00:00:00 +0000</pubDate>
      
      <guid>https://aplus.rs/2013/beware-a-crashing-bug-lurks-with-uinavigationcontroller-transitions/</guid>
      <description>&lt;p&gt;Custom view controller transitions are fast becoming my favourite iOS 7 API addition. As with all new things, there are surprises and side effects to learn about. This post is about one such issue, in this triangle:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://aplus.rs/images/2013/uinavcontroller-crash-structure.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;There are 3 view controllers. First one (list) can either directly go to the 3rd (details), or it can first open the search controller in the middle, from where you can go to details as well. It&amp;rsquo;s all done through &lt;code&gt;UINavigationController&lt;/code&gt;, using &lt;code&gt;pushViewController:animated:&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Custom transitions exist only between 1st and 3rd VC and vice versa. Thus, both of this VCs are &lt;code&gt;UINavigationControllerDelegate&lt;/code&gt;&amp;rsquo;s, as indicated by yellow circles and they contain this code:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-objectivec&#34; data-lang=&#34;objectivec&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;void&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;viewWillAppear:&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;BOOL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;animated&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;super&lt;/span&gt; &lt;span class=&#34;nl&#34;&gt;viewWillAppear&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;animated&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;...&lt;/span&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;nb&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;navigationController&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;delegate&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;UIViewControllerAnimatedTransitioning&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;navigationController:&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;UINavigationController&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;navigationController&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nf&#34;&gt;animationControllerForOperation:&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;UINavigationControllerOperation&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;operation&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nf&#34;&gt;fromViewController:&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;UIViewController&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;fromVC&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nf&#34;&gt;toViewController:&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;UIViewController&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;toVC&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Search controller has no custom transition.&lt;/p&gt;
&lt;h3 id=&#34;crash-scenario&#34;&gt;Crash scenario&lt;/h3&gt;
&lt;p&gt;These are the steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;on 1st (List) VC, tap to open Search VC&lt;/li&gt;
&lt;li&gt;on Seach VC, tap to open Details VC&lt;/li&gt;
&lt;li&gt;Go back to Search&lt;/li&gt;
&lt;li&gt;now, either try open another instance of Details VC or go back to List VC&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;App will crash on step 4.&lt;/p&gt;
&lt;p&gt;Adding an Exception Breakpoint on throw, I got this stack trace:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://aplus.rs/images/2013/uinavcontroller-crash-stack-only.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;Notice the second line from the top, just below objc_msgSend. Apparently it tries to get an instance of custom transition and crashes.&lt;/p&gt;
&lt;h3 id=&#34;solution&#34;&gt;Solution&lt;/h3&gt;
&lt;p&gt;Rather simple - in Search VC, clear the UINC delegate.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-objectivec&#34; data-lang=&#34;objectivec&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;void&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;viewWillAppear:&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;BOOL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;animated&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;super&lt;/span&gt; &lt;span class=&#34;nl&#34;&gt;viewWillAppear&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;animated&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;...&lt;/span&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;nb&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;navigationController&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;delegate&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;nil&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    
  </channel>
</rss>