Archive for 'Programming'

Programming iOS with JavaScript

So while we’re all twiddling our thumbs waiting for The Great Dev Center Outage of 2013 to end so we can get back to work, how about we find some useful yet completely non-Apple technology to brush up on while we wait? Yes, yes, “useful” and “non-Apple” make it sound like we’re doing a humour piece today, but no! here’s something you just might have overlooked that gives usefulness to what may be a new skill to brush up, brush off or just plain start on learning, and that is: JavaScript!

‘Course, we’ve had ways of communicating with UIWebView for forever, and there’s a veritable plethora of platforms for hybrid apps, but you may have missed a more deeply integrated method that we posted about a while back:

… JavaScriptCore is a part of the open source WebKit project. Instead of using the private library that comes with iOS, you theoretically could compile your own version of this library and bundle it together with your App. Which is exactly what I did…

… Even better would be if Apple would make JavaScriptCore public, and even turn on the Nitro JIT for everyone. I suppose I should file a bug on that…

Looks like that bug got filed! In case you don’t follow WebKit commits, read Apple’s new Objective-C to Javascript Bridge:

A few month back, Apple quietly slipped a very nice Objective-C to Javascript bridge into WebKit. Since the first commit while we were busy celebrating New Year’s Eve, it has been fairly actively developed and improved. This new API supports straightforward embedding of the JavaScriptCore interpreter into native Objective-C projects, including reading and writing variables and object members with appropriate type coercion, calling methods on JavaScript objects, and directly binding Objective-C objects into JavaScript.

It seems likely that this API is going to become public in Mac OS X 10.9 (where JavaScriptCore is already a public framework), and it might be a hint of an eventual public API on iOS. Either way, a new option for building hybrid JavaScript apps is here…

And not too long later, why look what shows up in public:

JavaScript and iOS 7 – The bridge to happiness

I am really excited about something that I haven’t seen mentioned much, and that is a new bridge between the worlds of JavaScript and the runtime of iOS and OS X:

“Introducing a new Objective-C API to JavaScriptCore. iOS developers can now integrate scripting into their apps without having to bundle custom language interpreters. This API builds on top of the existing C API to JavaScriptCore available on Mac, and makes programming with JavaScript much easier and less error-prone.”

And another:

iOS 7 Development: Everything You Need To Know To Get Started

JavaScriptCore – Allows for wrapping of standard JavaScript objects into Objective-C (the code used for iOS apps). Should allow for porting of apps between different mobile operating system platforms.

So, seems like a good idea to brush up on JavaScript, yes…

javascript_good_and_bad_parts.jpg

… but let’s try to be selective about it, shall we? So, Dear Readers; what’s your best resources for getting up to speed quickly while we keep refreshing the dev portal every few minutes? Got a couple here,

Basic JavaScript for the impatient programmer (h/t iosdevelopertips.com)

DevDocs (h/t @rwenderlich)

Let us know what works for you!

UPDATES:

8 Best JavaScript Frameworks For Mobile Application Developers

Ionic is reputed to be an impressive-looking hybrid framework.

Apple’s iOS7 Native JavaScript Bridge

siuying / JavaScriptCoreOpalAdditions: “Use Ruby in your Objective-C apps.”

JavaScriptBridge for iOS

JavaScriptCore by Example

Continue Reading →
0

Roundup: A/B Testing

So we were asked recently “What’s your experience with A/B testing on iOS?” After quashing our instinctive retort of “Hah! They’ll be ice skating in hell the day there’s enough time and budget to ship ONE version of anything properly, never mind TWO!” we, well, weren’t left with much of anything. Ring any bells there, dear fellow contractors? Yeah, thought so. So let’s go looking for what tools are out there for that sort of thing, shall we?

In case you haven’t encountered the concept before, A/B testing (aka split testing aka bucket testing aka optimization testing) is essentially randomized focus group surveying; do two (or more, in which case it’s called MVT, multivariate testing) versions of your ad campaign or your landing page or your checkout screen or whatever, metric up whatever your success criteria are, and serve up the different versions to different users and see which version metrics out better. Rinse and repeat.

In the web world, this is a widely used practice and there’s no shortage of tools to help you out with it, from to Adobe® Test&Target™ to Amazon A/B Testing Service to Optimizely to SiteSpect to Visual Website Optimizer and oodles of others. (And as an interesting aside, check out How to Increase Your Mobile App Sales With A/B Testing and Increase iPhone App Downloads by A/B Testing App Names for tips on addressing A/B testing for all your App Store materiel — name, icon, description, and screenshots — by way of selectively advertised landing pages. Neat idea, that.)

