Thursday 17 August 2017

Reusable class for UI controls on iOS

Introduction

Most of the UI controls are usually provided by Apple while developing an app. Depending up on the requirements, it is common to change the default behavior and design of a UI control to create an app with uniform look and feel.
It is not only tedious but a bad practice to design/alter each control separately. Moreover, the process of altering each control not only time-consuming and cost-intensive but often prone to human error which could cause all sorts of compatibility problems with any other interdependent apps or systems.
Suggested option is to create a separate class which will override/extend the default settings. And this class can be used for changing the properties of similar controls across the app.

Prerequisites

Following are the prerequisites that a developer needs to build a reusable class:
  • Apple Mac.
  • Xcode.
  • Simulator

Let’s get started

Create a new project in XCode -> File -> New -> Project…

Select “Single View Application” as a template for your project and click on Next.

Type the name of the project. For this demo, let’s name it as “ReusableUIControlDemo” and then select the language as Swift and click on Next button.

Once the project is created, it will look like below

Add two buttons and name them as “Left” and “Right”. You can add as many as you want.
Create a new folder called “Helper”.
Right click on the project folder and select “New Group”.

After creating the Helper folder, add a class file to it. To do this right click on the Helper folder and select “New File…”.

Click on iOS tab and select “Cocoa Touch Class” under source section and then click on Next button.
Enter the name of the class file. We named it as “CustomButtonUI”.

Click on Create button.

Once the file is created, it will look like the image below :
UIControls_07























Add the below code in the file “CustomButtonUI.swift”.
Now click on the button you want to apply the styles to. Click on the class dropdown and then select CustomButtonUI class.
Run the project and check its output in the simulator.
Notice that the Left button’s appearance is drastically different from its counterpart: Right.
To apply the same style on the right button,  click on “Right” and in storyboard and select the class “CustomButtonUI” from drop-down.
Run the project in Simulator and the resulting output will have two buttons that are exactly similar.

Conclusion

With continuous evolving of technologies, the mobile app developers need to maintain a quick pace to keep up with the user requirements to create apps which will work on multiple devices and operating systems.
Developing an app needs proper planning in its initial stage and it is a good practice to have  generic classes. This helps in achieving not only the code re-usage but also saves development time as well.  Since the UI of an app plays a key role in UX, it is always better to have reusable classes to alter the UI appearance quickly, which is a simple yet powerful way and can be done with in a fraction of time and cost when compared to changing the whole source code or structure.
This technique can also be applied to other controls such as labels, switch, sliders, views and so on.

Tips to sail through App Store review process

Introduction

We all might have gone through a situation at some point in Apple’s review process, where our app consistently gets rejected. You would have also thought that it is difficult to get approval for new apps. But it is very simple to get the approval if we abide by the review guidelines.
We have been in your shoes with the review process. With the experience we’ve gained over time on Apple’s review process, we’ve cracked the key to get an app reviewed and approved for listing in the Apple App Store. Compiled are the list of things you can do to reduce the review time, which have helped us immensely for the successful approval of our apps in a single go.
Good news is that Apple has reduced review process time. Usually the review time varies from app to app. On an average, 50% of the apps are reviewed in 24 hours and over 90% are reviewed in 48 hours.
“A shorter approval cycle” lets the developers to properly plan their app’s release.

Prerequisites

Below are the prerequisites.
• Apple mac.
• Xcode.
• Apple developer account.

Lets get started

Before pushing an app to App Store make sure that the app is created in iTunes connect.
For more info : https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/CreatingiTunesConnectRecord.html
Make sure that all the points listed below are checked, before submitting for the review.

App should never crash

There is a fair chance of an app crashing during the review process. So it is a must that you perform proper unit testing on the device and ensure that it works without any crashes.
Here is a quick way to prepare an IPA file using distribution profile and upload it to diawi.com. It will generate a link for downloading the app, just like a Beta App Store link. Install it and check if everything is working fine.

Don’t leave Info.plist description field empty

Every app and plug-in uses an Info.plist file in Apple ecosystem. This is to store configuration data from where the system can easily access it. MacOS and iOS uses Info.plist files to determine things like “what icon is to be displayed for a bundle”, “why do the app needs to use Bluetooth”, “what document types are supported by the app”, “what background services are enabled” and many other behaviors which have an impact outside the bundle itself.
In info.plist file, it is compulsory to add text in key descriptions fields as we have to show actual reasons to use certain services.
For ex : NSPhotoLibraryUsageDescription, NSLocationWhenInUseUsageDescription etc.
Whenever the user wants to access the camera, photo, GPS or any other services, the app must show a valid message for which the service is required.

