#swift

Found 76 articles tagged with #swift

Difference between @objc and @nonobjc in Swift

In Swift, @objc is used to expose a method, property, or class to Objective-C, while @nonobjc is used to explicitly hide an entity from Objective-C.

Jul 25, 2023#swift#comparison

Difference between callAsFunction and @dynamicCallable in Swift

The main difference between callAsFunction and @dynamicCallable is that the former is more static and type-safe, while the latter is more dynamic and flexible.

Jul 23, 2023#swift#comparison

How to use xcconfig files in Xcode projects

You can create as many xcconfig files as you want, and you can specify different build configuration files for debug and release builds, and for different platforms and architectures.

Jul 21, 2023#xcode#swift#ios

Diferrence between Set and OptionSet in Swift

Set is a generic type that can store any type that conforms to the Hashable, OptionSet is a protocol that can be adopted by custom types that store a fixed-size sequence of bits.

Jul 18, 2023#swift#comparison

Unlocking the Power of Macros in Swift 5.9

Macros are a feature present in a number of languages that allow one to perform some kind of transformation on the program's input source code to produce a different program.

Jun 19, 2023#swift#ios

iOS Deep Linking: URL Schemes vs Universal Links

There are two ways to implement deep linking in iOS: Define your own custom schemes, or use standard HTTP or HTTPS links that can open your app if it is installed.

Data Race vs Race Condition in Swift

A data race is when two threads access the same mutable object without synchronization, while a race condition is when the order of events affects the correctness of the program.

May 24, 2023#swift#concurrency

How to show in-app web browser in iOS apps

In iOS, an in-app browser is a component of an app that allows users to view web content within the app, rather than opening the default browser app.

May 07, 2023#swift#ios

SwiftUI .task() vs .onAppear()

Both view modifiers that can be used to run some code when a view is shown but there are some differences between them. In general, .task() is more powerful and convenient but only available in iOS 15 or later.

Apr 22, 2023#swiftui#swift#ios

How to print unique items of a array in Swift

In Swift, an array is a collection of values that can be of any type. Sometimes, you may want to print only the unique items of an array….