Mandar Apte

UI/UX Designer from Mumbai, Maharashtra, India.

Articles

  • Change < Back button text of iOS or iPadOS App.

    While we use app development methodologies like MVC (Model, View, Controller), we encounter problems navigating from one view to another. How do you change the text of the back button, which gets populated automatically by the Apple iOS operating system?

    You can use the below method in the viewDidLoad method of your root view:

    navigationItem.backBarButtonItem = UIBarButtonItem(title: "Back", style: .plain, target: nil, action: nil)
    

    Here is another way of doing the same, which can be done in the ‘prepare for segue’ method of your app:

    (more…)
  • Identify whether a user is on an iPhone or iPad and whether the device is in portrait or landscape mode.

    We will explore ways to identify the user’s iPad or iPhone device. With the latest Xcode build, we will do all this in Swift Programming Language.

    iOS devices will be identified in four ways: .phone, .pad, .tv & .unspecified.

    So the code will look like this in swift

    Code for iOS 13, iPadOS 13, macOS 10.15 Catalyst and above:

    if UIDevice.current.userInterfaceIdiom == .phone {
    
    } else if UIDevice.current.userInterfaceIdiom == .pad {
    
    } else if UIDevice.current.userInterfaceIdiom == .carPlay {
    
    } else if UIDevice.current.userInterfaceIdiom == .tv {
    
    } else if UIDevice.current.userInterfaceIdiom == .unspecified {
    
    }
    

    Code for iOS 12 and below:

    if (UIScreen.main.traitCollection.userInterfaceIdiom == UIUserInterfaceIdiom.pad) {
        print("It's iPad")
        // Your code here
    
    } else if (UIScreen.main.traitCollection.userInterfaceIdiom == UIUserInterfaceIdiom.phone) {
        print("It's iPhone")
        // Your code here
    
    } else if (UIScreen.main.traitCollection.userInterfaceIdiom == UIUserInterfaceIdiom.tv) {
        print("It's Apple TV")
        // Your code here
    
    } else if (UIScreen.main.traitCollection.userInterfaceIdiom == UIUserInterfaceIdiom.unspecified) {
        print("It's Unknown Device")
        // Your code here
    
    }
    
    (more…)
  • Using SKStoreReviewController API to prompt users to write reviews for your App.

    Introduction to StoreKit and Apple App Store policies

    I will write down a few concepts & ideas to help you understand how to implement StoreKit app review functionality in your app using Xcode.

    Important Points to Remember

    You can ask your users to rate your app on a scale of 1 to 5 stars. Users can also choose to write reviews for iOS and macOS apps.

    Developers can view, sort and respond to reviews in iTunes Connect.

    About Summery of Ratings

    Every App Store app has one summary rating on the product page, specific to each territory on the App Store.

    The developer can reset your app’s summary rating by releasing a new version of the app.

    The right way to ask for Ratings and Reviews

    The developer can ask users to rate and review your app when they are most likely to feel satisfied, such as when they have completed an action, level, or task.

    This will give users an easy way to provide feedback on the App Store without leaving your app.

    The developer can prompt for rating a maximum of three times in 365 days.

    Users will submit a rating through the standardised prompt.

    Presenting the Review Prompt

    Although you should call this method when it makes sense in the user experience flow of your app, the actual display of a rating/review request view is governed by App Store policy. In addition, because this method may or may not present an alert, it’s not appropriate to call it in response to a button tap or other user action.

    When you call this method in development mode, the review request view is always displayed so that you can test your app on your device. However, this method will not be called when distributing your app using TestFlight.

    When you call this method in your App Store-published app, a review request view will be presented, and the operating system will handle the entire presentation process.

    (more…)
  • My success story of being fat to fit in 4 months by walking almost 2,000 kilometres in 4 months & 30 kilometres daily…!!!

    My success story of being fat to fit in 4 months by walking almost 2,000 kilometres in 4 months & 30 kilometres daily…!!!

    A few things to clarify this blog post is all about my health; I was at my peak health condition in the year 2001 / 04. That was my college years when I was doing bodybuilding, weight lifting & 12 kilometres of walking daily. But I had one bad habit: eating 100 grams of Jalebi’s daily. If you don’t know what Jalebi is, it is 90% Sugar & 10% of Maida, i.e. Wheat Flour approx.

    But then, after my post-graduation, I got a job in an IT Company as a Graphic Designer. By that time, all my exercises were stopped. I had almost two spoons of added sugar milk coffee five times daily. Then some food at 4 pm to be exact. So it was a very unhealthy lifestyle period in my life.

    I gained weight from 75 kilograms to 108 kilograms, from fit to fat, in 5 years.

    So after 3 to 4 jobs in 2016, I got tremendous back pain, so that was my realisation point: I should do something about my health. I also got advice from relatives that stop doing the job and concentrate on my health first.

    So on 1st January 2017, I started walking again daily for 2 hours, approximately 15 kilometres at a stretch. I started maintaining my daily diary of walk routines which I have been doing for the last six years. Nothing new but from 22nd February I started walking 2 hours twice daily, i.e. 4 hours & 30 kilometres daily. Till today 14th May 2017.

    (more…)
  • Colour Behaviour Study of Japan / True Black on Real Life Physical Paper & on Computer Displays or Screens

    I am now documenting some thoughts about black colour behaviour on Physical Paper & computer displays or screens.

    I was from a BFA (Bachelor of Fine Arts) – Applied Art background, so we had subjects like Illustration, Calligraphy, Typography, Print Media Design, Logo & Symbol Design, Branding & Identity Design.

    We used to design our assignments using Japan Black ink which is very dark in contrast & which creates high contrast reach feeling of black colour tone on white paper.

    So when we print our designs in Adobe Illustrator or CorelDraw, we fill the design with (CMYK) Cyan: 100%, Magenta: 100%, Yellow: 100%, K(Black): 100%, then using only K: 100%. These CMYK values use to create high-contrast Japan Black ink fill on White Paper.

    (more…)
  • Chapter 05: Dictionary in Swift

    What is a Dictionary?
    The Dictionary is an unordered List that can be quickly accessed by key

    Here is how you can declare an Empty Dictionary

    var emptyDictionary = [String : Int]()
    

    Dictionary with Predefined Key Pairs

    var apps = ["Productivity" : "Keynote", "Social" : "Facebook", "Music" : "iTunes"]
    

    Accessing the First Key Element of the Dictionary

    var optionalApp = apps["Productivity"] // Keynote
    
    (more…)
  • Chapter 04: Array in Swift

    What is an Array?
    An array is an ordered list with indices / Index.
    Examples of an array are a to-do list, shopping list, Amazon Wish List, etc.

    Let’s say we have an array list of apps

    Index:
    0 1 2 3

    Element:
    “Reminders” “Mail” “Xcode” “Calendar”

    Important Note:
    The index of the first element always starts with zero because the way computer scientists deal with data in memory, they have offset & offset starts with zero & that’s why the Array begins with zero. The index of an array never exceeds the number of elements.

    Here is how to declare an Array in Swift:
    We will declare an array with the let or var keyword, the identifier name, the equal sign, and square brackets. A comma separates each element.

    var apps = ["Reminders", "Mail", "Xcode", "Calendar"] // Array of Strings, Each element is of Type String
    var number = [1, 2, 300, 4000] // Array of Integers, Each element is of Type Integer
    var bools = [true, false, false, true] // Array of Boolean values, Each element is of Type Bool
    var groups = [["John", "Tom", "Steve"], ["Brandon", "Bill"]] // Array inside array
    
    (more…)
  • Chapter 03: String in Swift

    All About String in Swift Programming Language

    Let’s know what String is. String is a collection of characters

    Here is how to declare a String

    var courseName = "iOS Development"
    var language = "Swift"
    

    Here is how to use functions like String Concatenation, i.e. attaching one String to a second string

    var hello = "Hello, "
    let world = "World! "
    let sentence = hello + world + "This is iOS Development" // "Hello, world! This is iOS Development"
    

    Important Note:
    As you can see above, we have used the ‘+’ operator to concatenate two strings together

    (more…)
  • Chapter 02: Variables & Constants in Swift

    Data Types in Swift Language

    Integers i.e. Int:
    1, 2, 3, 199, 1000
    Float & Doubles:
    3.14, 1.168, M_PI
    Boolean Values like Bool:
    true or false
    Collection of Characters like Strings:
    “iOS Development”, “Apple”, “1.2”

    We can create our data type using the keywords Struct & Class.

    All About Variables

    Here is how we declare Variables in Swift:
    First, we start with the ‘var’ keyword, then ‘Identifier Name’ & ‘Initial Value.’

    Here is how to Declare Integer values: Int

    var thisYear = 2017
    var ourAge = 20
    

    Here is how to Declare Empty Integer

    var emptyInteger = Int()
    

    Here is how to Declare a String

    var courseName = "iOS Development"
    var language = "Swift"
    var software = "Xcode"
    
    (more…)
  • Chapter 01: Let’s Learn Swift Programming Language

    About Swift

    Swift Programming Language is a new sensation, something happening, or the next paradigm in the computer programming world. Apple introduced Swift at WWDC, Apple’s World Wide Developer Conference, in 2014. Apple declared Swift an Open-Source Programming Language on December 3, 2015.

    Swift is getting a warm welcome from the development community as a breath of fresh air for their daily programming job.

    Swift natively supports Unicode Characters, Emojis, and Asian Languages like Devanagari Characters & Chinese Characters. Which was lacking in 30-year-old programming Languages like C & Objective-C

    Here is what others say about Swift Programming Language from Apple to Wikipedia.

    (more…)