In the iOS app world, not so much; until researching this we’d only ever heard of the idea being used extensively in the context of Zynga’s development practices. But a quick Google immediately turned up a flurry of results for Clutch.io:

Screen Shot 2013-07-09 at 1.48.41 PM.jpeg

Clutch’s native mobile A/B testing tool helps you to choose the best way to present information to your users. It works by showing users different variations of your app, and then measures the effectiveness of each variation. Until now, app developers have been forced to build their own tools to do this kind of testing. With Clutch’s A/B testing tool, you get an easy yet powerful platform to start running these tests in minutes…

Well, there we go then! Or … not so much.

Clutch.io is winding down – for more information about the future of Clutch.io and how you can smoothly transition your apps, please see our announcement.

They did open source it so if you want to host your own custom A/B framework server , why there it is at clutchio/clutch along with all the other pieces of the puzzle. But many of us are probably looking for a hosted solution I expect; so let’s keep looking. And, rather to our surprise, there is a veritable plethora of them out there:

Apptimize: $50/monh up to 1M installs

Screen Shot 2013-07-09 at 4.31.38 PM.jpeg

Arise.io: free open beta

Screen Shot 2013-07-09 at 4.36.45 PM.jpeg

Artisan Mobile: $1000/month up to 25K users

Screen Shot 2013-07-09 at 4.40.28 PM.jpeg

Heatma.ps: $18/month up to 10K samples

Screen Shot 2013-07-09 at 4.45.38 PM.jpeg

Leanplum: apply for beta

Screen Shot 2013-07-09 at 4.48.07 PM.jpeg

Optimimo: $49/month up to 10K users

Screen Shot 2013-07-09 at 4.53.09 PM.jpeg

Pathmapp: $19/month to 2K users

Screen Shot 2013-07-09 at 4.55.12 PM.jpeg

Swrve: by request, apparently

Screen Shot 2013-07-09 at 4.59.06 PM.jpeg

And that appears to be an exhaustive list of hosted services … this week. If none of those look your thing and you want to roll your own with your different flavour of analytical choice or whatever, besides the above mentioned clutchio full stack collection there’s a variety of other projects on github to get you started too:

chrismaddern/iOS-Split-A-B-Test-Library

An iOS Library to support A/B Testing remotely defined values in Apps and reporting back to a server. Includes native controls for A/B Testing UIButton text and background image. Includes generic ABTestCase for testing any NSString value…

conductrics/conductrics-ios

This is an Objective-C wrapper for the Conductrics service, which provides an API for bandit-style optimization, dynamic targeting, and A/B testing.

KeepSafe/Switchboard

Switchboard – easy and super light weight A/B testing for your mobile iPhone or android app. This mobile A/B testing framework allows you with minimal servers to run large amounts of mobile users.

mattt/SkyLab

SkyLab is a backend-agnostic framework for multivariate and A/B testing … integrates easily into any existing statistics web service. Depending on your particular needs, this may include posting to an endpoint in test blocks, or perhaps setting an HTTP header for a shared API client…

mindsnacks/MSActiveConfig

Remote configuration and A/B Testing framework for iOS. Documentation available online.

And … nope, run out of links finally. That was particularly autodidactical of a post, we’d had no idea this A/B thing was such a hotbed of development frenzy. As always, if we managed to overlook something Dear Readers, let us know in the comments!

UPDATES:

Bestly: A/B Testing for Native Mobile Apps

Continue Reading →
0

Free Tapstream Analytics

Do you subscribe to iOS Dev Weekly? If not, you should be, it’s pretty much the highest signal curated development news around; and there’s an extra special good reason to this week — the ad. No, really, the ad.

Going beyond iOS 7′s pretty face

Getting your app in front of the pack this year will take more than a facelift. Tapstream, the simple app marketing analytics company, is running a special for iOS Dev Weekly readers this week only: sign up and activate the SDK within the next 7 days and get our $99/month Pro account at no cost for life.

Marketing analytics are an excellent idea if you like to know if you’re wasting your money or what, of course. The first baby step is to tag your Linkshare affiliate links, but for people who are more serious about it, there’s a whole market segment out there such as the Developer Economics collection we linked to from that marketing omnibus of a last post. Last month a project we were working on decided AppsFlyer was the way to go, but perhaps we’d have decided different if this offer had come along then. Check them out,

