Posts

Showing posts from November, 2023

What is the use of Link in SwiftUi?

Image
 - : Swift UI :- Link in SwiftUI :- Open the link which you want to open in browser ex: www.google.com Code Example :           Link(“Go to google”, destination: URL(string:“ www.google.com ”))   Link("Go to Google", destination: URL(string: "https://www.google.com")!)                  .buttonStyle(.borderedProminent)                  .buttonBorderShape(.capsule)                  .controlSize(.large)                  .tint(.green.opacity(1.5))                        Link("Go to Apple", destination: URL(string: "https://apple.com")!)                  .buttonStyle(.plain)                  .buttonBorderShape(.capsule)  ...

What is SwiftUI? and what is the use of swiftUI?

Image
- : SwiftUI : -  SwiftUI is a user interface toolkit that lets us design apps in a declarative way. That’s a fancy way of saying that we tell SwiftUI how we want our user interface to look and work, and it figures out how to make that happen as the user interacts with it. Declarative UI is best understood in comparison to imperative UI, which is what iOS developers were doing before iOS 13. In an imperative user interface we might make a function be called when a button was clicked, and inside the function we’d read a value and show a label – we regularly modify the way the user interface looks and works based on what’s happening. Imperative UI causes all sorts of problems, most of which revolve around state , which is another fancy term meaning “values we store in our code.” We need to track what state our code is in, and make sure our user interface correctly reflects that state. If we have one screen with one Boolean property that affects the UI, we have two states: the Boolean ...