I have this one view that seems to be much lower than it is supposed to be. Can someone please tell me what I am doing wrong?
Code
Here is a link to the image(I was having trouble uploading directly) https://drive.google.com/file/d/16HIhPCrXtybbh9JD7QRbc5ccBVj9Dhiq/view?usp=sharing
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi,
How do I show a share sheet in a child view. UIApplication.shared.windows.first?.rootViewController?.present(activityVC, animated: true, completion: nil) doesn't work.
Thanks in advanced!
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
Hi,
I am trying to use mapkit auto completion in my SwiftUI project and whenever I run the view, I get a bunch of errors such as:
2022-02-12 19:45:59.095462-0800 Pickt[64199:2417526] [SearchAttribution] No matching attribution source found for com.timeout
2022-02-12 19:45:59.095595-0800 Pickt[64199:2417526] [SearchAttribution] No matching attribution source found for com.theculturetrip
2022-02-12 19:45:59.095822-0800 Pickt[64199:2417526] [SearchAttribution] No matching attribution source found for com.redtri
2022-02-12 19:45:59.095909-0800 Pickt[64199:2417526] [SearchAttribution] No matching attribution source found for com.fotospot
2022-02-12 19:45:59.096549-0800 Pickt[64199:2417526] [SearchAttribution] Error loading attribution info for identifier com.timeout from geod: Error Domain=GEOErrorDomain Code=-8 "No matching attribution source found for com.timeout" UserInfo={NSDebugDescription=No matching attribution source found for com.timeout}
2022-02-12 19:45:59.096679-0800 Pickt[64199:2417526] [SearchAttribution] Error loading attribution info for identifier com.theculturetrip from geod: Error Domain=GEOErrorDomain Code=-8 "No matching attribution source found for com.theculturetrip" UserInfo={NSDebugDescription=No matching attribution source found for com.theculturetrip}
2022-02-12 19:45:59.096761-0800 Pickt[64199:2417526] [SearchAttribution] Error loading attribution info for identifier com.redtri from geod: Error Domain=GEOErrorDomain Code=-8 "No matching attribution source found for com.redtri" UserInfo={NSDebugDescription=No matching attribution source found for com.redtri}
2022-02-12 19:45:59.096837-0800 Pickt[64199:2417526] [SearchAttribution] Error loading attribution info for identifier com.fotospot from geod: Error Domain=GEOErrorDomain Code=-8 "No matching attribution source found for com.fotospot" UserInfo={NSDebugDescription=No matching attribution source found for com.fotospot}
and then the auto complete breaks until I dismiss and reload the view.
Full Code
I am in desperate need of help, thx in advance!
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 All,
I am trying to add an UIHostingViewController to my UIViewController, to cover the screen. Unfortunately, I keep getting this error (Thread 1: "NSLayoutConstraint for <_TtGC7SwiftUI19UIHostingControllerV5Pickt10ViewRouter_: 0x7fa32a37c3f0>: Constraint items must each be a view or layout guide.") from my code:
let controller = UIHostingController(rootView: ViewRouter(join: join, create: create, showPicker: showPicker, setMock: setMock))
controller.view.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(controller.view)
view.addConstraints([
NSLayoutConstraint(item: controller,
attribute: .top,
relatedBy: .equal,
toItem: view.safeAreaLayoutGuide,
attribute: .top,
multiplier: 1,
constant: 0),
NSLayoutConstraint(item: controller,
attribute: .leading,
relatedBy: .equal,
toItem: view.safeAreaLayoutGuide,
attribute: .leading,
multiplier: 1,
constant: 0),
NSLayoutConstraint(item: controller,
attribute: .trailing,
relatedBy: .equal,
toItem: view.safeAreaLayoutGuide,
attribute: .trailing,
multiplier: 1,
constant: 0),
NSLayoutConstraint(item: controller,
attribute: .bottom,
relatedBy: .equal,
toItem: view.safeAreaLayoutGuide,
attribute: .bottom,
multiplier: 1,
constant: 0)
])
Hi!
I am trying to record the AVAudioPlayer's output so I can play it back to the user. I can't find anything online, but I am sure that it's possible, maybe with AVEngine? Please help asap!
I am an aspiring developer and would like some help with this issue, that is super annoying.
Any Idea why I am getting this message?
Thread 1: "[<UIViewController 0x7ff3bdc08a80> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key leadingHome."
I have tried:
Deleting home and re-adding it
reconnecting all the points on the home controller
Deleting the class and re-adding it
Making a new class and changing Home over to it
Setting the constraints and menu button itself to the class
You can download my project at: https://www.icloud.com/iclouddrive/0vC-WfbeKKjLa6V05ofqhyayw#Riddle_Wednesday
Thanks so much in advance!
Hi,
Is there a way I can use something like an res feed to update text weekly without using a paid server?
Thanks in advance!
Hi,
I would like to be able to take two fields of a firestorm document and then set two UILabels to those fields. Here is my code:
import SafariServices
import WebKit
import Firebase
class TheRiddle: UIViewController {
@IBOutlet weak var leading_TheRiddle: NSLayoutConstraint!
@IBOutlet weak var trailing_TheRiddle: NSLayoutConstraint!
@IBOutlet weak var CurrentRiddle: UILabel!
@IBOutlet weak var PreviousRiddle: UILabel!
var menuOut = false
override func viewDidLoad() {
super.viewDidLoad()
let db = Firestore.firestore()
db.collection("TheRiddle").document("Riddles").getDocument { (document, error) in
//check for error
if error == nil {
//check if document exists
if document != nil {
}else {
if let currentRiddle = document!.get("CurrentRiddle") as? String {
self.CurrentRiddle.text = "This Weeks Riddle: " + currentRiddle
}
if let previousRiddle = document!.get("CurrentRiddle") as? String {
self.CurrentRiddle.text = "Previous Riddle: " + previousRiddle
}
}
}
}
}
@IBAction func RiddleAnswerForm(_ sender: Any) {
let vc = SFSafariViewController(url: URL(string: "https://forms.office.com/Pages/ResponsePage.aspx?id=ytAqTDte6UK-KD5v_kOm4Y843IzqmYtFlDtLrfRYsi1UMFpUMk1GN01GS05BVFlJUElONk4yR1hKUCQlQCN0PWcu")!)
present(vc, animated: true)
}
@IBAction func menuTappedTheRiddle(_ sender: Any) {
if menuOut == false {
leading_TheRiddle.constant = 150
trailing_TheRiddle.constant = -150
menuOut = true
}
else {
leading_TheRiddle.constant = 0
trailing_TheRiddle.constant = 0
menuOut = false
}
UIView.animate(withDuration: 0.2, delay: 0.0, options: .curveEaseIn, animations: {
self.view.layoutIfNeeded()
}) { (animationComplete) in
print("The animation is complete")
}
}
}
Thanks in advance!
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, this code is returning nil always. So frustrating!
let today = Date()
let calendar = Calendar(identifier: .gregorian)
let components = calendar.dateComponents([.weekday], from: today)
let nineThirtyToday = Calendar.current.date(
bySettingHour: 90,
minute: 30,
second: 0,
of: today)
print(nineThirtyToday as Any)
if components.weekday == 4 {
if today = nineThirtyToday! {
if UDM.shared.widgetDefaults?.value(forKey: "currentRiddle") as! String == currentRiddleFinal {
currentRiddleFinal = "Waiting for update from server"
}
}else {
print("Not Nine Thirty")
}
}
UDM.shared.widgetDefaults?.setValue(currentRiddleFinal, forKey: "currentRiddle")
print("Current Riddle: \(currentRiddleFinal)")
}
Thanks in advance!
Hi,
I am making an app and I am using tab navigation controller and the navigation controller, and whenever I push into another view controller through a segue, if I go to a different tab, then back to that one it's still on the pushed to view controller. Ideas on how to fix this.
Thanks in advance!
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
}
}