Monthly Archives: May 2015

Got An Idea? Build An App!

Thinking up workable, unique app ideas has got nothing to do with technical knowhow. If you feel you have chanced upon an idea that can indeed be transformed into a mobile application, never hesitate to follow your heart. Here are some broad steps you should follow.

What’s that ONE thing you simply must have for making a mobile application? The answer isn’t ‘programming expertise’, for you can always hire professional mobile app companies to look into the coding aspects. The correct response to this query would be ‘a viable app idea’. Note the importance of the word ‘viable’ here. There are more than 3 million apps (iOS and Android combined) available for download – and it is almost impossible to think up an app idea that someone else has not already thought up before. In case your idea is too unique, its target audience would also be too niche – and it won’t translate into a revenue-generating application. You need to focus on coming up with ideas for apps that are a) workable, and b) will transform into a new application which serves its core purpose better than other apps in the same genre. If you indeed have an idea (yep, anyone can have them), make an app by following these steps:

 

  1. Decide who’s going to do the coding – If you are proficient in Objective-C and Swift programming (required for iOS applications), or Java (needed for Android apps), you can work on the app idea on your own. For those from non-technical backgrounds (most people are), there are plenty of good mobile app development companies which can handle the project. All that you need to do is prepare a shortlist of the best app companies, have a chat with their in-house developers, ask for free app quotes, and delegate your project to the agency that seems the most capable.
  2. Sketch out your idea – Yes, the app company you hire can do this on your behalf too. However, it would bring greater clarity to your idea (as well as help the developers), if you prepare a rough pen-and-paper sketch of your idea, depicting the screens that the app would have, the features you want to include, and the overall ‘flow’ of the application. In the lingo of mobile app development, these low-fidelity drawings are called ‘wireframes’, and they come in really handy for real-time testing, making modifications, and building high-level mockups later on.
  3. Know your target end-users – Are you planning to create an iPhone app for kids? Is a mobile finance app on the Android platform on the top of your mind? Depending on the nature of the application you wish to develop, your target audience would vary. In turn, the required UI/UX designs, the features and in-app navigation structure, animations (if any) and requisite app security levels would change. Ask yourself: “Will my app indeed help users?” If you are not convinced it will, it would be better to put that idea on the backburner for a while. The app you make should have ONE principal purpose.
  4. Determining the right platforms – Windows Phone is still struggling, Samsung has not been able to make Tizen take off yet, and Blackberry (while not dead yet) is not showing much signs of a recovery. Hence, iOS and Android are the two platforms on which you should ideally consider deploying your idea. If your app would be targeted towards users in the US, UK or Australia, go with the iOS platform. On the other hand, in case you want your app to be downloaded by as many smartphone-users in Asia as possible, hire Android app developers. Remember: once your app succeeds on one platform, creating a custom version of it for the other platform is not at all difficult.
  5. Native app or Hybrid app? – Intuitive user-experience (or the lack of it!) can make or break a mobile application. If time is not a factor, you should transform your idea into a native smartphone app – on the platform(s) you have chosen in the previous step. Going for hybrid apps (which has features common to native apps as well as mobile web apps) is also an option, particularly if you want the volume of users to be as large as possible. Stay away from the web app-only approach though – they do not generally rank high on user-experience, and cannot have as many high-end features as a native app can.
  6. Determine the ‘right’ notification system – In most cases, an in-app notification system (i.e., sent only when the app is active) is opted for mobile app development experts. The nature of your app idea might, however, warrant the presence of push notifications in the actual application (say, in a live scores app, or a news feed app). Push notifications are a common feature of most popular email applications as well. Unless absolutely necessary, sending out notifications via SMSes or separate emails is not advisable. After all, an app should not ‘disturb’ a user too much!
  7. Find out about the backend infrastructure – A perfectly good-looking and apparently well-functioning app can have serious bugs in the backend, leading to problems like excessive battery drains, inaccurate displays, and even random freezes. Even if you are not familiar with coding methods, inquire the app developers working on your project about the APIs (application programming interfaces), data flow structure, and the server functionality that would power the app. Make a note of the memory and bandwidth requirements of the application as well (after the wireframing and storyboarding). Make sure you know how databases are being created and maintained in your app.
  8. Get the app skins created – The term ‘skins’ seems unfamiliar? Worry not, they refer to the individual screens of your Android/iOS app. Provide clear, pointwise instructions to the graphic designers and animators about the visual features that you want to be present in every screen, how the content would be laid on the screen, the precise locations of the images and animations (the latter is particularly important in mobile games). Most app companies have separate teams of prototype-testers, who test alternative versions/builds of the same app, and pick the one that seems the most user-friendly. If you feel any modification is required in the designs or navigational flow, request for the changes to be done immediately. You are the one paying, and you have every right to make the app just as you want it.
  9. Design for the bigger screens – The relatively small screens of iPhone 4S (3.5”) have become more of an aberration than the norm at present. The screen of iPhone 6 is 4.7”, that of iPhone 6 Plus is 5.5”, while the screen of the much-hyped Samsung Galaxy S6 is 5.1”. The next set of flagship iOS and Android smartphones is rumored to have even larger screen sizes. Your app needs to be customized for all of these latest handsets. Instruct the UI/UX designers and developers to prepare the layout and use such hi-res images that would look nice on these phones. If the app is not properly viewable, people would uninstall it from their handsets (or keep it but never use it – which is equally bad). More significantly, your ambitious, promising app idea would go to waste.
  10. Which monetization strategy should you go for? – Every mobile app developer creates applications to earn money (only a small fraction actually manages to make profits, but that’s another story). For that, you need to add a proper revenue-earning strategy to your app idea. Do not think of making a ‘paid app’, since they typically have low download counts (in any case, the ratio of free apps to paid apps is heavily skewed in favor of the former at both iTunes and Google Play Store). Consult with the app-makers you are working with, and decide whether in-app purchases or mobile advertising would be better suited for your app. In kids’ apps, digital games and storybooks can be offered via in-app purchases. On the other hand, you can go with a free version of the app with ads…and give users the option to upgrade to an ad-free ‘Premium’ version.
  11. Don’t be too finicky about deadlines – Theoretically, it is important to release a ‘Minimum Viable Product’ (MVP) at the app stores as soon as possible. However, this should never be done by compromising on quality. Given your budget (as specified in the app quote), there is a direct tradeoff between the quality assurance of an app and the speed at which it can be developed and released. Your focus should be more on the former. Who wants their very first app to turn out to be a dud?

