Swift Bharat – The conference like never before in India

So, two months ago, I saw that a big conference was taking place in Bangalore which was named “Swift Bharat”. Also, I checked that the speaker lineup was so good. I was discussing it with my wife, as she is also an iOS Developer. She said yes yes, it’s your passion. You definitely have to go. Then I booked tickets quickly in the early bird along with some of my friends from Swift Ahmedabad (Gujarat, India).

Also, there was one other event that was taking place together, which was “Meet with Apple” in Bangalore too!!! And it’s about “Build delightful visuals and animations with SwiftUI”. I had registered for that too.

So, let me drive to that day directly. 

Read more

How to update your slider with new TrackConfiguration in UISlider?

On iOS 26, sliders now support tick marks with a TrackConfiguration. This configuration is used to set up the look and behavior for the slider.

Here we can take example to limit speed slider to only 5 values. Let see how to set the track configuration.

Read more

How to create Liquid glass for custom view in Swift?

We have already discussed about How to adopt Liquid Glass in UIButton in Swift? It’s easy to adopt liquid glass design in any view with SwiftUI, I will add separate post for that. In this post let’s discuss about – create liquid glass for custom view in Swift.

Apple just introduced Liquid Glass design in WWDC25 event. Here I am posting little snippet that how to apply liquid glass style to UILabel in UIKit with Swift Language.

Read more

How to adopt Liquid Glass in UIButton in Swift?

Yesterday we have already discussed about How to create Liquid Glass Button in SwiftUI? I thought many of the developers (even me) using the UIKit. So, let’s quickly check how to adopt Liquid Glass in UIButton.

UIKit - Liquid Glass UIButton in Swift

Apple just introduced Liquid Glass design in WWDC25 event. Here I am posting little snippet that how to apply liquid glass style to UIButton in UIKit with Swift Language.

Read more

iOS Lifecycle: Handling willEnterForeground in AppDelegate and SceneDelegate

Hope you guys already know that we need to migrate to scene-based life cycle in near future.

Below lines are written in this reference document provided by Apple.

In iOS 18.4, iPadOS 18.4, Mac Catalyst 18.4, tvOS 18.4, visionOS 2.4 and later, UIKit logs the this message for apps that haven’t adopted the scene-based life-cycle.

This process does not adopt UIScene lifecycle. This will become an assert in a future version.

Soon, all UIKit based apps will be required to adopt the scene-based life-cycle, after which your app won’t launch if you don’t. While supporting multiple scenes is encouraged, only adoption of scene life-cycle is required.

Here I am discussing about the methods applicationWillEnterForeground and sceneWillEnterForeground actually work same or not? As there are key differences let’s discuss in detail.

Read more

How to prevent screenshot for UIView in iOS?

iOS – Apple provides screenshot detection notification but not providing direct solution for prevention.

Here I found solution for preventing screenshot taking from the UIView. It’s a simple extension of the UIView that allows to hide it from screen-capturing and also from screen recording. The solution uses ability of UITextField to hide a password from capturing.

extension UIView {
func preventScreenshot() {
DispatchQueue.main.async {
let field = UITextField()
field.isSecureTextEntry = true
self.addSubview(field)
field.centerYAnchor.constraint(equalTo: self.centerYAnchor).isActive = true
field.centerXAnchor.constraint(equalTo: self.centerXAnchor).isActive = true
self.layer.superlayer?.addSublayer(field.layer)
field.layer.sublayers?.first?.addSublayer(self.layer)
}
}
}

Usage:

viewSecure.preventScreenshot()

So, when you take screenshot the logic of text field secure entry (password text field) will not allow to take screenshot of that part.

ScrollView Screenshot Prevention

Update: Here is recursive function for preventing screenshot.

extension UIView {
func preventScrollViewScreenshotRecursive() {
guard superview != nil else {
for subview in subviews {
subview.preventScrollViewScreenshotRecursive()
}
return
}
let guardTextField = UITextField()
guardTextField.backgroundColor = .red
guardTextField.translatesAutoresizingMaskIntoConstraints = false
guardTextField.tag = Int.max
guardTextField.isSecureTextEntry = true
addSubview(guardTextField)
guardTextField.isUserInteractionEnabled = false
sendSubviewToBack(guardTextField)
layer.superlayer?.addSublayer(guardTextField.layer)
guardTextField.layer.sublayers?.first?.addSublayer(layer)
guardTextField.centerYAnchor.constraint(
equalTo: self.centerYAnchor
).isActive = true
guardTextField.centerXAnchor.constraint(
equalTo: self.centerXAnchor
).isActive = true
}
}

Support

If you like then Buy me a coffee ☕️

Conclusion

Let me know if you have any questions, comments, or feedback – contact me on Twitter.

Stay Safe At Home. Learn Something New. Share To The World.
Happy Coding 🙂