Tapstream: App Marketing, Unified.

and if their $99/month plan looks to you like having free for life, hey now you know what to do!

UPDATES:

This is a good writeup of applied Tapstream usage.

And so is How Veam Studios Increased In-App Purchases by 260%.

Deeplinking with Tapstream even works before your app is installed!

Continue Reading →
2

Tip: Xcode 5 Launch Crash

So you installed the latest Xcode 5 DP hotness and … it crashes hard every launch?

The trick here is, it looks at the same folder your out Xcode 4 install does for plugins:

~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins

… and as a rule They Just Won’t Get On with the shiny new ARC-ified Xcode. So what you want to do is delete or rename that folder, and you’ll be good! Well, good as you can be without Alcatraz and all the other goodies you’ve pimped out Xcode 4 with, but progress is never painless, right?

Continue Reading →
1

UI Design for iOS 7

Well, that’s rather quieted the talk of Apple lacking innovation, hasn’t it? “Polarizing”, indeed. From the frothing to the analytical to the philosophical to the satirical, no shortage of reactions anywhere across the spectrum out there. But here, we’ll skip straight to the practical:

START UPDATING YOUR APPS FOR IOS 7. NOW.

The key takeaway we’ve reached (after less than 24 hours playing with the iOS 7 Beta release) is this – every App must consider even basic updates to its UI to survive in a post-iOS 6 world.

We’re not talking about simply flattening the App icon so it matches alongside the Apple stock Apps new, sleek design. Fundamental elements – from borderless buttons to translucent bars through to full-screen layouts must be considered – and added – to allow your App to take full advantage of iOS 7.

What’s the risk?

Remember what non-retina enabled Apps looked like when the iPhone 4 was released? Well, this has the potential to be worse – much worse. And remember when many people said that iPhone-only Apps would look “just fine” on the iPad when blown up to 2X scale. Yeah, that argument didn’t last long.

Simply put, pre-iOS 7 Apps running on the new OS stick out like a sore thumb – looking aged, clunky, and well…just ancient.

Yep, that’s pretty much how we see it. And here’s stuff to help you get on that:

First off, the prerelease iOS 7 Design Resources at the mothership.

iOS 7 GUI PSD added by Teehan+Lax to their design resources collection.

Introducing iOS 7 GUI PSD

Free iOS 7 UI Kit from MediaLoot

iOS 7 UI Kit for Sketch

iOS 7 Icon Guides PSD

iOS 7 Home Screen PSD

New Open Source Project Bringing iOS 7 Style To iOS 5 and 6 UIKit Interfaces

iOS Library For Creating Great Looking Customizable Flat User Interface Elements

Free iOS UI Templates With A Sleek Minimalist Flat Style

UPDATES:

Open Source Control Providing iOS 7 Inspired Flat UI Elements

iOS 7 Icon Template For Photoshop and Sketch

Start making iOS 7 Icons with the App Icon Template 3.0

Parallax is an iOS library that reproduces the parallax effect of the iOS7 home screen.

Demystification of the iOS 7 Icon Grid Design

iOS Device Summary is a great visual representation of devices by screen, processor, and OS versions.

iOS 7 App Redesigns has reinterpretations of popular apps.

I’m busy curating iOS7 links, Everyday.

DevJuice: Glyphish icon set updated for iOS 7

jorgenisaksson/Glyphish-Gallery

JagCesar/iOS-blur grabs the UIToolbar blurring layer for your own views.

iOS 7 Wireframe Kit — blakeperdue.com

iPhone iOS7 Wireframe Kit — funsize.co

Rethinking Your Menu Buttons for iOS 7

Download 650+ iOS 7 Icons for Free

iOS 7-Inspired Line Icons

Unleashing Genetic Algorithms on the iOS 7 Icon

iOS7 Before and After Pics

After iOS 7 icons

Reproducing the iOS 7 Mail App’s Interface

The iOS Design Cheat Sheet

Continue Reading →
2

DZone’s Definitive Guide to Cloud Providers

So we’ve made a few passing mentions as they caught our eye of iOS-focused cloud backend options, what the cool kids apparently call MBaaS (“Mobile Backend-as-a-Service”) these days, but haven’t even attempted to place them in any larger context of the BaaS and PaaS and IaaS and all the rest of the speech-impedimented flocks of sheep collectively referred to as “the cloud”. But, there’s someone who has! So, for some light pre-WWDC reading to distract you from fact-free frittering about what the morrow shall bring, why not check out — in their words –