(Note: You, of course, have the right to ask the reasons for inordinate delays. Leading mobile app companies have backup manpower to pitch in, when such risks of delays crop up).

12. Make arrangements for monitoring user-behavior – Is your dream limited to seeing your idea being transformed into an app and being showcased at the App Store? If yes…well, you have to dream bigger! In the long-run, what matters is whether people are liking the app that has been created from your idea. Find out from online Android and iPhone app development forums about the mobile app analytics tracking software that are generally used (there are a whole lot of them, ranging from Flurry and Google Analytics, to Preemptive and Localytics). You should be aware of how people are using your application and frame an idea about the improvements required. Via social media channels, you can actively seek feedback on your mobile software as well.

13. Test the app before submission – Even though prototype-testing was constantly going on during the app development process, it is imperative that the app is tested thoroughly once again – prior to its submission at the app stores. Apple’s app review guidelines have always been stringent, and recently, Google has also started manually reviewing each app submitted to the Play Store. App rejections can, and will, happen from time to time – but careful testing on simulators, on the cloud, and on actual devices can minimize such risks.

14. Plan upgrades regularly – And we are not talking about mere bug-fix updates here. Once your app is approved at the store(s) and has found acceptance among targeted users, start thinking about the additional features that can be included in its next version. If your app idea is fairly elaborate, consider including only the basic features in the initial release of the app, and add more features in the subsequent versions. Not releasing upgrades for long periods would lead to your app being viewed as static.