Use App loader instead of Xcode for pushing app

Application Loader is another tool which helps you in uploading IPA files to iTunes Connect. It is mainly helpful if your app includes in-app purchase products that need to be configured. Use App Loader for pushing IPA file instead of Xcode. Because App Loader shows all the activities happening behind the scene while pushing to App Store.

Proper Metadata

Always use proper grammar when writing the app details. Apple reviewer should get all the information related to app. So it is highly recommended that the app information and metadata is complete and accurate.
Don’t include names, icons, or images of other mobile platforms (Android, Blackberry, Nokia, Windows) in your app metadata, unless there is a relevant connection between them.
True story: Apple rejected our app when we had mentioned ‘We do have same app supported in Android also’.

Don’t submit Beta state app

Apple states that “Please don’t treat App Review as a software testing service. We will reject incomplete app bundles and binaries that crash or exhibit obvious technical problems”. So, if an app is in beta state, submit it to Apple’s Testflight(beta test) only for internal and external testing. To maintain the quality of the App Store, they accept only completely working and fully operational apps.

64bit support

In October 2014, Apple has announced that all new apps created after February 1, 2015, must have 64-bit support. Any 32-bit apps submitted to Apple’s App Store after June 2015 are rejected.
In future, all iOS apps will only support 64bit. So make sure that your app supports 64bit architecture, as Apple is accepting 64-bit supported apps.
Visit below link to convert your app to 64bit. https://developer.apple.com/library/content/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html

Demo account for apple reviewer

If your app has an authentication for login, make sure you have a demo account ready. The Apple reviewer will need the demo account information to verify all the basic features of the app. Make sure the credentials are correct and working.

YouTube demo video

There is nothing better than giving a demo of the app in a video. The Apple reviewer will be happy to see the demo video of the app. It gives them a clear understanding of the app. Record the video with “QuickTime” player or any other tool of your choice and upload it to YouTube. Place the YouTube link in the “Notes” field under “App Review Information” section.

Pushing app with Beta Xcode

Beta Xcode’s should not be used to push apps to App Store, they will reject if you are trying to build or submit an app using beta versions of Xcode. Since the iOS beta version is not yet released for general public, Apple does not allow you to submit apps compiled under beta version of Xcode, therefore bundle will be “invalid”.
           

IPv6 support

By default, most Xcode will support the IPv6 protocol, but if your app doesn’t support it, then it might get rejected.
As mentioned by Apple,
“At WWDC 2015 we announced the transition to IPv6-only network services in iOS 9. Starting June 1, 2016, all apps submitted to the App Store must support IPv6-only networking. Most apps will not require any changes because IPv6 is already supported by NSURLSession and CFNetwork APIs.”
If your app uses IPv4- based APIs or hard-coded IP addresses, you need to modify it, such that it supports IPv6. For more information visit https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW16

Screenshots should match with app

The screenshots uploaded for the App Store should match with the app’s screens. If there are any changes in UI, then new screenshots should be updated before submitting for review. Make sure to upload the largest screen size images for iPhone( ex. iPhone 7 plus). App Store will resize for smaller device automatically.

Avoid over battery usage

If the app has battery intensive features like location tracking, keeping screen always ON, Bluetooth and etc, add a short descriptive message to get confirmation from users with a statement
For ex. “This app uses continuous GPS monitoring, it may drain your phone’s battery. Do you want to proceed?”
This gives user a pre-warning about consequences of using such features. Based on the Apple guidelines, they always try to help users to have a better user experience and improved performance .

Device compatibility

App store will reject the app when it is not running/supporting the iPad device. Even though if the app is only for iPhone devices, it should support iPad device through “1X” or “2X” mode.

Test Data should be scrubbed

Apps which have the features for test or trial purposes are not permitted in the App Store. If the test data is seen inside app screen, even if it’s in the screenshots of the meta data, your app might not get approved. Overlooking these details is a surefire way to have your app rejected.

Conclusion

These guidelines may look like a lot of work, but if you take care of these points while submitting your app, then you definitely will have a better chance of getting approved faster.
For more information visit below link.
https://developer.apple.com/app-store/review/guidelines/

Voice of the Customer (VOC) – Dynamics 365 CRM

Tags:   Dynamics 365   Dynamics CRM   feedback   survey   VOC   Voice of customer Introduction To Voice of the Customer For any bus...