Nitish Kumar

In this short article we will see how to add activity indicator on top of UITableView.

For that, you have to create one tableView programmatically or using storyboard.

Step 1: Create one refresh control

// creating UIRefreshControl
lazy
var refreshControl: UIRefreshControl = {
let refreshControl = UIRefreshControl()// Add target for UIRefreshControlrefreshControl.addTarget(self, action: #selector(handleRefresh(_:)), for: UIControl.Event.valueChanged)// set tintColor for UIRefreshControlrefreshControl.tintColor = UIColor.greenreturn refreshControl}()@objc func handleRefresh(_ refreshControl: UIRefreshControl) {// do your refreshing partrefreshControl.endRefreshing()}

Step 2: Add UIRefreshControl in tableview

myTableView.addSubview(refreshControl)

Done😇😇😇

Hope you enjoyed reading this post!!

If you have any comment, question, or recommendation, feel free to post them in the comment section below!

Thank you!!! Happy coding.

--

--

In this small article we will see how to present a SwiftUI view as sheet and fullscreen.

Create one bool variable:

@State var show = false

To present view as fullscreen :

Button(action: {print(“Forgot tapped!”)self.show = true}) {Text(“Forgot Password?”).foregroundColor(Color(UIColor.PrimaryColor.MainColor)).fullScreenCover(isPresented: $show, content: {Home()})

--

--

In this article, we will UIImagePickerController to get image from camera or gallery by following three simple steps:

Lets start,

Step 1 : Add ImagePickerManager

Create a swift file and add the below code and save in your project. We are creating a new swift file because we want our view controller clean.

Step 2: Add permission in Plist

Now…

--

--

In this article, we will create Underline segment control programmatically in 2 simple steps:

Step 1: Add extension in project.

Add both extensions (UIImage,SegmentControl) in your project.

Step 2: Add functions in view controller.

Add below functions in view controller and call CreateSegment() in viewdidload().

Boom💥 Boom💥

Hope…

--

--

In this article we will learn device orientation issue and how to resolve that.

In case, if your device orientation change while dismissing view controller and you already settled your orientation as given below image but still not working.

--

--

In this story, we will use Tab bar without storyboard, if you want to use Tab bar with storyboard. Then, you can check my previous story.

https://nitishrajput912.medium.com/tabbar-ios-swift-174779aff6d2

First we have to create a UITabBarController (line no. 2) after that we will create a function to add view controller in tab bar.

Hope you enjoyed reading this post!!

If you have any comment, question, or recommendation, feel free to post them in the comment section below!

Thank you!!! Happy coding.

--

--

Nitish Kumar

Nitish Kumar

I developed and maintain applications aimed at a range of iOS devices including mobile phones and tablet computers.