Category "swift"

How to implement localization in Swift UI

Can anybody help me? I can't find any description of the localization in Swift UI. Can anyone please give advice or better an example of how to localize for exa

Can't reset UILabel attributedText when a UITableViewCell is reused

The problem I'm using a UITableView to show the list of transactions of a credit card. If the transaction is a chargeback, I'm adding a strikethrough style to

How to use UIAccessibility.post(notification: .layoutChanged, argument: nil) in SwiftUI to move focus to specific view

I have one button on screen and on that button tap it opens one modal (view). but after closing that view, the focus of accessibility voice over goes on top of

SwiftUI - create a single dashed line with SwiftUI

I need to create a single dashed line. I tried going about it by creating a Rectangle view with a dashed stroke. However, when setting the height of the rectang

Failed to load module 'project name'

I added unit test target to my existing project, but while @testable import Product_Module_Name getting error "Failed to load module 'Product_Module_Name'". I

Missing required module 'Firebase' for Unit test

i added Unit test target to existing project, when i @testable import Product_Module_Name in test class i am getting Missing required module 'Firebase' i am u

Repeating animation on SwiftUI Image

Given the following struct: struct PeopleList : View { @State var angle: Double = 0.0 @State var isAnimating = true var foreverAnimation: Animatio

AudioKit Cookbook v.5 build fails (xcode 13.2.1)

I have been trying to build, to no avail, the Cookbook under Xcode 13.2.1. I get "Analyze Failed" with the following errors: Stk: Command CompileSwiftSources fa

NSUnknownKeyException for a UIButton. Correctly added referencing outlets and corresponding function

I am facing an NSUnknownKeyException for a back button present on a Storyboard, i.e. FastGazeExtension. I have correctly connected the back button to the UIButt

CoreData not updated until application inactivates

I'm building a Macos CoreData+CloudKit app. I first create my container by doing this: let container = NSPersistentCloudKitContainer(name: "TestApp") let descri

Using @EnvironmentObject properly

I am just trying to get my updated value to display in my application after it receives a new value from bluetooth core. I know the value in the class is updati

sliders slow down and don't move smoothly

I'm doing an application "Photo Editor". I'm beginner in swift. I have a problem with my sliders. They don't work as I need. May be someone know, how I can reso

Whenever I add a spacer into my code. it crashes. It works fine until then

This is simple code I made to practice with spacers. This is SwiftUI. struct Spacer: View { var body: some View{ HStack{

How to use Image Literal in the latest Xcode version 13?

I have tried the #imageliteral method but it seems to not working also. I need to use many images in an array so is there any alternative to it or not?

SwiftUI - Unknown preview provider "ContentView_Previews_" when previewing. Happens in a brand-new project

I have this simple view. import SwiftUI struct ContentView: View { var body: some View { Text("Hello") } } struct ContentView_Previews: Previe

Deleting and inserting a row in a table?

I am following some swift tutorials and I have been noticing that sometimes it's enough to use the array and append/remove but sometimes you have to also add in

iOS IPA file could not be installed because it's integrity could not be verified

After installing ipa file on my iPad 14.2 version this error prompt. " this app cannot be installed because its integrity could not be verified" what should

Menu Bar Popover is missing from application's elements tree on macOS

I'm currently trying to write simple UI Tests for an App that comes with a popover in the macOS menu bar. One of the tests is supposed to open the menu bar popo

Why does UIButton.setTitle change the font size?

I'm building an iOS app for a class, and I'm following along some instructions. The Edit button is connected to toggleEditingMode, but when I change the text, f

Swift Playgrounds (iPad) does not build an app with implemented ARSessionDelegate.session(_:didUpdate:) functions

I found an error while trying to implement a SwiftUI representation of ARView with ARSessionDelegate based on Apple’s official example “Building an