All posts by kashif

Action Sheet issue on iPad – Swift iOS Programming

Error Got in XCode 7 while using Swift2.x:

Terminating app due to uncaught exception ‘NSGenericException’, reason: ‘Your application has presented a UIAlertController () of style UIAlertControllerStyleActionSheet. The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller’s popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the alert controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.’

Reason:

I faced above error on iPad while application was working fine on the iPhone. Client complained when he clicked the option to upload an image, application crashed.

Information from client was sufficient to help me debug where exactly the issue can be. On click to upload image, my application has options to select source of image, either use camera to click a photo or use phone’s library to select an existing image. So show these options, I was using ‘UIAlertController‘ and parameter of ‘PreferredStyle‘ was selected as ‘ActionSheet‘. It was new for me to know ‘ActionSheet’ was causing error in iPad and it caused application to crash.

Fix:

I changed the parameter value of ‘preferredStyle‘ to ‘UIAlertControllerStyle.Alert‘ and it fixed the error that was caused by ‘UIAlertControllerStyle.ActionSheet‘.

I hope this will help someone to fix the ipad issue. If there is some other reason for your app to crash on ipad or iphone or you want to write something about this post, please write in the comments.

Why a business needs mobile application

“Why do I need Mobile Application for my Business?” is the question before we discuss about what exactly a business
person should be expecting while investing on a mobile app. As subject is wide enough to analyse for businesses in general, we are specific to a restaurant business in this post.

  • Products at restaurant are supposed to be prepared and delivered within very short time. So, a real-time response to user’s enquiry is very important for restaurants.
  • Second important point is, customer’s urge to find and experience new food every time.

Both of the above things make the reason for having a mobile application for restaurants:

  •  Mobile app doesn’t make your food more delicious but it brings loyalty:

Before investing on the technology, we must accept a fact, it is just a helper and not the core product. If a customer likes the experience of having meal at your restaurant, Technology can play its role to convert it to a loyal customer.
Considering the fact that there are too many options available when it comes to restaurants, having an icon in mobile phone will remind them of your service and this will stand out of the crowd.
So, it will increase the possibility of a customer being loyal.

  •  Being available when needed:

Ordering a food is not something that we always plan before time. It is more like, I am feeling hungry, what we can have at the moment. Considering the fact that we are getting more and more busy in our day-to-day life, being available at finger tips makes it always the first choice to order the food.
So having a mobile application will make it a step closer to be the first choice.

  •  Presence at mobile medium:

Marketing is great important in modern world. Having presence in mobile medium and using mobile app for more ideas implementation to market your services will make it worth spending on mobile application development.

  •  Location based offers:
    With the mobile phone, application can get the actual location of user and offer services based on user’s location.
  •  Some Facts:

According to TechCrunch, in 2014-2015 food delivery industry was the most attractive for venture capital. More than $1 billion of investments were allocated in 2014 and more than 4 – in 2015. A huge number of existing players in 2015 have turned to food delivery app development, either hybrid or cross platform. Despite the tough competition, the market is not yet saturated and there’s place for fresh players.

Next article will be about what a restaurant owner should be looking for in a mobile app.