DZone’s Definitive Guide Helps You Make the Right Cloud Decision for Your Organization

Have you ever tried sifting through the hundreds of cloud solutions available in today’s market? There are so many categories of cloud providers that it’s hard to know if you’re researching the right ones for your use case.

So how do you distinguish the contenders from the pretenders? Even if you have nailed down the type of cloud provider you need, you’re still facing a litany of choices.

The cost and time savings of choosing the right cloud provider can revolutionize your business and drive significant new profit, but the selection process is daunting. DZone observed many developers and IT professionals struggling to find the right solution for their organization, so we decided to mount this unprecedented research project to create a definitive guide to cloud providers.

The result is DZone’s Definitive Guide to Cloud Providers:

100 Pages of Cloud Solution Analysis

9 Categories of PaaS and IaaS Analyzed and Compared

35+ of the Most Active Cloud Solutions and Their Feature Sets

Research from 400+ IT Professionals on Cloud Preferences

Get your FREE copy of this guide and make the best decision for your organization.

“Definitive” might be a tad overstating it, there are a couple noted in our previous posts that don’t show up here, but it does thoroughly cover the generally acknowledged leaders in the various categories so far as we can tell; and hey, if nothing else, it’s a great resource for populating those build-vs-buy presentations for management!

UPDATES:

iOS – App42 iOS Cloud APIs for App42 Backend as a Service – BaaS

Make realtime multiplayer games using cocos2D and AppWarp

Flox: The No-Fuzz Game Backend

Developer Economic’s Backend as a Service collection

Test Drive Evaluation is about kwylez/KitchenSync for testing BaaS providers – FatFractal, Kinvey, Parse and Stackmob to start.

Fat Fractal Tutorial for iOS: Getting Started

cocos2d-iphone: Choosing backend

StackMob Announcement: “The StackMob Platform will cease operation on Sunday May 11th, 2014.”

Parse Gotchas

BaasBox: open source backend for iOS, Android, and JavaScript apps.

Continue Reading →
3

Tutorial: Local App Data Sharing

There’s a comprehensive — well-nigh exhaustive, in fact — roundup of the pre-WWDC state of the art options for data sharing here:

Tutorial: Sharing Data Locally Between iOS Apps

In the sandboxed world of iOS development sharing data between applications can prove difficult. There are a number of reasons you may want your application to share data with other applications:

  • Releasing a paid app upgrade with a new SKU.
  • Moving user data to a universal binary.
  • Releasing a suite of complementary applications.
  • Partnerships with other developers.

Since iOS developers can’t share data directly through the file system [Did they ever plug this hole? -ed.], they need to find alternate solutions for their applications. Some common solutions include:

  • UIDocumentInteractionController …
  • UIActivityViewController …
  • Shared Keychain Access …
  • Custom URL Scheme …
  • Web Service …
  • UIPasteboard + URL Scheme …

That last one being the one that it delves into the details of, with solution github project here.

Improvements to this suite of options next week are common rumours and wishes, so check back here after the show to see what the new shiny state of the art is!

Continue Reading →
0

Library: Capture a Signature

This is a nifty little piece to bookmark just in case you ever need to do any nice smooth line capturing:

Capture a Signature on iOS

The Square Engineering Blog has a great article on Smoother Signatures for Android, but I didn’t find anything specifically about iOS. So, what is the best way to capture a users signature on an iOS device?

Although I didn’t find any articles on signature capture, there are good implementations on the App Store. My target user experience was the iPad application Paper by 53, a drawing application with beautiful and responsive brushes.

All code is available in the Github repository: SignatureDemo

… Here is an example of the final output using quadratic bézier curves, and velocity based stroke thickness creating a visually appealing and natural signature.

687474703a2f2f7777772e6e656172696e66696e6974792e636f6d2f626c6f67732f6a61736f6e5f6861727769672f6173736574732f7369676e61747572652d6c65747465722d6a2d6f70656e676c2e706e67.png

Handy if you ever need it!

h/t: ManiacDev!

Continue Reading →
0

Tutorial: State Preservation and Restoration

If you’re like us and have been putting off puzzling out the State Preservation and Restoration stuff more or less indefinitely, here’s a great introduction to get you started on that:

State Preservation and Restoration

