Under the Bridge

Bézier Path Construction

Most excellent article here on conceptualizing how to put together those Bézier path thingamabobbies in code, with by leaps and bounds the best explanation we’ve ever seen of how curves work:

Thinking like a Bézier path

… Once you’ve learnt to break down one path you can apply the same tools and divide it into lines, arc and curves. One by one, in any combination. The more you do the better you’ll get at it. But we missed curves and curves are awesome. Curves are the center of you favorite vector drawing program. They draw a curved line to another point, bending towards two “control points” on its way there. I said bending towards because the curve doesn’t go all the way to neither of the two control points.

There is a little bit of math involved in how the path is drawn between the four points (the start point, 2 control points and the end point) but unless you are interested you will never have to use it. I am interested so I will gladly explain the math. Feel free to skip ahead if you are afraid that you might learn something…

Master that fear and read the whole thing!

h/t: iOS Dev Weekly!

Continue Reading →
0

Wireless Mesh Networking

Hey, this is nifty! If you’d even bothered to notice this new-ish Multipeer Connectivity thing at all, like us you probably didn’t read past

The Multipeer Connectivity framework provides support for discovering services provided by nearby iOS devices using infrastructure Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth personal area networks and subsequently communicating with those services by sending message-based data, streaming data, and resources (such as files)…

before skipping to something that looked more interesting, amirite? But no, it actually is interesting:

How an Under-Appreciated iOS 7 Feature Will Change the World

A curious download hit Apple’s app store this week: a messaging app called FireChat.

It’s a new kind of app because it uses an iOS feature unavailable until version 7: the Multipeer Connectivity Framework. The app was developed by the crowdsourced connectivity provider Open Garden and this is their first iOS app.

The Multipeer Connectivity Framework enables users to flexibly use WiFi and Bluetooth peer-to-peer connections to chat and share photos even without an Internet connection. Big deal, right?

But here’s the really big deal — it can enable two users to chat not only without an Internet connection, but also when they are far beyond WiFi and Bluetooth range from each other — connected with a chain of peer-to-peer users between one user and a far-away Internet connection.

It’s called wireless mesh networking. And Apple has mainstreamed it in iOS 7. It’s going to change everything. Here’s why.

It can also extend an Internet connect to a place where none exists — for example, to a hotel basement, cave or to rural areas where cell tower connections are non-existent…

Read the whole thing, as they say!

h/t: @justinlbaker!

Continue Reading →
0

Cross-Platform Mobile Library Development

If you actually need any of the information we’re relaying to you today, our deepest sympathies; but if you are so bedevilled as to have to come up with some plan that makes sense for developing a cross-platform native-requiring library, the nice people at Skyscanner have done an impressive amount of legwork researching and documenting the alternatives for you. Shocking spoiler: They all suck.

Developing a mobile cross-platform library – Part 1. Exploring

Here, I am including the experience I had while exploring solutions for developing a mobile cross-platform library, i.e. a single codebase that could be part of mobile apps running under different platforms. It covers my journey from mobile cross-platform developments tools (PhoneGap, Titanium, and the likes), code porting tools, and WebViews that weren’t up to the task, to C++ and JavaScript engines that did work. There aren’t many resources out there explaining how to approach this problem, so we thought it could be helpful if we shared this experience. This is the first of three parts, which lists all the explored solutions…

TL;DR: C++ sucks the least.

Developing a mobile cross-platform library – Part 2. C++

When the cross-platform development tools failed to provide the functionality we needed (check part one), we decided to try a lower-level solution that is supported by both platforms; C++. In Android, we’re able to interface C++ code through the Android Native Development Kit (NDK) and the Java Native Interface (JNI) framework. As for iOS, this is possible with Objective-C++, a language variant that allows source files to include both Objective-C and C++. Hooray!!

There’s also a promised third part on embedding JavaScript along with an engine, which is the other option that part 1 found to suck little enough to still be somewhat workable; but that seems to us more than a little ridiculous for the library development case … and if you’re doing a full app, well we’d say in that case the choice narrows right down to Apportable!

h/t: @binpress!

Continue Reading →
0

Barcodes for iOS 7

Here’s a book you might think about picking up, written by Oliver Drobnik:

Barcodes with iOS 7: Bringing together the digital and physical worlds

Barcodes are a universally-accepted way to track and share information about products, applications, and businesses. Until recently, however, it’s been difficult for iOS developers to take advantage of them without licensing complicated or expensive third-party libraries. With iOS7, Apple has added all the necessary components for you to make apps that scan, display, and print barcodes.

