How conditional code for and identify device between iOS (iPhone), iPadOS (iPad) & macOS Catalyst (Apple Macintosh)

If you are developing macOS catalyst app then you may be wondering how to conditionally write code specifically for iOS and iPad OS or macOS 10.15 catalyst app.

 
Here is how to do it.

 
Use below code to declare code specifically written and that will compile only for iOS and iPadOS.

Continue reading “How conditional code for and identify device between iOS (iPhone), iPadOS (iPad) & macOS Catalyst (Apple Macintosh)” »

Continue Reading Post

Here is how to set UINavigation Bar Large Title Text Colour (Foreground Colour) in iOS 11, 12, 13 and above

Here is how to set UINavigation Bar Large Title Text Colour (Foreground Colour) in iOS 11, 12, 13 and above,

 
Declare Navigation Bar Title Text & Large Title Settings like this in your View Controller’s ViewDidLoad() Method:

 

self.navigationItem.title = "Home"
self.navigationController?.navigationBar.prefersLargeTitles = true
self.navigationController?.navigationItem.largeTitleDisplayMode = .automatic

 
Now write below line inside ViewDidLoad() to get Large Title Foreground colour as White Colour like this:

Continue reading “Here is how to set UINavigation Bar Large Title Text Colour (Foreground Colour) in iOS 11, 12, 13 and above” »

Continue Reading Post

Choosing between Cloud Storage And Having Multiple Computers i.e. one at home, second at the office and another for being on the move / Tablet or Mobile.

So for the last two-three days, I started preparing for User Experience (UX) Professional Certification from a reputed institute.

 
So I have books from them for the course that I attended, then I have notes collected through websites like nngroup.com & usability.gov that I want to chunk information in short notes & collect them for future reference.

 
So the problem is every material that I collected is in physical paper form, or in digital format on my desktop computer but when I am on the move travelling from office to home or to some other place those notes are always unavailable to me.

 
So what is the solution to this problem?

Continue reading “Choosing between Cloud Storage And Having Multiple Computers i.e. one at home, second at the office and another for being on the move / Tablet or Mobile.” »

Continue Reading Post

How to set up a CloudFlare Flexible SSL Certificate within 5 minutes for your WordPress website’s all subdomains & main domain.

Prerequisite: Please make sure have active CloudFlare account and you have added your WordPress Website to CloudFlare. Also, make sure you are using CloudFlare nameservers for your domain.

 
Step 01: Sign in to your CloudFlare account

 

 
Step 02: Make sure flexible SSL certificate is enabled under the “Crypto” tab for your selected website

 

 

 
Step 03: While you are already signed in to your CloudFlare account go to > My Profile > Scroll down to API Keys and locate Global API Key & copy the same key for further use inside your website.

 

 

Continue reading “How to set up a CloudFlare Flexible SSL Certificate within 5 minutes for your WordPress website’s all subdomains & main domain.” »

Continue Reading Post

Here is how to do UIImageView Image Inset in Apple iOS App using Xcode

Here is example if you want to inset UIImageView so that image does not fit edge to edge of the UIImageView

 
Note: Use of latest version of Xcode & Latest version of Swift Programming Language is preferred.

 
Here is step by step procedure to achieve designed result:

 
Step 01: Create Apple iOS Project in Xcode. Add UIImageView to View Controller in Storyboard.

 
Step 02: Now Connect that UIImageView to View Controller Swift File. It will look something like this.

 

@IBOutlet weak var imageView: UIImageView!

 
Step 03: Now add following code in ViewDidLoad Function of your View Controller File.

Continue reading “Here is how to do UIImageView Image Inset in Apple iOS App using Xcode” »

Continue Reading Post

Here is how to animate Tab bar tab switch with a CrossDissolve slide transition in UITabBarViewController!

While searching for answer on web for how to give CurlUp / CrossDissolve / FlipFromRight / FlipFromLeft / CurlDown / FlipFromTop / FlipFromBottom transition effect for UITabBar Tab Switch.

 
I found out this answer but with bug or black screen when you tap on same tab twice i.e. destination and current tab is same.

 
So I solve this issue with my logic and additional if and else statement.

 
So here is final answer without any bug.

 

Step 01: Add this two classes as Super Class to your UITabBarViewController

 

UITabBarController, UITabBarControllerDelegate

 

Step 02: Now add following code to your viewDidLoad Function in your UITabBarViewController

 

self.delegate = self

Continue reading “Here is how to animate Tab bar tab switch with a CrossDissolve slide transition in UITabBarViewController!” »

Continue Reading Post

Here is how to hide Navigation Bar on Scroll in your Apple iOS App with single line of code!

Assumption: I assume your have embedded in UINavigationBar in your Apple iOS App inside Storyboard.

 
If you want to mimic Apple Safari iOS App’s behaviour of hiding navigation bar on scroll you can do it in just single line of code without any hassle.

 
You have to add following code in your View Controller’s viewDidAppear function where you have added UINavigationBar in storyboard:

Continue reading “Here is how to hide Navigation Bar on Scroll in your Apple iOS App with single line of code!” »

Continue Reading Post

Here is how to programatically change UITabBar Tint Color, UITabBar Item Tint Color & also how to change UITabBar Item’s unselected icon tint color.

Assumption: I assume you have deployed UITabBarViewController in your iOS App. And now you want to change UITabBar Tint color, UITabBar Item’s Tint color and also UITabBar’s unselected icon’s tint color.

 
Do this is just simple as single line of code.

 
Below code will go to your Apple iOS app’s AppDelegate.swift file under ‘didFinishLaunchingWithOptions’ function.

 
So your code will look something like this.

Continue reading “Here is how to programatically change UITabBar Tint Color, UITabBar Item Tint Color & also how to change UITabBar Item’s unselected icon tint color.” »

Continue Reading Post

Here is how to programmatically set icon / image for Tab Bar Item in UITabBarViewController

Assumptions: I assume you have already embedded in UITabBarViewController for your ViewController in Interface Builder. I also assume you have three tab bar items with individual view controllers and further you have created images assets with your icon images.

 
Solution is simple you have to copy following code in your current View Controller’s ViewdidLoad method.

Continue reading “Here is how to programmatically set icon / image for Tab Bar Item in UITabBarViewController” »

Continue Reading Post