From the very first releases of the iPhone SDK Apple has encouraged developers to think about app startup and switching to make the experience as quick and transparent as possible for the user. The limited resources of mobile devices mean that App termination is a common occurrence. Returning to a previously running App that has been terminated by the system and finding it back at a startup screen is not a great user experience. The ability for an App to be suspended and resumed was introduced with iOS 4 and helps to reduce the problem but to make App termination transparent to the end user still takes developer effort.

There is a non-trivial amount of work required to save and then restore a deeply nested hierarchy of views and view controllers. Luckily with iOS 6 direct UIKit support for state preservation and restoration was introduced. This post is a collection of my notes on the basic steps to implement state preservation and restoration…

Supporting project at CodeExamples / Restorer for that and the followup

Restoration Classes and UIWebViews

I previously covered the basics of using state preservation and restoration but for the sake of brevity I did not provide an example of how to use a Restoration Class. This post will fix that omission and also take a look at how you can implement state restoration for a UIWebView…

Also note the current need to force reload tables, discussed here:

Bug Table View State Not Restored When Embedded in Navigation Controller

And there’s some extra nuggets to be gleaned here:

iOS State Preservation and Restoration

There, that should help you catch up with that new iOS 6 stuff just in time for iOS 7 to snow us completely under again!

h/t: iOS Dev Weekly!

UPDATES:

Checking Version and Device When Restoring State

Continue Reading →
0

UI Design and Asset Creation

So it’s been quite a while since we last mentioned anything to do with the design process, but we’ve noted a couple good posts recently:

Starters Guide to iOS Design

As someone who does work on both the development and design side of iOS apps I find that many designers struggle with the transition to UI work, or with the different processes involved in iPhone and iPad app design. In this guide I’ll describe the deliverables you’ll be expected to produce, outline the constraints of the medium and introduce fundamental iOS and UI design concepts…

Even if you’re not a starter, read it through anyway; it’s packed with all sorts of resource links and further references worth checking out.

My app design workflow

Here it is — my complete iOS, Android and Mac app design workflow, starting from the first time you open Photoshop, to the app release and beyond. Now seemed like a good time to document how I’ve been working, because my workflow is about to drastically change again, with the release of Skala.

There’s a Skala Preview out now that is well regarded, too.

Moving on to the asset creation side, big recent news is that TexturePacker thing which you’ve probably heard of is up to 3.0.11 these days which just added massively convenient integration with UIKit:

UIKit Animations with TexturePacker

UIKit applications often contain animations and lots of graphics. Adding the graphics as single images might consume a lot of memory and impede performance.

Using TexturePacker to create sprite sheets instead:

  • Reduces memory usage
  • Speeds up loading of your application

I’ve created some powerful classes which allow you to simply load the sprite sheets created with TexturePacker into your application – including code to play animations.

If you use animations that are pre-aligned, you might also have a lot of transparent pixels in your images. While the individual files might not use much memory – due to compression – the RAM usage might be quite big.

If you pack your sprite with TexturePacker this transparency can be removed. The provided CAWSpriteLayer class compensates the missing transparency by moving the sprite into the same spot as if it had its original size…

So yeah, now TexturePacker is good mojo for not just game makers but everybody working with lots of bitmap images. Oh, that would be … everybody, pretty much. So download it now!

… unless, of course, you want to skip the whole bitmap thing and go straight from vectors to code. We’ve kept a list of SVG options appended to this SVGKit mention a while back, but there’s one in particular worth pulling out for a more in-depth link collection, and that would be PaintCode:

PaintCode 1.3 is here!

For example, you may want to include real-life photos in your designs. We’ve added support for images to PaintCode to let you do just that…

PaintCode can now import layer graphics, paths, texts, groups and effects from Adobe Photoshop (PSD) documents…

And it’s file compatible with their new WebCode Canvas/CSS+HTML/SVG editor.

fabiankr / FKRBlockDrawing “is a collection of two classes and one category to make creating artwork in code a lot easier. It’s great in conjunction with PaintCode, where the graphics in the examples project are from.”

Recreating MKUserLocationView is a great walkthrough of how to do a tricky control that highlights the benefits of PaintCode nicely.

And of course make sure you check out their tutorials and examples.

Looks pretty darn useful, huh? Yep, we’re free with your money today; download it NOW!

UPDATES:

misterwell / MMScalableVectorView: “Turns static PaintCode or Qwarkee code into a UIView that honors the contentMode property.”

Generating all the icons you need quickly from SVG files – SVGtoIcons

How To Set Up Photoshop For UI Design

Continue Reading →
0
Page 5 of 93 «...34567...»