Barcodes with iOS 7 is the first and only book that comprehensively addresses barcode technology for the iOS developer. It offers a introduction to commonly used formats, such as ISBN and UPC codes and provides real world examples that teach you how to integrate code scanning and generation into your apps. This book consolidates information about applicable Apple frameworks in one place so you can quickly add native barcode support to your existing enterprise apps or start building new apps that help bring together the physical and digital worlds…

drobnik_cover150.jpg
  1. Barcodes, iOS 7, and You – FREE
  2. Media Capture with AV Foundation – AVAILABLE
  3. Scanning Barcodes – AVAILABLE
  4. Passbook, Apple’s Digital Wallet
  5. Generating Barcodes
  6. Getting Metadata for Barcodes
  7. Putting Barcodes in Context

And you get a 1D support library for free, too:

iOS 7 does not support generation of 1D barcodes. Still I wanted to have a modern and powerful way to have this functionality present in this book which is all about all types barcodes. So you are getting the most current version of BarCodeKit completely for free. As long as you own a copy of the book in any form you can use BarCodeKit to create 1D barcodes in all your apps…

Still teetering? Buy right now for a half off deal:

Now through March 9th18th you even get 50% discount with promo code “mldrobnik”“bwiaunch50!”

So there you go, if you’ve got any interest in hooking up your apps with real world stuff, looks like a pretty darn solid investment there!

Continue Reading →
0

iOS Design Central

Here’s a new place to bookmark for your designer friends, or yourself should you fancy yourself a designer: Apple’s pulled together all their various design resources onto a new page

Desiging Great Apps

Exceptional user experience is a hallmark of Apple products, and a distinguishing feature of the most successful apps built for iOS and OS X. Use the resources below to learn how to build the polished, engaging, and intuitive apps that Apple customers expect…

Indeed. Don’t think there’s actually anything new there at the moment, seems to be WWDC videos and previously released documents pulled together in one place, but no doubt a good place to keep an eye on in future.

It’s also been quite a while since our last design roundup post back when iOS 7 was a polarizing novelty, so let’s see what else is new we haven’t tacked on to its updates since:

Pixel Perfect Precision Handbook 3 is out now (h/t iOS Dev Weekly), that should be on every designer’s must-read list.

This is a pretty nifty iOS 7 UI Kit Photoshop Action Set:

You’ve probably seen many iOS 7 UI Kits. But this one is slightly different, as there is no psd file involved. All you need (apart from love) is this little 1.4 MB .atn file that creates entire default look iPhone mockups for your wireframes, design mockups (use it with care) or just quick ideas…

iOS Dev Tools is an ever more comprehensively curated set of links in all categories of development interest we don’t think we’ve got around to linking to before, for design-related stuff check out these sections:

Check out all the non-design categories while you’re at it, and follow @iOSDevTools for updates!

Continue Reading →
0

Background Fetch Caveats

Couple interesting posts lately about background fetch resource usage. If you’re not familiar with background fetch, that’s an iOS 7 thing that’s explained quite nicely in objc.io’s Multitasking in iOS 7 article:

Background Fetch is a kind of smart polling mechanism which works best for apps that have frequent content updates, like social networking, news, or weather apps. The system wakes up the app based on a user’s behavior, and aims to trigger background fetches in advance of the user launching the app. For example, if the user always uses an app at 1 p.m., the system learns and adapts, performing fetches ahead of usage periods. Background fetches are coalesced across apps by the device’s radio in order to reduce battery usage, and if you report that new data was not available during a fetch, iOS can adapt, using this information to avoid fetches at quiet times…

But the naîve user may find a surprise in wait:

An Unexpected Botnet

… There is, however, an intrinsic danger in applying this ability without fully thinking through the implications. When enabled within your applications you are essentially building a massively distributed botnet. Each copy of your application will be periodically awoken and sent on a mission to seek and assimilate internet content with only the OS safeguards holding it back. As your app grows in popularity this can lead to some rather significant increases in activity…

Here are the feed request frequencies for various Background Fetch enabled podcast clients … For an RSS feed that changes only once per week just these apps produce 126k web requests each week (out of 160k across all aggregators ). The feed itself is 450KB (49KB gzipped). Where it not for HTTP caching/compression (discussed later) this would be generating 56GB of almost entirely unnecessary downloads each week…

That is, indeed, a lot of almost entirely unnecessary downloads. The developers of Castro chimed in here:

The Value of Background Fetch [Point]

… Our strategy with Castro has been to employ Background Fetch to help us avoid the ongoing cost of a server. Castro polls each subscribed feed from the app regularly and posts local notifications when new episodes are found. There are pros and cons to this approach.