15. Include wearable technology in your plans – Apple Watch is off to a fast start, and companies are increasingly getting into WatchKit app development. In the upcoming Google I/O 2015, news about the next generation of Android Wear is expected. Wearable technology is well and truly the ‘next big thing’ in the domain of mobile tech. Hence, it would be a mistake if you do not plan for a custom version of your smartphone/tablet app for wearables too. Look for a company that makes apps for Apple Watch/Android Wear – it will handle this responsibility.

There’s no saying where, and under what circumstances, an app idea will strike you. It might be while hurrying for office. vacationing at an exotic island, or even during a frustrating wait at the airport for a delayed flight. Do not sit upon the idea, and let it go to waste. Make an app out of it – your idea might very well turn out to be a winner!

How Many Of These iOS 8.3 Problems Have You Faced?

Although iOS 8.3 is by far the best iteration of Apple’s iOS 8 platform to date, it has its fair share of bugs and performance issues. We will, in what follows, take stock of some commonly reported problems with iOS 8.3.

In mid-April, the adoption rate of iOS 8 touched 78%. The release of the iOS 8.3 update, which is significantly more stable than its predecessors, on April 9, had a lot to do with that. iOS experts and app developers are expecting the public release of iOS 8.4 (which is expected to be the final upgrade before iOS 9) to take place in late-June, maybe a couple of weeks after WWDC 2015. Meanwhile, a series of bugs and issues on iOS 8.3 have been reported – indicating that the upgrade isn’t as foolproof as it was initially envisaged to be. We will here do a roundup of some of these snags that iOS device-users have faced after upgrading to iOS 8.3:

 

  1. Inability to upgrade to iOS 8.3 – This is – let’s give where credit is due – not a widespread problem. However, there have been a not-so-insignificant number of cases where owners of iPhone 4S and fifth-generation iPod Touch have simply not been able to move on to the iOS 8.3 platform. They have been forced to stay with iOS 8.2 – which, as any mobile software or iPhone app developer would confirm, is, at best, a shaky update.
  2. Issues with Bluetooth connectivity – It’s just strange how Bluetooth problems are one of the several issues that the biggest mobile platforms like iOS and Android tend to have. On iOS 8.3-powered devices, connection drops have been reported by users while using accessories, like headsets, earphones and car stereos (connected to the iPhone). Switching off Bluetooth and turning it on again is not of much help, and neither is the option of resetting the network settings (Settings → General → Reset → Reset Network Settings). iOS app development and troubleshooting experts recommend doing a hard reboot, before trying to establish the Bluetooth connection again. Making the problematic device ‘forget’ the previously connected devices (Settings → Bluetooth app → Forget This Device → Forget Device) also serves as a temporary solution. Let’s just hope iOS 8.4 comes with a patch for this irritating problem.
  3. Problems in using keyboards – One of the best things about iOS 8 is, users can finally download and install third-party keyboard apps on their iDevices. However, not everyone’s experience with using keyboards have been pleasant, after upgrading to the iOS 8.3 platform. Word suggestions often get turned off on their own, and there have been reports of the popup key (at times, the entire screen) getting frozen – after a key is tapped/pressed. In certain cases, the keyboard bug has blocked off multiple keys of iOS keyboards from view. Turning off the Settings → Accessibility → Zoom is an option to avoid this problem – but once again, it’s not a permanent fix.
  4. Photo storage bug – Along with the Touch ID problem (we will come to that in a bit), the problems in the camera roll are probably the most-documented among iOS 8.3 issues. Most users who do not store images on iCloud have found problems in accessing/using the photo albums on their handsets. Engineers from Apple Inc. are reportedly working for a reliable fix to this problem – which would be a part of the iOS 8.4 update. Till then though, all that people can do is create separate albums, and import pictures from the camera roll to them manually (as and when new pictures are taken). Not at all a convenient way of working.
  5. Surprisingly high battery drain – Say hello to yet another common smartphone problem. After installing the iOS 8.3 upgrade, many people have found that the battery performance of their phones (which was nothing great to begin with) has become significantly worse. According to complaints posted in iOS app development forums online, users of iPhone 5S have been affected the most by this ‘battery bug’. Now, excessive battery drain can be caused by certain iPhone applications – but in this case, the problem lies with the OS itself. Interestingly, Mac OS 10.10.3 also has been reported to have battery performance issues.
  6. iCloud Storage displaying wrong information – If you are surprised by the clearly erroneous storage space information on iCloud Storage on your brand new iPhone 6 – you won’t be the only one bitten by this problem. In fact, many general users as well as professional iOS app developers had detected, and reported about, the iCloud Storage incorrect data issue within a week or so after the release of iOS 8.3. There is, as yet, no quick fixes to remove this problem – unless, of course, you are willing to downgrade to iOS 8.2. Waiting for the next iteration of the iOS 8 platform would be a smarter option.
  7. Problems in using tablet apps after upgradingThis is a problem has affected users of iPad Air in particular. Applications that were working fine on iOS 8.2 (and earlier versions of the OS) have started to randomly crash, freeze or become inexplicably slow – after the upgrade. Representatives from leading iPad app development companies have confirmed that this is not being caused due to app-specific malware, and is a glitch with the OS itself. It has been found that getting the affected iPads to ‘Recovery Mode’, and doing a full restore, solves the problem somewhat. Even so, a fix for this should feature in iOS 8.4.
  8. Touch ID in App Store – Arguably the biggest performance bug in iOS 8.3 is the unresponsive (at least for most users) Touch ID in the App Store. Contrary to what was initially reported in online iOS forums and communities, the problem does not get rectified on its own. Neither is the glitch in the Touch ID limited to particular geographical areas or specific devices (apart from iPhone 6/6 Plus owners, users of iPhone 5S and even iPad Air 2 have reported this problem). Setting the ‘Touch ID & Passcode’ option to ‘off’ (under ‘Settings’), rebooting the device, and activating ‘Touch ID & Passcode’ again has solved the issue for some users (remember to toggle both App Store and iTunes to ‘On’ as well). However, until the fingerprint sensor on new iOS devices work uniformly efficiently, users will be apprehensive about using mobile payments apps in particular, and the overall security of their iDevices in general.
  9. iMessages can start malfunctioning – To be fair, iMessages on iOS 8 was never perfect to start with. It’s rather surprising though that even in the third major upgrade, the developers have not been able to remove the problems. Right from non-functional Group Messages and inability to activate Facetime, to non-receipt of messages from particular sender(s)/device(s) and blurring out of the phone numbers – a wide range of iMessage issues are still reported by the adopters of the iOS 8.3 update. In certain cases, sending/receiving image files via iMessages is a problem as well. With Apple focusing on greater stability and enhanced performance in the upcoming iOS 9 platform, developers feel that the Messages app will finally become trouble-free. Till then though, users will have to live with its unreliability.
  10. Frequent wifi connection drops – It’s not entirely surprising that an incremental update like iOS 8.3 has some problems with the wifi connectivity feature on devices. For a section of users though, the frequency of connection drops and breaks, and generally weak connectivity (even when the signal strength is strong enough) has been abnormally high. One way to tackle this problem (at least temporarily) is by doing a hard reboot of the affected iPhone. Some users have also reset the network settings, and found that the wifi connectivity has improved significantly on their handsets.
  11. Random crashes of the mail app – This one is plain weird. On upgraded iPhone 6/iPhone 6 Plus, the built-in mail application has been found to crash rather frequently. There has also been reports of significant delays in the receipt of incoming mails. After moving on to iOS 8.3, some users have seen that the mail app on their iPhones force quitting on their own as well. iOS software and app developers feel that, in a major upgrade, presence of a problem like this is extremely surprising.
  12. Password Settings getting lost – One of the most promising new features of iOS 8.3 has also turned out to be rather problematic. The upgrade is supposed to allow users to download any free iPhone application from the App Store, and not bother about using the Touch ID for that. However, there have been instances of the password settings getting reset automatically. As a result, people are being used to re-enter their passwords repeatedly, for each download. Deactivating the ‘Require Password’ option (in ‘Password Settings’ under the Apple ID) does not solve the problem. Once again, a patch for this expected from the next upgrade.

