swift5 Questions
4
Recently I face this compile time warning for a SDK.
Does it means it is not build with the Target setting "Build Libraries for Distribution"?.
0
req = ["a":nil, "b":3, "c":["d":3.3, "e":"e", "f":[]], "g":[]]
Traditionally ("if js can do it we can do it too...
Circulation asked 1/7 at 18:51
7
I am getting the below error when I build my iOS project in Xcode 13.0 for Simulator 15 with Swift 5.5
9
Solved
5
Solved
I have a view like below. I want to find out if it is the view which is displayed on the screen. Is there a function to achieve this?
struct TestView: View {
var body: some View {
Text("Test Vie...
2
Solved
I have a simple piece of code:
struct ContentView: View {
var body: some View {
Text("Hello world!")
.task {
await myAsyncFunc()
}
}
private func myAsyncFunc() async {}
}
This co...
Helices asked 27/11, 2021 at 5:0
2
Solved
In the "Platforms State of the Union" video of WWDC2021 at 28:00 it was mentioned that
[Apple] even added support for asynchronously iterating line-by-line through a file
in Foundation ...
Landsturm asked 10/6, 2021 at 11:16
2
Method is deprecated from iOS 14, so need support for both iOS 14 and later. And iOS 13 and earlier.
Opalescent asked 4/9, 2021 at 11:13
4
I'd like to display different views when building for iOS and iPadOS. Currently, I know I can do
import SwiftUI
struct ContentView: View {
#if targetEnvironment(macCatalyst)
var body: some Vie...
2
Solved
I cannot hide NavigationView bar. I tried both variants:
Code 1:
public var body: some View {
NavigationView {
MasterView()
.navigationBarHidden(true)
}
}
Code 2:
public var body: some ...
11
Solved
App crashes with the following error message
2019-10-12 20:01:34.332334-0700 Awesome App[26368:3535170] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600002903280> F...
1
Solved
I'm trying to use the new Swift Macros using @Observable and @Environment with the following code:
import SwiftUI
import Observation
@Observable class Note {
var text = ""
}
struct Con...
Pablo asked 24/6, 2023 at 13:5
5
My code is as follow:
TextField("Enter Your Email", text: self.$username)
How can I make the placeholder "enter your email" be centered in the TextField?
3
Solved
Let's say we have the following goals:
We want to use actors.
We want to use dependency injection and resolve actors through DI.
We want to hide our actors behind protocols so we can vary the impl...
Cavernous asked 7/1, 2022 at 1:0
16
Solved
The new SwiftUI tutorial has the following code:
struct ContentView: View {
var body: some View {
Text("Hello World")
}
}
The second line the word some, and on their site is highlighted as if...
2
Solved
I have a table to which I've added a refreshControl and when I pull down to refresh the content, I reset the array that feeds the table with data and then immediately request new data through an AP...
Munmro asked 13/2, 2022 at 11:17
6
I want to add text (eg. Hi) in a shape (eg. Square) in SwiftUI and make them act as a single object.
It looks like there's no direct way to add text in shape in SwiftUI.
4
I have a self sizing collection view and when I call super.layoutSubviews my app crashes since the collection view enters a recursive update loop. This was working fine in iOS 14 and below. But obs...
5
Solved
I have been testing the async/await functionality previewed in the Swift 5.5 release, but I am unable to collect the results from an async function and display them using SwiftUI. Here is my code:
...
Chordophone asked 3/5, 2021 at 19:54
1
After updating to Xcode 12, I've got lots of warnings for SPM dependencies (including RxSwift and Facebook).
The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the...
Widower asked 18/9, 2020 at 8:1
5
I use the following code snippet (in Xcode 13 Beta 5 and deployment target set to 14.0) to apply view modifiers conditionally according to iOS version:
struct ContentView: View {
var body: some Vi...
3
Solved
I have a function on Xcode (swift) that returns a very long array, that is one word per line. Like
static func en() -> [String] {
[
"a",
"about",
"above",
&quo...
2
Solved
How do I use the new Swift 5.5 await keyword to wait for a duration of time?
Normally, with completion handlers, you would have something like this by using DispatchQueue's asyncAfter(deadline:exec...
Sternson asked 9/8, 2021 at 16:9
1
I need to write a custom font picker view in my ios project. when user click on font family name, i need to display fonts which are in particular family, i used name as particular text style in the...
Bricker asked 30/7, 2020 at 5:48
4
Solved
I have razor pay pod in my project for payment gateway and SWRevelViewController file for side bar controller. I selected the swift 5 and iOS version 13 and updated all the pods but still getting e...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.