Pros

  • We spend no time on web app development or money on server hosting. Xcode is always open.
  • We have no scaling concerns.
  • The continued functionality of the app is not dependent on future sales.
  • There are fewer points of failure.

Cons

  • Worse update performance since the app hits every individual feed, rather than one centralised server.
  • A central server gives developers flexibility to fix individual feed issues, like poorly formatted dates or duplicate episodes for example…

Well, being big believers ourselves in not doing work we don’t have to, that makes a pretty compelling argument, indeed. But hark! Here’s a counterpoint from coming soon Castro competitor Overcast author Marco Arment:

The Value of Background Fetch [Counterpoint]

… Service-backed apps still have a lot of advantages and exclusive capabilities over iOS 7’s Background Fetch. I think server-side crawling is still the best choice for podcast apps and feed readers, for which users want fast updates to collections of infrequently updated feeds.

Overcast has been crawling tens of thousands of podcast feeds every few minutes for the last 6 months using standard HTTP caching headers. In the last week, 62% of all requests have returned 304 (“Not Modified”). Many of the rest returned the entire “new” feed, but none of the episodes had actually changed, making the server download and process hundreds of kilobytes unnecessarily.

An app using Background Fetch needs to make all of those fruitless requests just to get the handful of occasional changes. All of those requests cost processor time, memory, battery power, and data transfer. And each copy of the app needs to download those hundreds of wasted kilobytes when a server erroneously reports an unchanged feed as new…

A server can simply send a silent push notification to all subscribed apps when there’s new data in a feed, and each app can download just the changes. With infrequently updated feeds, like podcasts, this leads to huge savings in battery life and transferred data over time…

Well, there’s that too. So yeah, if you can’t count on decent 304 support, background fetch is not your resource-optimal choice no.

Lots of good numbers to crunch through, so read the whole posts. Personally, if the choice for your particular application is less than immediately obvious, we’d recommend implementing both methods; that way, if your service goes down, or you stop paying for it, or whatever, the app can remain functional. Safety first and second, that’s us!

UPDATES:

Apropos of things to do to avoid users calling out your app as battery-hogging, take a gander at The Ultimate Guide to Solving iOS Battery Drain

Continue Reading →
0

All About Strings

Are you reading objc.io? If not, you should be. Check out issue #9 for more than you ever realized you didn’t know about strings. Yes, strings.

Quick now: How do you correctly find the length of a string containing odd characters like emoji? And how can you be certain you’re comparing strings with combining characters for visible equivalence correctly? If the answers don’t spring to mind, check out NSString and Unicode.

How do you correctly, i.e. locale-aware, join a list of items for text display? That’s one of the many tidbits in Working with Strings.

No doubt you know how to use localized .strings … but did you know in iOS 7+ you can do locale-aware plurals with .stringdict files? And do you know how to correctly display a localized file name? See String Localization.

Need to validate your input? Or have a full expression grammar? Check out String Parsing.

Finally, know how to calculate bounding rects for attributed strings in the new non-deprecated iOS 7 way? And how to lay out hanging indents for lists and decimal-aligned number tables with Text Kit? If not, here’s String Rendering to get you up to speed.

Haven’t seen a developer periodical this consistently high quality through issue #9 since … well, ever, actually … so we strongly encourage you all to subscribe with their app to keep the goodies coming!

UPDATES:

Extending “strings” to include “text” — Open Source Library And Editor Tool For Easily Formatting Text Within Your Apps

Continue Reading →
0

Custom Keyboards

For our Underutilized iOS Feature Of The Week award, how about UITextField/UITextView’s inputView field? Probably pretty much totally overlooked it, haven’t you? Here’s a sample implementation for next time something like that strikes your fancy (h/t: iOS Dev Weekly):

venmo / VENCalculatorInputView: Calculator keyboard used in the Venmo iOS app:

687474703a2f2f692e696d6775722e636f6d2f565767796d6a482e676966.gif

If you don’t have custom input needs but just want to improve the regular keyboard experience, there’s news for you too: Fleksy has released an iOS SDK that lets users long press to switch keyboards, if they’ve installed the free Fleksy app:

Screen Shot 2014-02-23 at 2.34.47 PM.png

And here’s another project to improve the default keyboard:

tonqa / JustType – The Better Keyboard for iOS

JustType is a keyboard extension using swipe gestures, highlighting and suggestions. It is built to be used in any iOS text editor and all text-intensive iOS apps. And it is really easy to use. If you want to have a video demonstration you can find it on this blogpost.

And just as a side caution, if you do get all excited to implement a custom keyboard with transparency and it displays funny in iOS 7, check out this Stack Overflow question!