In addition to the above, complaints have come in about sudden crashes in the Photos app (particularly after deleting photo(s)), after upgrading to iOS 8.3. Some users have experienced problems with the rear camera of their iPhones. There have been scattered reports about AirPlay and CarPlay performance issues after doing the upgrade.

 

Although the list of iOS 8.3 problems seems pretty big, one thing has to be noted here. Barring the Touch ID bug, none of the other issues are universal – and there have been plenty of iPhone 6 users who are relatively satisfied with the upgrade (it’s a different story among iPhone 5 and iPhone 4S users though). Apple Inc. is aware of these issues, and would, hopefully, resolve most of them in the soon-to-release iOS 8.4 update.

 

How many of these problems have you faced?

 

16 Things New iOS Developers Must Be Aware Of

Professional iOS app developers need to factor in a lot of things while creating applications, to bolster the chances of the latter’s success. If you are planning to get into this field, here are a few pointers to get you started.

Mobile app development has been projected to become a $26 billion industry by the end of 2015. Fast forward another couple of years, and the total revenues are likely to soar beyond $65 billions, as the annual app download count goes past a stunning 210 billions. Among the different app development platforms, iOS offers by far the highest earning potential for developers (in spite of Android hogging more of the worldwide market share). Creating iPhone apps at a professional level can certainly be financially rewarding, provided you keep in mind the following factors:

 

  1. Do not develop apps for the heck of it – As soon as you move beyond working on dummy projects, there has to be a purpose to all your app developments. In order to be successful, an app needs to be ‘needed’ by the end-users. If the app-idea is unique but won’t be serving any particular purpose (or its targeted end-users would be too niche), it won’t be worth investing time, money and effort on.
  2. Not all app ideas are feasible – Brainstorming new app ideas is not particularly easy. Once you and your team have zeroed in upon an idea, it is only natural that you would be determined to transform it into a nice iOS application. However, this is not possible in all cases. There are many ideas that sound perfectly good in theory, but are not practical (either the potential costs are too high, or the coding required is too complex, etc, or any other such problem). If a third-party client floats an app idea (and asks for a free app quote on it) which you do not feel is workable, don’t be hesitant to tell him/her that.
  3. Become an expert programmer – This is, of course, an ongoing process. However, before you even apply for a position at an iPhone app company, make sure that you are comfortable in working with Objective-C and Apple Swift – the two programming languages you will need to code apps. You will also need to have a first-hand feel of the latest Xcode tool (the third beta of Xcode 6.4 has been seeded) as well as the Cocoa Touch framework. A good mobile app developer is, invariably, a master programmer.
  4. Register yourself with Apple – Now for the official stipulations of Apple Inc. To start submitting apps at the App Store, you will have to register yourself as an iOS developer (a fee of $99 has to be paid) at https://developer.apple.com/programs/ios/. In case you are not familiar with working on Mac computers, start learning up the nitty-gritty of the OS (install OS X Yosemite) as quickly as possible. You cannot, after all, make an iPhone app without an iMac!
  5. Move with the times – The domain of iOS app development is in a state of constant flux. You might have received training about how to make apps for the older 4” iPhone 5 handsets – but your clients are likely to ask for applications that are optimized for the much larger screens of iPhone 6 (4.7”) and iPhone 6 Plus (5.5”). In addition, new opportunities have opened up in the sub-domain of making apps for Apple Watch. The general standard of the initial set of WatchKit apps has been pretty poor, and companies are in a race to create better applications for the Apple smartwatch.
  6. Be realistic with your deadlines – While setting a deadline for finishing a new mobile app project, make sure that it can actually be completed within that period. Factor in things like available manpower, probable delays, the expected app testing period, and the like, before you quote a particular date. Ideally, divide the entire app development process into multiple phases and milestones. This will help in keeping your task streamlined and systematic. Remember, missed deadlines can be disastrous for the goodwill of iPhone app companies.
  7. Work in collaboration with professional designers – You are reading this because you want to be an iOS app developer, right? That means your expertise/principal line of interest lies in the direction of coding, bug-testing and related tasks. Do not kid yourself into thinking that you can handle the UI/UX designing responsibilities as well. In order to be successful, an app needs to have user-friendly, engaging interfaces and layouts, in-app navigation, splash screens, animations (particularly in iPhone games) and other visual features. Hire professional graphic artists and animators for the purpose, and work in collaboration with them as a team.
  8. Never give up on your core expertise – This one is for all the senior mobile app entrepreneurs and CEOs out there. As their companies grow, more and more time gets spent on guiding others, managing projects, interacting with clients – i.e., all the responsibilities that come with helming an app agency. This, in turn, squeezes the time available for actual coding and developing applications (after all, you can work for only so many hours in a day!). If you are a proven expert coder but do not have the time for programming, that would be a shame. Delegate some of your everyday tasks to a trustworthy colleague, and devote some time for doing the thing that brought you in this profession in the first place. That’s right, coding for apps!
  9. Understand the difference between desktop and mobile screens – An iPhone application should never be a bundled-down version of a website (in fact, if you simply replicate a website in an app, it might very well get rejected at the App Store). The content viewable on a mobile application has to be customized to the targeted device screens, and should not be anything like the pages of web applications (except for visual branding elements). Developing native mobile apps is what you should be interested in. Mobile web apps are no longer popular, and making hybrid apps, in most cases, is not worth the effort.
  10. Delivering optimal user-experience should be your prime focus – Not what ‘looks good’ to you, not what the client ‘feels’ will be right – you need to be concerned about the user-experience that an app would deliver in its final form. The long-run success of an app depends on whether its download figures sustain over time, and developers simply cannot afford to put user-preferences in the backburner. If there is a difference of opinion between you and your client(s) regarding the features and/or layout scheme an app should have, schedule a meeting, discuss things over, and find a solution that would be the best for end-users. Most of these final users will be from non-tech backgrounds – if they find your app too complicated, they will simply uninstall it.
  11. Set up app monetization and analytics tracking strategies – You are planning to make iOS apps for one final goal – to earn (hopefully) handsome revenues. That would, however, remain a pipe dream if you do not monetize your app in the first place. With the share of paid iOS apps having dwindled to less than 8%, implementing a straightforward paid download strategy won’t be a good idea. Instead, decide whether you should go for mobile advertisements (you will need to have a premium, ad-free version as well), or whether the Apple in-app purchase (INP) system can be included in your apps. In addition, it is imperative to track user-behavior on your apps, after installation. Make sure that you have set up a properly functioning mobile app analytics tool in your software.
  12. Never be in a hurry to release your app – Leading mobile app developers across the world agree that there is a three-way trade-off involved in making apps: between the quality of the app, the cost of the app, and the time required to create the app. As a new developer, you cannot afford to compromise on quality, and once you have stipulated the budget for the app-making process – take your time to ensure that the piece of mobile software you churn out is of the finest quality. You can release a Minimum Viable Product (MVP) earlier, but do specify that it is not the app in its final form. A tearing hurry to bag a non-existent first-mover’s advantage is the cause for many app failures.
  13. Make your clients a part of the team – The last thing you want to see after spending weeks on making a custom iOS app is a frown on the face of the client. Think from his/her perspective too – (s)he is shelling out big money, and it is only natural that the app should be made exactly the way (s)he wants. During the development stage, constantly interact with your clients, share wireframes and mockups with them, and ask for feedback/suggestions. It’s important to make clients feel involved – and the strategy ensures that your work is in sync with the clients’ preferences.
  14. Consider potential memory and bandwidth problems – Developers moving on from the web platform to the mobile platform often tend to overlook this. The available memory space in a mobile device can be as little as 128 MB – a far cry from the 8GB memory space that a computer can have (maximum). Avoid using too many ‘heavy’ images in your app – which will affect its overall speed and performance. In addition, monitor the bandwidth usage of your new app before submission. If too much of mobile bandwidth is being consumed by an application, you need to make the necessary fixings.
  15. Optimize for touchscreen devices – You need to have an in-depth feel of the general touch gestures on the latest iPhones, iPads and iPod Touch devices, before getting down to create an app. Work with your app design team to create buttons, tabs and menus that would be easy to tap (for people with all types of finger sizes), and the expected user-flow would not be hampered in any way. Understanding the nature of touch interfaces and modifying the app codes accordingly is a necessary skill – the sooner you acquire it, the better.
  16. Test your app – No matter how many bug fix updates you release, if the first version of your app is buggy – that gives your company a bad name (your client won’t be overtly happy either!). In addition to testing apps on the iOS simulators available in Xcode, you have to actually install and test it on all the targeted devices. If possible, form a focus group, ask them to install the app on their devices, use it, and provide their feedback. Mobile app testing on the cloud is also important.

