The best programming blog.

Covering a wide array of programming topics.

SwiftUI Focus specific NavigationLink item in Grid

Below is an example to create a grid filled with colored rectangles in NavigationLink. The goal is to focus on specific NavigationLink item in the grid. Let’s say we want to focus on the orange color navigation item link in the grid. Follow the below code to do the same: With the help of the…More

SwiftUI Argument passed to call that takes no arguments

Error while calling a view and getting this error: Let’s say the error is coming at following line: The reason for that error could be that the UserDetailView has no property defined in its View and the View is like this: The solution is to add the property to the view so that it can…More

SwiftUI error build: Extra argument in call

Let’s say your view is like this: Code while calling the view: If you build your SwiftUI project with the above code wit will give you this error: Extra argument ‘…’ in call. The solution is to replace the let with var in the property for which the error is coming, i.e replace the following…More

Check for GPU access with PyTorch

We can use torch.cuda.is_available to check whether we access for GPU or not with PyTorch. Output will be either true if the access is there; false otherwise.More

How to find pip version installed through terminal

In order to find the version of pip installed on your machine you need to run the following command: The terminal will return the pip version installed on your machine: Above 22.2.2 is the version of pip installed on the machine.More