Hi,
I have this code that I need to run in the exact line order, but I can't figure out how to do it.
Things I have tried:
DispatchQueue Aysnc
completion handler functions
Code:
let pickedCat = Int.random(in: 1...4)
//print("picked cat: \(pickedCat)")
if pickedCat == 1 {
getRandomJokes()
randomJoke.text = "Random Joke: \(self.DadJokes)"
//print("Random Joke: \(self.DadJokes)")
}else if pickedCat == 2 {
getAssistantJokes()
randomJoke.text = "Random Joke: \(self.AssistantJokes)"
//print("Random Joke: \(self.AssistantJokes)")
}else if pickedCat == 3 {
getKnockKnockJokes()
randomJoke.text = "Random Joke: \(self.KnockKnockJokes)"
//print("Random Joke: \(self.KnockKnockJokes)")
}else if pickedCat == 4 {
getRandomJokes()
randomJoke.text = "Random Joke: \(self.RandomJokes)"
//print("Random Joke: \(self.RandomJokes)")
}
if randomJoke.text == "Random Joke: " {
randomJoke.text = "Random Joke: Failed to connect to server"
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Whenever I run this code, after I have purchased something and it shifts up after leaving and reopening the page it crashes with the error "Index out of range".
Code - https://developer.apple.com/forums/content/attachment/86665b01-4c50-47bd-a14d-ef95b58db511
Ideas? Thanks in advance!
Ps: I can provide full project if needed.
Hi,
How can I wait until an IAP transaction/restore is finished?
Thanks in advanced.
This is driving me crazy. I have this code:
Utilities.getKnockKnockJokes {
self.previousKnockKnockJoke = self.currentKnockKnockJoke
print("currentKnockKnockJoke = \(self.currentKnockKnockJoke)")
self.currentKnockKnockJoke = KnockKnockJokes.knockKnockJokes.randomElement()!
print("newCurrentKnockKnockJoke = \(self.currentKnockKnockJoke)")
self.singleServeText.text = self.currentKnockKnockJoke
}
The function that is called is bellow:
getKnockKnockJokes
Thank you in advanced!
I have this share sheet code and I am trying to figure out how to edit "Plain Text".
ShareSheet Code
Hi,
I have this code and the guard let storekitProduct is always returning nil, no matter what and is therefore quitting the function. How do I fix this? Thanks in advanced!
Code
I have this code:
static var viewModels = [RestaurantListViewModel]() {
didSet {
dataSet = true
print("data set")
}
}
When it didSet is called, I want it to change a state in another struct, how can I accomplish this?
I have this struct:
struct Final_Restaurant_View: View {
var data: [RestaurantListViewModel]
@State private var isHome = false
var body: some View {
NavigationView{
VStack {
List(data) {
data in
layout(data: data)
}
.listStyle(GroupedListStyle())
Button(action: {
isHome = true
}, label: {
Text("Go Home")
})
.padding()
}
.fullScreenCover(isPresented: $isHome, content: {
ContentView()
})
.navigationBarTitle("Results")
}
}
}
Which is supposed to get data and display it in a list. The problem is that I can't find anything about sections on a table structured like this and therefore, it goes wack with the section title. Any Ideas???
I have looked around and am confused about deep linking to a view that is not the default view, or passing information to that view which then impacts what is shown. Please help.
Note: I am using the UIKit lifecycle
I have a key pairs array:
["Id": XmGjU9gxS5s0CzP4S6-bHw, "Name": Pizzeria La Rocca, "Url": https://www.yelp.com/biz/pizzeria-la-rocca-seattle?adjust_creative=sxCnBn1t8D3B-4MLGRB_2g&utm_campaign=yelp_api_v3&utm_medium=api_v3_business_search&utm_source=sxCnBn1t8D3B-4MLGRB_2g, "Rating": 5, "Img": https://s3-media1.fl.yelpcdn.com/bphoto/kE6hbIfi4WdlIW52SF5KUw/o.jpg]
How do I convert this to my struct?
struct RestaurantListViewModel: Identifiable {
let name: String
let imageUrl: URL
let id: String
let rating: Double
let url: String
// let category: Array<String>
}
Thank you in advanced!
How do I create an action that occurs when a child view (showing through a NavigationLink) is dismissed? I am trying to pass a value, but can't create a function to use the received value.
Thanks in advanced.
Hi!
I have this code, and when I do it according to the documentation, it doesn't let me swipe. Please Help!
Code.txt
Hey,
Whenever I upload a build to App Store Connect, I get an Invalid Binary with the error:
One or more dynamic libraries that are referenced by your app are not present in the dylib search path
Here are all the frameworks in my project:
And here is my Cocoapods:
Thx in advanced!
Edit
Here is my output from running otool -L:
otool -L Output
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store Connect
Frameworks
Swift Packages
Hi,
I am helping Evan Richman with the team id L7JQRVXU2V transition to my business (MCRICH LLC), but the status has been in transition for about 1.5 weeks, even though I have gotten the confirmation code. What is going on?
Please help!
Hi,
I have this error:
Provisioning profile "iOS Team Provisioning Profile: com.Mcrich23.Pickt" doesn't include the com.apple.runningboard.assertions.webkit entitlement
However, I can't add this entitlement because it pretty much does not exist. Any ideas?