Here is how to apply UIVisualEffectView & UIBlurEffect to UITableView, UITableViewCell, UICollectionView, UICollectionViewCell, UIView / View in your Apple iOS / iPadOS or macOS Catalyst App.

As Apple describes UIVisualEffectView & UIBlurView in its support document as follows:

Depending on the desired effect, the effect may affect content layered behind the view or content added to the visual effect view’s contentView. Apply a visual effect view to an existing view and then apply a UIBlurEffect or UIVibrancyEffect object to apply a blur or vibrancy effect to the existing view. After you add the visual effect view to the view hierarchy, add any subviews to the contentView property of the visual effect view. Do not add subviews directly to the visual effect view itself.

So in simple words, you don’t have to use Adobe Photoshop to get blur effect and fake superimpose on your UIView rather you can get the same effect programmatically for every situation without any hassle.

Note: If you are using UIVisualEffectsView in your app I would strongly suggest you use a system setting called ‘Reduced Transparency’ to condition code it. If the user doesn’t want transparency or Blur or Vibrancy effect for all of the apps in his iPhone or iPad or Mac he can just do it with a single switch in the settings app. Another note view that you are applying effect should preferably be the Popover View Controller. Another thing is to remember to replace the below blue color with the UIColor of your choice with alpha channel transparency.

For UITableView and UITableViewCell, use following code in your UITableViewController’s viewWillAppear function:

(more…)

Continue Reading Post

Programmatically get iOS, iPadOS, macOS Catalyst Operating System Name and Version and a model identifier of iPhone, iPad, Mac devices.

Programmatically get iOS, iPadOS, macOS Catalyst Operating System Name and Version and a model identifier of iPhone, iPad, Mac devices.

Here is a simple way to programmatically get the operating system name and version of your iOS, iPadOS and macOS.

The below code will also return the value of iPhone, iPad and Mac Model identifier to help you know if it’s MacBook or iMac in Mac’s case or iPhone 11 Pro or iPhone 13 Pro etc.

Step 01: First import IOKit, It is only required for macOS Catalyst app-specific code.

(more…)

Continue Reading Post

Get your Apple iOS (iPhone), iPadOS (iPad) and Mac Catalyst app Version and Build number programmatically.

Here is a small function that I have written that you can use in your iOS, iPadOS or macOS Catalyst app to get your app’s current version and build number and print it on screen whether will on the app’s about or support view.

Function: copy the below function in the Xcode project’s UIViewController Swift class file.

(more…)

Continue Reading Post

Reset the Bluetooth module using the Terminal app on your Mac

Here is the simplest way to reset the Bluetooth module on your mac if you are facing any issue using your Bluetooth mouse (Magic Mouse) or Bluetooth keyboard (Magic Keyboard).

This command will reset Bluetooth on your mac then it will connect back all Bluetooth devices again after the reset.

Step 01: Open the Terminal app from your Mac’s Applications > Utilities folder.

Step 02: Now copy-paste the below command in terminal to reset Bluetooth on your mac

(more…)

Continue Reading Post

How to save your contact’s WhatsApp Profile Photo

A few years ago WhatsApp was allowing WhatsApp Mobile / iPhone / Android and Mac app used to save any contact’s profile photo by clicking on the action sheet button and then tapping save.

But then WhatsApp removed that button.

But somehow one trick works.

Assumption: We assume that you have connected WhatsApp iPhone & Mac apps. You have already added your WhatsApp mac app to your iPhone number by scanning a QR code.

Step 01: Choose any of your WhatsApp contacts.

Step 02: Click on their name or photo at the top header or navigation bar.

(more…)

Continue Reading Post

Let’s learn how to use the ‘Meta Theme Color’ tag to colourise Apple Safari 15 user interface tailored for the website.

Apple Safari has started supporting theme-color Meta Tag from Safari 15 release.

Here is how to Implement theme-color meta tag in HTML.

You have to copy-paste theme-color meta tag in section of your website. It will look something like this:

<head>
<meta name="theme-color" content="#ff0000"/>
</head>

You can use the following code to implement theme color specific to system light mode or dark mode.

<meta name="theme-color" content="#ff0000" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#ff0000" media="(prefers-color-scheme: dark)">
(more…)

Continue Reading Post

Here is how to locate downloaded Audio/Video Podcast app files on macOS? So that you can export or copy it to the new location on Macintosh HD.

You may have been listing to or watching a great podcast on Mac’s Podcast app and you may want to export it and store it elsewhere on your Macintosh HD for safekeeping.

It seems Apple has disabled functionality dragging Podcast items to desktop to store it or export them elsewhere.

So here is how to do it in an alternative way.

Step 01: Click on Finder

(more…)

Continue Reading Post

Let’s learn how to implement WKWebView in Your iOS, iPadOS and macOS Catalyst app

Before we jump into implementing WKWebView I would first introduce you to why you want to use it. WKWebView helps you when you want to load a webpage inside your app without throwing users to a third party browser outside of your app.

Let’s start coding,

Step 01: First Import WebKit

import WebKit

Step 02: Add ‘WKNavigationDelegate’ to your declaration of ViewController Class

WKNavigationDelegate

It will look something like this:

class ViewController: UIViewController, WKNavigationDelegate {
}

Step 03: Now create two variables for loading webView and one for button which will close webView

var webView: WKWebView!
var closeWebViewUIButton = UIButton(type: .system) as UIButton

Step 04: Now naviagte to your ViewDid Load method

override func viewDidLoad() {
super.viewDidLoad()
}

Step 05: Now in your ViewDidLoad method add the following code, Which will load WKWebView. You can change the URL as per your preference.

(more…)

Continue Reading Post

How to fix and repair anything related to iCloud, App Store, Mac App Store if not at all working correctly on Apple iPhone, iPad and Mac with just one simple solution!

After using your Apple Mac, iPhone or iPad for more than 2 to 3 years upgrading the operating system multiple times you may realise after upgrading system some features like iCloud, Mac / App Store App Downloads and Updates, Keychain Sync, Safari Passwords Sync, Contacts Sync are not working across devices.

Precautions:

1. If you are on iPhone and iPad first backup your device using Mac. And also backup your iPhone and iPad photos using Apple Photos.

2. If you are on Mac backup your Mac using TimeMachine

(more…)

Continue Reading Post