Hi everyone,
I’m having an issue with SwiftUI where my entire Section becomes clickable, instead of just the “Edit profile” button. Here’s my code:
VStack(alignment: .center) {
KFImage(authManager.user?.photoURL)
.resizable()
.scaledToFill()
.frame(width: 80, height: 80)
.clipShape(Circle())
Text(authManager.user?.displayName ?? "")
.font(.system(.title, design: .rounded))
Text(authManager.user?.email ?? "")
.font(.subheadline)
.foregroundColor(.gray)
NavigationLink {
EditProfileView()
} label: {
Text("Edit profile")
.frame(minWidth: 0, maxWidth: .infinity)
.font(.system(size: 18))
.padding(10)
.foregroundColor(.white)
.background(Color.blue)
.cornerRadius(25)
}
.padding(.top, 5)
}
.frame(maxWidth: .infinity, alignment: .center)
}
I want only the button to be clickable. How can I fix this?
Thanks!
Link to issue: https://imgur.com/a/iO9aNSM
Post
Replies
Boosts
Views
Activity
I have attached a UIImageView to my Navigation bar title view, however the image exceeds the frame no matter which values I input.
Here is the code:
override func viewDidLayoutSubviews() {
// style the navbar
let iconView = UIImageView(frame: CGRect(x: 0, y: 0, width: 100, height: 30))
let image = UIImage(named: "fresh-appbar")!
iconView.contentMode = .scaleAspectFit
iconView.image = image
navigationItem.titleView = iconView
}
I have also attached an image:
Hi all.
I am trying to run my app on a physical iPhone, however I keep getting a dialog saying 'Unable to install (insert app name here)'.
Clicking on details gives me this:
Unable to install "Bitelist"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620375
User Info: {
DVTErrorCreationDateKey = "2022-05-31 22:03:26 +0000";
IDERunOperationFailingWorker = IDEInstalliPhoneLauncher;
}
--
The code signature version is no longer supported.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620375
System Information
macOS Version 12.4 (Build 21F79)
Xcode 13.4 (20503) (Build 13F17a)
Timestamp: 2022-05-31T23:03:26+01:00
Does anyone have a fix to this? All help is appreciated.
Hi all.
I have a navigation title attached to my VStack, however it isn't appearing near the top of the screen like it's supposed to.
Here's my code:
NavigationView{
VStack{
Image(club.image)
.resizable()
.scaledToFit()
.frame(height: 300)
Text(club.name)
.font(.system(size: 40, weight: .black))
HStack(alignment: .center, spacing: 20){
Label(title: {
Text(club.league)
.foregroundColor(.secondary)
}, icon: {
Image(systemName: "location.north.circle.fill")
.foregroundColor(.blue)
})
Label(title: {
Text(club.netWorth)
.foregroundColor(.secondary)
}, icon: {
Image(systemName: "dollarsign.circle.fill")
.foregroundColor(.blue)
})
}
}.navigationTitle(club.name)
}
Here is an image:
I am building a list in SwiftUI.
In my view, I want the 'Jesse Lingard' and 'Manchester United' text to be next to the image but they are appearing underneath. How do I fix this?
Hi all.
I have an ad network integrated into my project.
I am trying to show a banner ad, and I want it to always be on top of the tab bar, instead of reloading it for each view controller.
This is what I'm trying to achieve:
Does anybody have a solutution to this?
Hi all.
My application crashes whenever I show an action sheet on an iPad, but is fine when running on an iPhone.
Here is the error:
You must provide location information for this popover through the alert controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the alert controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.
Here is my action sheet code:
func showSheet() {
let sheet = UIAlertController(title: "Options", message: nil, preferredStyle: .actionSheet)
sheet.addAction(UIAlertAction(title: "Save", style: .default, handler: nil))
sheet.addAction(UIAlertAction(title: "Discard", style: .destructive, handler: nil))
present(sheet, animated: true, completion: nil)
}
Does anybody have a solution?
Hi all.
I'm developing a savings goal app, and there is a screen that allows users to input data about a new goal.
I want to make sure that the user cannot input 2 decimal points on the saving amount text field otherwise the app will crash.
Does anybody have a solution to this?
Here's my code:
@IBAction func createSaving(_ sender: Any) {
if(savingTitleTxt.text!.isEmpty){
self.view.makeToast("Error. Please specify title.", duration: 2.0, position: .bottom)
return
}
if(savingAmountTxt.text!.isEmpty || savingAmountTxt.text!.contains(" ")){
self.view.makeToast("Error. Please specify a valid goal amount.", duration: 2.0, position: .bottom)
return
}
var tempList:[SavingItem] = getData()
tempList.append(SavingItem(title: savingTitleTxt!.text!, image: savingImage!.image!.pngData()!, goal: Double(savingAmountTxt!.text!)!, saved: 0))
saveData(list: tempList)
self.view.makeToast("Success", duration: 2.0, position: .bottom)
Hi.
I've integrated the Vungle SDK into my Xcode project, and I used the official documentation to do this.
However, I keep getting an error when I try to run my app:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_VungleSDK", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've been trying to solve this, but I can't find anything. If anybody has an answer, I will highly appreciate it. Thanks.
Hi.
Yesterday I purchased the $99 fee to enrol for an Apple Developer account.
However, even after paying, I am still being shown the message to 'complete my payment' and my status is pending.
Can somebody please tell me what is going on? Thank you.
Hi.
I'm developing a remote control app that connects to a TV over wifi.
I need to implement Sockets so that I can send commands to the TV using an IP address hair and port over wifi.
What is the best way of doing this?
Thanks.
Hi.
I have a button built using Storyboards (I'm still learning SwiftUI), and it looks fine on most devices, but on devices like the iPod touch and iPhone 4, the button text just has 3 dots and doesn't look correct.
Here is a screenshot:
https://i.imgur.com/uMrKgKk.png
Hope you can explain what is going on here. Thanks!
Hi.
I'm developing a remote control app, and I want to implement a feature where the user can scan for all televisions on the local network to connect to one, then this will be displayed in a Table View.
So is there any way of listing all devices found on the local network?
Thanks.