As a professional iOS app developer, it is of essence that you should be acquainted with all the clauses of the App Store Review Guidelines and the iOS Human Interface Guidelines. Never use any private APIs in your app, and make sure that there are no discrepancies in the small and large versions of your app icon. Data management on apps should ideally be from the server-side. Becoming an expert iOS developer is certainly not the easiest task in the world, and it will not lead to overnight riches either. However, if you follow the above tips, you can steadily move towards professional success and recognition.

 

Now, that’s what you should be after, right?

 

Working With Swift & Cocoa Touch On iOS 8: Some Pointers

For making apps for the iOS 8 platform, Swift is the preferred language for many developers. However, the Objective-C based Cocoa Touch framework is still immensely popular as well. In the following discussion, we have deliberated on how Cocoa Touch can be optimally used on iOS 8, with Swift and Obj-C.

A survey conducted among iOS developers in first quarter of 2015 revealed that over 20% of them work with Apple’s new Swift programming language. There is a significant section among them who use Swift as the primary language, with Objective-C being relegated to the secondary position. Given its speed advantage (almost 9 times faster than Python, and around 2.5 times faster than Objective-C), the impressive adoption rate of Swift does not come as a surprise.

 

Amidst all the buzz about Swift, there is one potential source of confusion, however. Most iOS app developers to date use the Cocoa Touch framework to create applications. The libraries of Cocoa Touch are in Objective-C, which makes it necessary for coders to know how to seamlessly implement Swift codes in the framework. In addition, some additional knowledge is also required for working with Cocoa Touch on the iOS 8 platform. We will here share a few basic tips involving Swift, Cocoa Touch and iOS 8:

 

  1. Moving from Obj-C Classes to Swift Methods – After importing the Cocoa Touch framework in their projects (more on that in a bit), iPhone app development experts have to generate objects in Swift. A sample command line for this purpose would be: var myImageView:UIImageView = UIImageView (image:myImage). Unlike in Objective-C classes, ‘initwith’ is not required for class initialization in the Swift environment. There is no need for calling ‘alloc’ either. Another advantage of the new language is that, the variable type does not have to be specified at the time of creating class instances (Swift handles this on its own).
  2. Start with a Universal Framework – You might have to tweak around a bit with the default Xcode settings (make sure you have the latest iteration of Xcode 6) for this. On the target project, the ‘Build Active Architecture’ option has to be set to ‘No’ (this is necessary for making the framework universal). In case you find that the app builds have become laggy or unstable after doing this, check the modularity of the system. Select armv7, arm64 and armv7s as the ‘Valid Architectures’.
  3. Say goodbye to Project Editor for importing frameworks – Programmers working on iOS 8 apps no longer have to use the Project Editor to import Cocoa Touch frameworks in Swift. A one word ‘import’ statement does the job (for instance, import MediaPlayer). The headers of the Obj-C framework are transformed into Swift language APIs (after they have been compiled into modules). All the functions and methods used in Objective-C get changed to appropriate Swift classes (e.g, String in Swift in place of NSString in Objective-C).
  4. Including Frameworks In App Projects – Doing this is easy enough in the Xcode environment on iOS 8. All that mobile app developers have to do is make a /lib directory at the root of the project. In it, all the required custom frameworks and artifacts will be stored. Once that is done, move to ‘Framework Search Paths’, and write: $(PROJECT_DIR)/lib. If any error is generated, repeat the entire process. The same thing has to be added to ‘Runpath Search Paths’, when unit testing is being performed on an app.
  5. Implementation of Obj-C Methods within Swift – Apple has reiterated again and again that Swift is not meant to be a replacement of Objective-C. iOS developers can use the two languages in collaboration – and this is a further proof of that. Three key differences between the message call methods in Obj-C and Swift are: a) the usage of ‘dot syntax’ in the latter, b) the disappearance of the starting parentheses (the third brackets in Objective-C), and c) the non-requirement of the semicolon at the end of the line. The name of the Swift Method is the same as the Selector name in the earlier language. The different components of the Obj-C selector (except the first one) become Swift Arguments. The syntax of the names and arguments change when the Obj-C framework is imported in Swift.
  6. Factory Methods to Initializer Methods – Objective-C gives the option to those coding for iOS apps to init and alloc simultaneously (a new object is generated). This is known as the Factory Method. Once the framework is imported to Swift, this gets changed to the latter’s built-in Initializer Method – which looks something like this: var myXXXX = UIXXXX (named: “abc.png”). At the time of the change from Factory Method to Initializer Method, the name of the parameters also get slightly modified (for example, imageNamed becomes named).
  7. Generating lower-level dependent frameworks – Another smart way to use Cocoa Touch optimally on the iOS 8 platform. After creating a Universal Framework via the method mentioned above, move to the Build Settings of the target object, and make sure that the ‘Always Search User Paths’ option is turned to ‘YES’. Repeat the procedure in the Build Settings of the test object as well. In the Build Phase of test and target objects, you can include the /lib frameworks to the ‘Link Binaries With Libraries’ section. While testing the app, additional paths might have to be declared in ‘Runpath Search Paths’.
  8. Dot Syntax for calling Methods – For long-time users of Objective-C, getting used to the simpler ‘dot syntax’ methods to call Swift methods might take some time. The process is extremely simple (particularly so if there is a single parameter in the method). A single argument has to be passed for calling the one-parameter method. And what if the method to be called has multiple parameters? The solution is easy enough: developers need to name all (except the first) arguments, and add ‘animated:’ and ‘true’ next to each of them. The ‘dot syntax’ method-calling minimizes the chances of coding errors.
  9. The benefits of Code Completion in Xcode – Intelligent code completion, or just Code Completion, had been present since the early days of Xcode, and on Xcode 6 – the feature is smarter than ever before. For new programmers and iOS app developers in particular, it is only natural to feel a bit confused while porting codes from the Objective-C to the Swift platform. This is where Xcode’s Code Completion comes in handy. Developers do not have to rack their brains too much – they only need to pick the right choice from the available suggestions.
  10. Addition of Frameworks to Embedded Binaries – Even experienced mobile app developers can overlook this. At the time of adding frameworks to an app project in Xcode, coders need to include all the frameworks in ‘Embedded Binaries’ (present in the General section of the target project). Once this is done, they have to ensure that the frameworks have become present in ‘Linked Frameworks And Libraries’. Duplication problems, if any, have to be removed.
  11. Syntax to get Obj-C properties in Swift – Unlike the dual syntax options to access properties in Objective-C (dot syntax or square parentheses), Swift allows only one syntax to access the properties of an Obj-C class (dot syntax). The procedure is roughly similar to calling methods. Developers should note that unless a property in Objective-C has been declared with @property, it won’t be converted to a Swift property. Implicit Getters are, however, imported as straightforward methods in Swift.

Within the same Xcode project, both Swift files and Objective-C files can be present – highlighting the interoperability between the two languages. While making apps for the iOS 8 platform, it is easy to optimally use the resources of Cocoa Touch framework with Swift. Accessing Obj-C codes in a Swift environment (and the other way round) is fairly simple too. iOS app developers can make custom applications with no hassles whatsoever – Apple has almost made sure of that.