Dec 21, 2021 swiftui

SwiftUI or StoryBoard what to choose

Today most of the iOS developer are confused on picking SwiftUI or storyboard. Most of the developer are familiar with Interface builder which is known as storyboard which usually uses the XIB . We hope to give the comparision between…

Nov 26, 2021 iOS

What is View Controller ? What is its lifecycle?

What is View Controller Life cycle in swift? Ans: View Controller Life cycle swift : View Controllers (VC) are the Controller part of the MVC(Model View Controller) triangle. They are responsible for controlling the view. Every time you want to…

Sep 20, 2021 interview

What is Core Data with Swift Interview Question

 What is Core Data in Swift ? Core Data Stack Core data with swift uses SqLite as  local DataBase Storage in iOS. it is the frameWork used to save, modify and track the data within our application. Core data allows…

Aug 28, 2021 interview

iOS push notification interview questions and Answers

Apple Push Notifications Interview Questions and Answers Here are the apple push notification interview questions for fresher and experience candidate.voip push notifications ios What is NSNotification?   An Object Which Contains information broadcast to registered observers that bridges to the notification.…

Aug 28, 2021 interview

iOS interview Questions swift and Answer : Part 3

 Technical swift interview Question and Answer for iOS developer: Part 3 iOS interview Questions swift and Answer for experience and fresher candidate iOS interview questions swift for experience student for preparation of job interview 1 .What is ARC (Automatic Reference…

Apr 24, 2024 iOS

Show a new View from Button press Swift UI

To show a new view from a button press in SwiftUI, you typically use a navigation stack and navigation link. Here's how you can achieve that: import SwiftUI struct ContentView: View { @State private var isShowingNewView = false var body:…

Apr 24, 2024 iOS

SwiftUI: How to make TextField become first responder?

Certainly! Making a TextField become the first responder in SwiftUI can be achieved using a few different approaches. Let’s explore them: Using @FocusState (iOS 15 and later): SwiftUI introduced the @FocusState property wrapper, which allows you to control which input field has focus. Here’s…

Apr 23, 2024 iOS

SwiftUI update navigation bar title color

To update the navigation bar title color in SwiftUI, you can use the navigationBarTitle modifier along with the foregroundColor modifier to adjust the color. Here's an example: import SwiftUI struct ContentView: View { var body: some View { NavigationView {…

Apr 22, 2024 iOS

SwiftUI @State var initialization issue

In SwiftUI, initializing a @State variable directly within the init() method of a View can lead to unexpected behavior. Let’s explore the issue and find a solution. The problem arises because SwiftUI doesn’t allow you to change the value of a @State variable in the initializer. However, you can initialize it. Here’s…

Apr 21, 2024 iOS

What is the difference between ObservedObject and StateObject in SwiftUI

n SwiftUI, both @ObservedObject and @StateObject are property wrappers used for managing external state within a view. However, they are used in slightly different scenarios and have different lifecycle management behaviors: @ObservedObject:Used to declare a dependency on an external object…

Apr 20, 2024 iOS

SwiftUI – Multiple Buttons in a List row

Certainly! When you have multiple buttons in a SwiftUI List row and want to distinguish which button is tapped without the entire row highlighting, you can use the following approach: List { // Both buttons in an HStack so that they appear…

Apr 20, 2024 iOS

Perform a deeplink from SwiftUI widget on tap

Performing a deep link from a SwiftUI widget on tap involves several steps. Widgets in SwiftUI are limited in their interactivity compared to full app views, but you can still use them to open your app and navigate to a…

Apr 19, 2024 iOS

Get the current scroll position of a SwiftUI ScrollView

Certainly! In SwiftUI, you can obtain the current scroll position of a ScrollView using various techniques. Let’s explore a couple of approaches: Using GeometryReader and PreferenceKey: You can track the scroll position by using a custom PreferenceKey. Here’s an example: struct DemoScrollViewOffsetView: View { @State private…