AWS vs. Google Cloud- How to Pick the Right One for Your Business in 2021
Priyank Trivedi, in
Priyank TrivediiOS App Developer Guide,iOS App Development,iPhone Mobile Application Development
This tutorial covers the prerequisites needed to develop an iOS app and helps you in setting up a development environment for your project. I am going to explain basic things like what core level files and structure you need while creating your app.
While developing an application for the first time, you might be confused about primary requirements for the development. So, this blog will help beginners and intermediate developers in developing an iOS app development. In this tutorial, I have assumed that you are familiar with the iOS programming language. You do not need to be a master to complete, but you will get more lessons if you comfortably read and understand this.
1. Localization file
iOS users are from different countries and speak different languages, so to deliver a great user experience, you may want to make your app available in multiple languages. You can develop your application in multiple languages using localization. I am describing the type of data that can be stored and how it will be used in development. We can store all static messages, static array and alert of the application.
Localizable.strings(English)
//MARK: - Arrays - "arrGender" = "Male,Female,Other";
//MARK: - Message -"LOGINSUCCESS" = "You have successfully loggedIn";
ViewController.swift
let arrGender = NSLocalizedString("arrGender", comment: "Array Gender").components(separatedBy: ",")
2. TextMessage.swift
If our application is not supporting multiple languages then this file is used to store all static messages and alert of the app. We are using many alert messages for the end user guidance, so, we need to store it in the file called TextMessage.swift.So, if you want to update any message then you need to make changes in this file only. This file will smooth the process of fetching, updating and deleting the messages from an app.
TextMessage.swift
3. Constant.swift
This file is used to store all constant value which can be used in the whole application. It also stores objects of singleton classes.
Constant.swift
4. AppStructure.swift
This file is used to store all enums, structures which will be used in our application. We can store any type of structure in this file as we feel it will be used globally in the project.It stores Structure of:
AppStrcuture.Swift
struct SegueID{ static let SignUpToSignIn = "SignUpToSignIn" static let SingInToForgotPassword = "SingInToForgotPassword" static let MatchesToProfile = "MatchesToProfile"}
ViewController.swift
self.performSegue(withIdentifier: SegueID.MatchesToProfile, sender: nil)
5. Helper.swift
This class is same as a Constant class but it will store methods, which can be used globally in any type of class like UIViewController, NSObject, etc. If the method is only used in View Controller then it's better to store it in BaseViewController.swift (explain later). This method can be called without any instance of the class. We can store method like show alert, show/hide loader, etc.
Helper.Swift
func UIColorFromRGB(_ rgbValue: UInt) -> UIColor{ return UIColor(red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0,green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0,blue: CGFloat(rgbValue & 0x0000FF) / 255.0,alpha: CGFloat(1.0) )}
ViewController.Swift
self.navigationView.backgroundColor = UIColorFromRGB(0x4CAF50)
6. BaseViewController.swift
BaseViewController is a base class for all your custom view controllers. It is a subclass of UIViewController. For all of your view controller, you have to set BaseViewController as a root view controller instead of UIViewController. This will reduce code redundancy in the project. There are many methods that will be used in more than one view controller, that methods should be stored in BaseViewController. The methods which are defined in BaseViewController can be easily accessed without any instance of the class.
In the app there may be a requirement of sending mail from multiple screens. In this case, instead of implementing Mail Delegate methods individually, we can define it in BaseViewController and can use it in many ViewControllers.
BaseViewController.swift
func emailWith(_ strSubject:String,strMessage:String,arrRecipients:[String]){ if MFMailComposeViewController.canSendMail() { let picker: MFMailComposeViewController=MFMailComposeViewController() picker.mailComposeDelegate=self; picker.setSubject(strSubject) picker.setToRecipients(arrEmail) picker.setMessageBody(strMessage,isHTML: false) self.present(picker, animated: true, completion: nil) }}
ViewController.swift
class ViewController: BaseViewController{ var arrString = [String]() arrString.append("aarti@inheritx.com") self.emailWith("This is subject", strMessage:"Check out this", arrRecipients:arrString)}
7. AppTrash.swift
At the time of development, we have commented multiple code blocks which can be used later. That code is not useful right now, but there are chances that it can be used in future. So, instead of storing all commented code in a class, it's a good practice to store it in AppTrash.swift, So we can use it later on when we need. This will make viewcontrollers more clear and readable. We can find it easily and put back it in respective file later on when we require.
8. AppInfo.txt
This file is used to store app information i.e application name, about, version, basic feature, third party classes, custom classes, AppStore link (if an app is live) or any other app related information. This file will other developers to understand the application.
I hope this tutorial has helped you to understand the basic fundamentals of creating apps with iOS platform. If you like this blog, please share it on your social media account and drop your comments below. Feel free to contact us, if you have any query or concern regarding this tutorial.
For reference, you can download the demo project on Github.
Thanks for reading!AWS vs. Google Cloud- How to Pick the Right One for Your Business in 2021
How Indoor Navigation Apps can Address GPS Limitations for Your Business.
Why Node.JS is becoming first choice for Web App Development
Amazon Web Technology
Android Application Development
Angular Application Development
Angular JS Development
App Store Optimization
Database
DevOps
Digital Marketing
Firebase Web Technology
Flutter Application Development
iOS App Developer Guide
iOS App Development
iPhone Mobile Application Development
Mobile
Mobile Application Development
Node JS Development
On-demand App Development
On Demand Mobile Apps
Press Release
React Application Development
Shopify Development
Software Development
Technology
Wearable Application Development
Web Design
Web Development
WordPress Website Development
Xamarin App Development