Post

Replies

Boosts

Views

Activity

UIImage not fitting in UIImageView frame
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:
1
0
268
Sep ’23
'The code signature version is no longer supported' error
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.
7
4
4k
May ’22
Navigation title not appearing correctly in SwiftUI
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:
2
0
3.6k
Oct ’21
Crash when presenting action sheet on iPad
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?
2
1
2.4k
Aug ’21
Prevent Text Field from containing 2 decimal points in Swift
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)
1
0
1.5k
Aug ’21
Issues when integrating Vungle SDK into project
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.
0
0
504
Aug ’21
My Button looks weird on smaller devices
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!
0
0
343
Jul ’21