I have started learning SwiftUI during the pandemic lockdown. SwiftUI was comparatively easy and challenging for me due to its declarative nature of development. Initially, I have concentrated on the fundamentals of SwiftUI and spent more time playing with the learned concepts in Xcode.
Later, I have decided to develop a complete working app using SwiftUI to monitor my workouts progress which I’m using in my daily routine. I have posted many videos and blogs based on the experience and learnings from the app.
I was developing the app in private for my personal use. Later, I have decided to…
I know that I’m late to the party 😅. Probably you might have heard what are widgets in
iOS 14 and their use cases. I have started developing an app for personal use using
SwiftUI to track my workout progress. I have started it as learning, and later I have added more features because I use the app on a daily basis.
I check my workout summary on a weekly basis to see how much time I have spent and which body parts particularly. Here is the screen of the workout summary widget:
Apple has released major updates to the SwiftUI framework at WWDC20. We might need to show visual feedback to the user about what’s happening and the progress of the tasks like uploading or downloading a file or fetching data from the server. Earlier we were depending on
UIViewRepresentable to import and use
UIActivityIndicatorView from UIKit in SwiftUI or on custom implementation using solid shapes.
With the latest updates in SwiftUI, we have a dedicated native view for showing determinate and indeterminate progress in the SwiftUI app:
I was looking for the latest UI and UX design trends in dribble, and I heard of a concept often called neumorphism.
Design communities believe it to be 2020’s design trend, one which mimics a real-world feel in UI components. You can get plenty of design templates and references on dribble.
Explaining what neumorphism is and its history is beyond the scope of this article. You can learn more about neumorphism in “Neumorphism in User Interfaces,” “Skeuomorphism / Neumorphism UI Trend,” and “Neumorphism. The Next Big Thing In UI Design?”
Okay, let’s get started and see how you can implement…
Creating an intuitive animation is very simple and efficient in Apple’s brand new framework, SwiftUI. Before getting started, check out the video below to get to know what we are about to discuss.
In the above video, you saw five simple activity animations using different inbuilt solid shapes in SwiftUI.
In SwiftUI, we can add animation to view animatable properties using .animation() modifier. There are the list of animatable properties in a view, like:
You should apply any one of the animatable properties to your view to get an animation effect using the
You might have declared static properties or functions in your type (class or structs) to organize the type-specific data for better readability.
Static properties belong to the type itself rather than an instance of the type, which means you no need to create an instance of the type to access the static properties. Check below code snippet for the example.
I have declared a ContentView and its static property names. I have accessed it directly from it type ContentView rather than an instance of the ContentView() and used it in my List to show it in UI.
SwiftUI has a number of property wrappers for different purposes to make developers’ lives easier. I would like to share some notes about these wrappers. Let’s get started.
SwiftUI is a wonderful announcement from WWDC19. As SwiftUI is a framework that is less than one year old, we don’t have rich declarative APIs for a lot of basic needs like picking an image from the photo library or camera, maps, etc.
As Apple always provides multiple options to achieve our needs in one way or another, we do have a few things in SwiftUI to integrate our existing
UIViewControllers from UIKit with SwiftUI.
UIViewRepresentableprotocol is used to integrate UIKit views with SwiftUI.
UIViewControllerRepresentableprotocol is used…
UIKit developers may have heard of the term View Life Cycle methods. Okay, if you are a UIKit developer, let me ask a few questions before we dig into the topic.
Can you please list all the view cycle methods in ViewController without touching Xcode now?
Also, can you please list the view cycle method when navigating between two ViewControllers, with the correct order? 😅
Okay, if you got the above questions correct, this will be easy for you. Can you please list the same thing when presenting a ViewController as PageSheet or FormSheet on iPad?
Little complicated, right! …
Apple keeps on adding changes to the Xcode and simulators to make development ease. The changes might be something major like push notification support in the simulator or minor like capturing a screenshot.
Saves screenshot in Mac
You might have used Cmd + S in the simulator for saving the current frame buffer as a screenshot, which will be saved in your Desktop by default. Apple just renamed it as Save screen for better readability and usability.
Use Option + Cmd + S to save screenshot in different location