Continue Reading →
0

TestFlight, R.I.P.

So no doubt pretty much everyone reading this uses TestFlight for distributing their betas, yes? Well, looks like you might have to rethink that plan.

First up, their FlightPath (née TestFlight Live) analytics disappeared with just a note to participants “so we can focus on other areas of the business”. Well, bad ideas disappear all the time; apparently that turned out to be a bad idea, competing with Flurry. Surprise level: 0.

Second up, they decided to ditch Android completely:

We are refocusing TestFlight on iOS. While we will continue to support app development on iOS, support for Android beta testing on TestFlight will stop by March 21, 2014.

What does this mean?

After 3/21/2014 no user will be able to upload any Android builds to TestFlight.

Whilst of course we thoroughly approve of that strategy, it seems … out of step with market conditions, does it not? Surprise level: high.

Next up, they stopped taking new customers on iOS too:

On 2/19/2014 we announced that only Teams who have previously uploaded a build with the TestFlight SDK will be able to continue to upload builds with the SDK.

What does this mean?

If you are an existing Team that has previously uploaded a build with an SDK attached you will need to upgrade to the latest SDK version by 2/26/2014, afterwards your build will be rejected until it has the correct SDK version.

If your team has never uploaded a build with an SDK or you are a new TestFlight user then you will not be able to incorporate any version of the TestFlight SDK. You will be asked to remove the SDK from your build and re-upload.

OK, now things are getting downright weird. Surprise level: WTF?

Well, the sleuths over at TechCrunch figure they know what’s going on:

TestFlight Owner Burstly Acquired By Apple

Burstly, the makers of an in-app ad management platform called SkyRocket and the parent company of popular mobile app testing platform TestFlight, has been acquired, we’re hearing. Though we’re working to get more information on this now, including deal terms, our understanding is that Apple is the acquirer here.

We’ve been pointed in Apple’s direction by a couple of sources…

Well, on the one hand that’s just about out of character as Apple acquisitions get, on the other hand, we sure don’t see any other plausible explanation for the increasing oddity of recent events, do you? Hopefully Apple just had a “why didn’t we do exactly this all along?” epiphany and are just bringing the TestFlight we all know and love under their umbrella, but on the off chance that’s not what’s going on here, maybe you all want to sign up for HockeyApp while the signing is good!

UPDATE:

All right, this is the first time we’ve updated a post inside the hour: It’s official!

Apple Confirms Burstly Buy

“Apple buys smaller technology companies from time to time, and we generally do not discuss our purpose or plans,” company spokeswoman Kristin Huguet told Re/code.

So yeah, anything you’re relying on TestFlight for right now: figure out a Plan B. Just in case.

MORE UPDATES:

From Crashlytics Labs: Announcing Our Beta Distribution Tool

Continue Reading →
0

iTunes Connect Help

Ever get frustrated with submitting your apps/IAP/Game Center stuff through iTunes Connect? Yes, who hasn’t, indeed. Check out this piece for some help with saving your sanity:

Mastering Command-Line iTunes Connect Submissions

… iTunes Connect is, of course, a critical piece of the Apple developer puzzle. However, inputting any serious amount of content requires more than a little bit of patience, good luck, and praying to the powers-that-be that iTunes Connect doesn’t kick you out before you’ve uploaded your marketing assets and copy.

As the person managing the localisation of our apps and App Store copy, I spend a not-inconsiderable amount of time dealing with iTunes Connect and you can easily lose an afternoon in the system when you’re refreshing up to 15 screenshots, the release notes and marketing copy in each localisation. It’s a similar story for the Mac – huge Retina screenshots that can only be uploaded one at a time make for a time-consuming and often infuriating process.

However, there’s a relatively little-known tool available from Apple that can ease your pain, allowing you to retrieve, pre-flight and upload your app metadata…

Ever notice the ‘Transporter User Guide’ link under ‘Deliver Your Apps’ on iTunes Connect? Yep, that’s the relatively little-known tool.

But there’s some extra niftiness here:

Whilst Transporter has been a great improvement to our workflow, I’ve been itching to improve it further. To get things started I’ve built a small app that allows you to avoid both the Terminal and iTunes Connect itself to submit your iTMSP packages. It’s called Connecter, and the source is available on GitHub

commandlineitunes.png

Worth checking out for lowering the pain level on your store management, yep.

h/t: iOS Dev Weekly!

UPDATES:

Open Source Tool Providing An Extensive CLI For Working With iTunes Connect

Continue Reading →
0
Page 1 of 112 12345...»