Hi,
I have this issue where I have this code and when I arrange the .alerts in any way, none of them show except the codeError alert. Please Help!
Code
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi!
I have this code, and when I do it according to the documentation, it doesn't let me swipe. Please Help!
Code.txt
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!
Hi,
I have this code in my (App).swift file and it passes an @Binding variable into my ContentView. The problem is that it doesn’t update in the content view. Thanks in advance!
App.swift
Hi, I have a table view and am trying to implement a second, here is the code for the second one. The problem is the second one won't show any data. Please note that they're identical code:
import UIKit
import GoogleMobileAds
class Home: UIViewController, GADBannerViewDelegate, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var bannerView: GADBannerView!
@IBOutlet weak var ShowAds: UILabel!
@IBOutlet weak var bannerViewHeight: NSLayoutConstraint!
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var Welcome: UILabel!
var names = [
Utilities.mostRecent
]
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
checkRecentCat()
Utilities.checkads(bannerView: bannerView, bannerViewHeight: bannerViewHeight)
if Utilities.openNum == 1 {
Welcome.text = "Welcome! Check out our app. In the categories section you will find all of our jokes!"
}
bannerView.rootViewController = self
bannerView.delegate = self
if Utilities.ShowAds == true {
ShowAds.text = "Show Ads: True"
}else if Utilities.ShowAds == false {
ShowAds.text = "Show Ads: False"
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
checkRecentCat()
if UserDefaults.standard.bool(forKey: "JokesRUs.RemoveAds") {
Utilities.ShowAds = false
bannerViewHeight.constant = 0
ShowAds.text = "Show Ads: False"
}
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print("index path: \(indexPath.row)")
let row = indexPath.row
if row == 0 {
self.performSegue(withIdentifier: Utilities.mostRecentSegue!, sender: self)
}else if row == 1 {
self.performSegue(withIdentifier: Utilities.secondRecentSegue!, sender: self)
}else if row == 2 {
self.performSegue(withIdentifier: Utilities.thirdRecentSegue!, sender: self)
}
tableView.deselectRow(at: indexPath, animated: true)}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) - Int {
return names.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) - UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
cell.textLabel?.text = names[indexPath.row]
return cell
}
func checkRecentCat() {
print("Most Recent Cat: \(Utilities.mostRecent ?? nil)")
print("Second Most Recent Cat: \(Utilities.secondRecent ?? nil)")
if Utilities.secondRecent == nil || Utilities.secondRecentSegue == nil || Utilities.secondRecent == "Please choose a category to show" || Utilities.secondRecentSegue == "Please choose a category to show" {
Utilities.setSecondRecent(id: "Please choose a category to show", segue: "categories")
}
if Utilities.thirdRecent == nil || Utilities.thirdRecentSegue == nil || Utilities.thirdRecent == "Please choose a category to show" || Utilities.thirdRecentSegue == "Please choose a category to show" {
Utilities.setThirdRecent(id: "Please choose a category to show", segue: "categories")
}
if Utilities.mostRecent == nil || Utilities.mostRecentSegue == nil || Utilities.mostRecent == "Please choose a category to show" || Utilities.mostRecentSegue == "Please choose a category to show" {
Utilities.setMostRecent(id: "Please choose a category to show", segue: "categories")
tableView.isHidden = true
}else {
names = [Utilities.mostRecent]
if Utilities.secondRecent == nil || Utilities.secondRecentSegue == nil || Utilities.secondRecent == "Please choose a category to show" {
}else {
names = [Utilities.mostRecent, Utilities.secondRecent]
if Utilities.thirdRecent == nil || Utilities.thirdRecentSegue == nil || Utilities.thirdRecent == "Please choose a category to show" {
}else {
names = [Utilities.mostRecent, Utilities.secondRecent, Utilities.thirdRecent]
}
}
}
}
Hi,
Whenever I try to set a button's background image using the code below, the image goes blank instead of it changing. Ideas?
@IBAction func showSaveCatDescript(_ sender: Any) {
if showingSaveCatDescript == false {
toggleShowSaveCatDescript.setImage(UIImage(named: "questionmark.circle.fill"), for: .normal)
saveCatDescript.isHidden = false
showingSaveCatDescript = true
}else if showingSaveCatDescript == true {
toggleShowSaveCatDescript.setImage(UIImage(named: "questionmark.circle"), for: .normal)
saveCatDescript.isHidden = true
showingSaveCatDescript = false
}
}
Hi,
I have this code accessing firestore and my loop for getting multiple sets of data.
Code
Thank you in advanced!
Hi,
My app used to support alternate icons and now all of a sudden it does not anymore.
Info.plist
Thanks in advanced!😉
I have this share sheet code and I am trying to figure out how to edit "Plain Text".
ShareSheet 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 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
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 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 was downloading Xcode when it failed, now I can't download it, because I don't have enough space. I am running the newest non-beta version of Big Sur.
Thanks in advance
Hi, I have a firebase database and was wondering what the best way to search it with keywords would be. I am making a jokes app and would like to add this functionality.