Interface Builder

RSS for tag

Build interfaces for applications without writing code using Interface Builder, an editor within Xcode.

Posts under Interface Builder tag

200 Posts

Post

Replies

Boosts

Views

Activity

Xcode Preview is not working
I've encountered while attempting to integrate SwiftUI into an existing UIKit project. Specifically, I have experienced recurring view crashes when creating new SwiftUI views within the project. My Feedback id is FB13509337 I would appreciate your assistance in resolving this matter promptly, as it is critical to the development of our application. Your prompt attention to this issue would be greatly appreciated
1
0
711
Jan ’24
Getting Err 'Command CompileStoryboard failed with a nonzero exit code'
Hi, I Just Updated MacOS and XCode and then tried to Build App. Now it suddenly started throwing Error: Command CompileStoryboard failed with a nonzero exit code I've tried a few solutions but none worked. Got following Error: 2023-12-27 16:14:06.315 ibtoold[70732:612834] [MT] DVTAssertions: ASSERTION FAILURE in IDEInterfaceBuilder/AutolayoutFoundation/Model/Constraints/IBLayoutConstraint.m:1141 Details: We only understand width/height, not 0x3 Object: <IBLayoutConstraint: 0x600001772c80> Method: -absoluteGeometricDescriptionInCoordinateSpaceOfView:userInterfaceLayoutDirection:ofItem:attribute: Thread: <_NSMainThread: 0x600002e780c0>{number = 1, name = main} Hints: Backtrace: 0 -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation) 1 _DVTAssertionHandler (in DVTFoundation) 2 _DVTAssertionFailureHandler (in DVTFoundation) 3 -[IBLayoutConstraint absoluteGeometricDescriptionInCoordinateSpaceOfView:userInterfaceLayoutDirection:ofItem:attribute:] (in IBAutolayoutFoundation) 4 -[IBLayoutConstraint geometricDescriptionInCoordinateSpaceOfView:userInterfaceLayoutDirection:] (in IBAutolayoutFoundation) 5 -[IBLayoutConstraint geometricCompare:withUserInterfaceLayoutDirection:] (in IBAutolayoutFoundation) 6 -[IBLayoutConstraint compare:withUserInterfaceLayoutDirection:] (in IBAutolayoutFoundation) 7 __63-[NSView(IBViewIntegration) ibConstraintComparatorForDocument:]_block_invoke (in IDEInterfaceBuilderKit) 8 __CFSimpleMergeSort (in CoreFoundation) 9 __CFSimpleMergeSort (in CoreFoundation) 10 CFSortIndexes (in CoreFoundation) 11 -[NSMutableOrderedSet sortRange:options:usingComparator:] (in CoreFoundation) 12 -[NSView(IBViewIntegration) ibPrimitiveAddConstraintsToCandidateListOnly:thatAreAlreadyInDocument:] (in IDEInterfaceBuilderKit) 13 __53-[NSView(IBViewIntegration) _ibUnarchiveConstraints:]_block_invoke_2 (in IDEInterfaceBuilderKit) 14 __NSDICTIONARY_IS_CALLING_OUT_TO_A_BLOCK__ (in CoreFoundation) 15 __NSDictionaryEnumerate (in CoreFoundation) 16 __53-[NSView(IBViewIntegration) _ibUnarchiveConstraints:]_block_invoke (in IDEInterfaceBuilderKit) 17 __76-[IBDocumentUnarchiver registerDelayedReferenceUnarchivingOfType:withBlock:]_block_invoke_2 (in IDEInterfaceBuilderKit) 18 -[IBDocumentUnarchiver recurseWithElement:kind:invokingBlock:] (in IDEInterfaceBuilderKit) 19 __76-[IBDocumentUnarchiver registerDelayedReferenceUnarchivingOfType:withBlock:]_block_invoke (in IDEInterfaceBuilderKit) 20 -[IBDocumentUnarchiver enableUnarchivingReferencesOfType:] (in IDEInterfaceBuilderKit) 21 -[IBDocument unarchivePlatformIndependentDataWithUnarchiver:error:] (in IDEInterfaceBuilderKit) 22 -[IBStoryboardDocument unarchivePlatformIndependentDataWithUnarchiver:error:] (in IDEInterfaceBuilderKit) 23 -[IBDocument unarchiveDocumentWithUnarchiver:error:] (in IDEInterfaceBuilderKit) 24 __48-[IBDocumentUnarchiver unarchiveDocument:error:]_block_invoke (in IDEInterfaceBuilderKit) 25 -[IBDocumentUnarchiver recurseWithElement:kind:invokingBlock:] (in IDEInterfaceBuilderKit) 26 -[IBDocumentUnarchiver unarchiveDocument:error:] (in IDEInterfaceBuilderKit) 27 __61-[IBDocument decodeContentsOfURL:ofType:decodingStyle:error:]_block_invoke (in IDEInterfaceBuilderKit) 28 -[IBDocumentAutolayoutManager ignoreAutolayoutStatusInvalidationDuring:] (in IDEInterfaceBuilderKit) 29 -[IBDocument ignoreAutolayoutStatusInvalidationDuring:] (in IDEInterfaceBuilderKit) 30 -[IBDocument decodeContentsOfURL:ofType:decodingStyle:error:] (in IDEInterfaceBuilderKit) 31 -[IBDocument readFromURL:ofType:error:] (in IDEInterfaceBuilderKit) 32 IBLoadDocument (in ibtoold) 33 -[IBCLIInterfaceBuilderToolPersona invokeArguments:outputDictionary:] (in ibtoold) 34 -[IBCLIInterfaceBuilderToolPersona runSingleInvocation:outputtingToFileHandle:andVerifyingEnvironment:] (in ibtoold) 35 IBCLIServerRunSingleInvocation (in ibtoold) 36 __IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess_block_invoke_2 (in ibtoold) 37 __IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess_block_invoke (in ibtoold) 38 -[IBCLIErrorForwarder forwardErrorOutputToDescriptor:whileInvokingBlock:] (in ibtoold) 39 IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess (in ibtoold) 40 main (in ibtoold) 41 start (in dyld) Command CompileStoryboard failed with a nonzero exit code Any help would be highly Appreciable.
0
1
987
Jan ’24
GridView addRow height problem
I am trying to add rows to GridView and not able to get expected row height correctly. override func viewDidLoad() { super.viewDidLoad() // Remove the row in IB designer gridView.removeRow(at: 0) let image = NSImage(named: NSImage.colorPanelName)! //image.size = NSMakeSize(80, 80) let imageView = NSImageView(image: image) imageView.imageFrameStyle = .grayBezel imageView.imageScaling = .scaleAxesIndependently imageView.frame = NSMakeRect(0, 0, 80, 80) let label = NSTextField(labelWithString: "test text") let row = gridView.addRow(with: [imageView, label]) row.height = 80 } What was wrong with my code?
5
0
963
Jan ’24
Image is nil while I'm trying to rotate it
So, i am making an app in which you enter coordinates, confirm them, and then an arrow pops up that shows the direction to the place which coordinates user entered. However when i click confirm, the arrow shows up but doesnt rotate. When i tried some troubleshooting, i found out that arrowImageView is nil. Can anyone please help? ` import UIKit import CoreLocation extension CGFloat { func toRadians() -> CGFloat { return self * CGFloat.pi / 180.0 } } class ViewController: UIViewController { @IBOutlet weak var Latitude_text: UITextField! @IBOutlet weak var Longitude_text: UITextField! @IBOutlet var arrowImageView: UIImageView! let locationManager = CLLocationManager() var destinationCoordinate: CLLocationCoordinate2D? override func viewDidLoad() { super.viewDidLoad() locationManager.delegate = self locationManager.requestWhenInUseAuthorization() locationManager.startUpdatingLocation() locationManager.startUpdatingHeading() } @IBAction func Latitude_import(_ sender: Any) { validateCoordinates() } @IBAction func Longitude_input(_ sender: Any) { validateCoordinates() } @IBAction func confirmButtonTapped(_ sender: UIButton) { validateCoordinates() performSegue(withIdentifier: "ShowArrowScreen", sender: self) } func validateCoordinates() { guard var latitudeText = Latitude_text?.text, !latitudeText.isEmpty, var longitudeText = Longitude_text?.text, !longitudeText.isEmpty else { // Handle empty fields print("Invalid coordinates. Please enter valid latitude and longitude.") return } // Replace commas with dots latitudeText = latitudeText.replacingOccurrences(of: ",", with: ".") longitudeText = longitudeText.replacingOccurrences(of: ",", with: ".") guard let latitude = Double(latitudeText), let longitude = Double(longitudeText) else { // Handle invalid text print("Invalid coordinates. Please enter valid latitude and longitude.") return } destinationCoordinate = CLLocationCoordinate2D(latitude: latitude, longitude: longitude) updateUIWithBearing() } func calculateBearing(from source: CLLocationCoordinate2D, to destination: CLLocationCoordinate2D) -> Double { let theta = atan2(destination.longitude - source.longitude, destination.latitude - source.latitude) return (theta * (180.0 / .pi) + 360.0).truncatingRemainder(dividingBy: 360.0) } func updateUIWithBearing() { guard let currentLocation = locationManager.location, let destination = destinationCoordinate else { print("Error: Could not retrieve location or destination coordinates.") return } let bearing = calculateBearing(from: currentLocation.coordinate, to: destination) print("Bearing to destination: \(bearing) degrees") rotateArrow(bearing: CGFloat(bearing)) } func rotateArrow(bearing: CGFloat) { print("Rotate Arrow function called.") guard let arrowImageView = arrowImageView else { print("Error: Arrow image view is nil.") return } guard let frameworkBundle = Bundle(identifier: "com.myframework.name") else { print("Error: Unable to load framework bundle.") return } guard let arrowImage = UIImage(named: "myImage", in: frameworkBundle, compatibleWith: nil) else { print("Error: Arrow image is nil.") return } arrowImageView.image = arrowImage let radians = bearing.toRadians() UIView.animate(withDuration: 0.5, animations: { arrowImageView.transform = CGAffineTransform.identity.rotated(by: radians) }) { _ in print("Rotation animation completed.") } } } extension ViewController: CLLocationManagerDelegate { func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) { let heading = newHeading.trueHeading print("Current heading: \(heading) degrees") } func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { if let location = locations.last { print("Updated location: \(location.coordinate.latitude), \(location.coordinate.longitude)") } } }
0
0
655
Jan ’24
Outlets do not work correctly with ViewControllers that inherit from the framework's ViewController
I am creating and selling a third-party SDK. The framework includes a subclass of UIViewController named BaseViewController. I also provide the subclass of BaseViewController (ChildViewController) as *.swift source code and xib file to be integrated into the application along with the *.framework. I encountered an issue during this integration. I cannot access the view property of the parent class UIViewController from .xib file of the ChildViewController which is integrated into the application. Please advise me on how to avoid this issue. I have prepared specific source code and screenshots. I will attach them and send them in a subsequent email.
0
0
542
Dec ’23
Setup in Unity for Xcode with Toolchains
I'm using iXGuard for my Unity Project and need to build on XCode with iXGuard Toolchains (Xcode menu -> Toolchains -> select iXGuard Toolchains, and also need to add a new script for Post Action (Product -> Scheme -> Edit Scheme -> Archive -> Post-actions ) The question is how can I setup/add in Unity to configure for it instead of manual configure on Xcode?
0
0
671
Dec ’23
Are storyboard and UIKit due to disappear ?
I read in Xcode 15.2 release notes that @IBDesignable and @Inspectable are deprecated and will disappear in a future release. After the abandon of WatchKit and its storyboard, replaced by SwiftUI, does it mean storyboards (and consequently UIKit) will progressively disappear, leaving developers alone with SwiftUI to design apps (IMHO, inadequate to design complex UI: for instance, I always struggle to position precisely objects for all devices sizes as we miss constraints manager in SwiftUI) ? For sure, IBDesignable is (was) whimsical, but a very useful tool to design sophisticated UI. Replacing by #Preview does not make it. I also understand that Xcode is a very complex piece of code and that maintaining and evolving some tools (as IBDesignable) requires effort. But isn't it what we expect from Apple ? To provide us with the best tools and keep on the promise of WYSIWYG environments, all along ? Is it only me or do others share this view ?
2
0
2.9k
Dec ’23
Weird problem of NSTableView with auto layout
I have had this issue for a long time. If I configure any auto layout constraints in TableViewCell, I get extremely weird layout behavior in IB designer; however, layout is completely good during runtime. For example, with a completely new project and a single NSTableView on the main view, I get: If I resize main view, the tableview won't get resized Every time I reopen the project, the tableview would shrink by height. It seems the shrinked height is doubled every time. For example, in the following screenshot, the gap is 56. Next reopen will double the gap to 112. Is this a known bug? I would want to file bug report at https://feedbackassistant.apple.com.
1
1
674
Nov ’23
How to fix: IPA BINARY CODE ANALYSIS in iOS swift
I got MOBSF security check result pdf where i found some "High" - SEVERITY issues Binary makes use of insecure API(s) high CWE: CWE-676: Use of Potentially Dangerous Function OWASP Top 10: M7: Client Code Quality OWASP MASVS: MSTG-CODE-8 The binary may contain the following insecure API(s) _sscanf , _memcpy , _fopen Binary makes use of malloc function high CWE: CWE-789: Uncontrolled Memory Allocation OWASP Top 10: M7: Client Code Quality OWASP MASVS: MSTG-CODE-8 The binary may use _malloc function instead of calloc Anyone who knows about it, please comment it out. Your input would be appreciated. Thanks in Advance
0
0
1.1k
Nov ’23
Need to exclude Watch from Info plist
So I have an iOS app that I inherited written in MS Visual Studio and it worked last year. I had to update it with a new cert and when I did, now I get this error when publishing via Transporter: Asset validation failed (90906) Missing Info.plist value. A value for the key “WKApplication”, or “WKWatchKitApp” if your project has a WatchKit App Extension target, is required in “epass.iOS.app/build/Release-iphoneos/epass.iOS.app” bundle. For details, see: https://developer.apple.com/documentation/watchkit/creating_independent_watchos_apps/setting_up_a_watchos_project (ID: 629ed136-f531-4079-87c2-f91ee6bdcc58) Now I tried adding to the Info.plist: WKApplication WKWatchKitApp That however had no effect. Any thoughts on how to bypass this?
1
0
909
Nov ’23
Extra utun interfaces
I know this has been discussed before, but I can't seem to find a solution for this. I have the following on my machine: utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500 inet6 fe80::76b0:d199:d69b:c85b%utun0 prefixlen 64 scopeid 0xd nd6 options=201<PERFORMNUD,DAD> utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380 inet6 fe80::97b:790d:3666:a064%utun1 prefixlen 64 scopeid 0xf nd6 options=201<PERFORMNUD,DAD> utun2: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000 inet6 fe80::af07:a5a1:f350:ccf3%utun2 prefixlen 64 scopeid 0x10 nd6 options=201<PERFORMNUD,DAD> utun3: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1000 inet6 fe80::ce81:b1c:bd2c:69e%utun3 prefixlen 64 scopeid 0x11 nd6 options=201<PERFORMNUD,DAD> I use GlobalProtect VPN, and that's it.. I uninstalled it, removed the routes for all these tunnels, and restarted my machine. These still remain. I can't find any way to set GP to use utun0 like it used too.. seems it increments from time to time and I can't remove all these extras. I tried disabling other network services like USB and Thunderbolt.. but to no avail. Any help would be greatly appreciated. -- Dan
0
0
1.2k
Nov ’23
NSCollectionView drag n drop; Sections are ignored in the drop's IndexPath
I have a doc, xib based project. it has an NSCollectionView, which properly displays the data. including items and section headers. I have drag n drop enabled where I can drop into the collectionView, and I generate a new object. this is NOT a reordering issue (yet) when I drop into the collectionView, if the drop is on top of a HeaderView, the drop is canceled (before it gets to my delegate code.) But more importantly : the Header views are entirely ignored in every step of the drag and drop. the hinting, only ever shows up adjacent to a collectionViewItemView, Never below or above the section header. The drop ALWAYS has a section of zero in its index path. regardless of where the drop is. I tried to override this behavior in both the validate drop and accept drop methods. with a great deal of frustration and struggle I discovered that I cannot compare the placement of my header views, because the frames of those views are all at the base origin point. is this normal behavior? Has anyone else run into this? is there a fix?
0
0
689
Nov ’23
How to add devices to the device configuration pane in XCODE
I'm using XCODE 15 and trying to add the iPhone XS as a selection option within the device configuration pane. My view controller canvas is limited to the ten iPhone default options that came with XCODE15. While I am able to install and configure an iPhone XS as the device simulator, I can't seem figure out how to change my view controller and canvas to that of an iPhone XS. Welcome any ideas. I've seen some good older posts that relate to much older versions of XCODE, and I've referenced the XCODE documentation such as the interface builder workflow. I'm new to XCODE and still learning, so appreciate any ideas if anyone has figured this out already. For now, my view controller is just set to use the iPhone 11 but it's not quite the same. Thanks.
1
0
2.1k
Nov ’23
modifying labs
I teach Swift coding to high school students. I would like to be able to assign the various labs in the Fundamentals curriculum where I reduce the opportunities for cheating. Students will share images of the coding answers with each other or they can go on the internet to see the answers. I would like individualize the labs for each student. For example: When they have an assignment where the directions require a longitude property to be set to 50.001. Then changed to another number. I would like to automatically generate slightly different numbers in the lab (a different number for each student) and then save this new lab in the intended student's name. Is that possible? Is it easy to do? Harold Peaden
0
0
480
Nov ’23
CarPlay Simulator for Xcode 13.4 not working
Hi, I installed a few versions of Additional Tools for Xcode. I was interested the most in the CarPlay Simulator. I installed the Tools for Xcode 15 - they do not work because of my version of macOS (11.7.4). So I went with the earliest and the latest version of those tools for Xcode 14. They didn't work because I have an Intel machine. I tried the earliest ones for Xcode 13 - they didn't work but I assumed that it could be something to do with the Beta version of the CarPlay Sim (labeled as Beta). I installed the latest version for Xcode 13, labeled as for Xcode 13.4. I tried 3 different devices. iPhone 11 running iOS 17.0.2, iPhone 6s running a version of iOS 15 and an iPhone 13 running some version of iOS 16. All 3 of them connect normally to a CarPlay equipped infotainment system (Discover Media, MIB 3 in a 2021 Volkswagen Caddy). The phones connect to the car both wired and wireless flawlessly, but I cannot connect them to the carplay sim. None devices run any non-finished, unreleased app. The CarPlay Sim recognizes all 3, but in the devices tab the dot is red. I tried turning off personal hotspot, clicking the device name in the devices tab, multiple lightning cables and multiple versions of the CarPlay Simulator. Nothing will work, all 3 phones show "Accesory Not Supported - Your phone does not support this accesory". All cables are MFI certified. All of them are USB-A because my computer is pre-USB-C era. What can possibly be wrong, what can I do?
0
1
803
Nov ’23
UIButton image disappears when “debug executable” is unchecked in edit scheme
I have created a UIButton in storyboard, and have set an image for the UIButton (the image is in assets.xcassets). The button shows up in the simulator and when run on an iPhone. However, if I quit the app on the iPhone and open it again, the button disappears, but I am still able to click it and it works. The same thing happens when I uncheck "debug executable." When I check the view hierarchy, the button is on top of the hierarchy but is invisible. Using infoButton.isHidden = false also does not work. In my button's view controller, I have called view.bringSubviewToFront(_: infoButton) in viewDidLoad(). I have also tried setting the button's image programmatically, but it still doesn't show up. However, when I set a background color for the button with infoButton.backgroundColor = UIColor.blue, I can see a blue box where the button should be, but no image. Here are my settings for the UIButton: I would appreciate any help, thank you.
2
1
2k
Oct ’23
Firebase and Compiling errors with Xcode 15.0 beta 2
I am getting the following errors when I attempt to build my project since I updated Xcode to Version 15.0 beta 2 (15A5161b). I am wondering if anyone could help me figure it out as I have already cleared the cache and the build folder as well as reinstalling the firebase package entirely. Here are the two errors I have been receiving: "failed to verify module interface of 'Project_Name' due to the errors above; the textual interface may be broken by project issues or a compiler bug" (The code on the line this error is on is on a autogenerated file titled "Project_Title.private" and cannot be edited, "// swift-interface-format-version: 1.0") The other error I assume also has to do with the above issue, "no such module as 'firebase'" ( the code on line of question is "import Firebase".) I would appreciate ay help I could get because I cannot find any documentation or similar problems. I have attached screenshots below for your convenience. Thank you for your help!
5
2
2.2k
Oct ’23
Xcode Preview is not working
I've encountered while attempting to integrate SwiftUI into an existing UIKit project. Specifically, I have experienced recurring view crashes when creating new SwiftUI views within the project. My Feedback id is FB13509337 I would appreciate your assistance in resolving this matter promptly, as it is critical to the development of our application. Your prompt attention to this issue would be greatly appreciated
Replies
1
Boosts
0
Views
711
Activity
Jan ’24
Getting Err 'Command CompileStoryboard failed with a nonzero exit code'
Hi, I Just Updated MacOS and XCode and then tried to Build App. Now it suddenly started throwing Error: Command CompileStoryboard failed with a nonzero exit code I've tried a few solutions but none worked. Got following Error: 2023-12-27 16:14:06.315 ibtoold[70732:612834] [MT] DVTAssertions: ASSERTION FAILURE in IDEInterfaceBuilder/AutolayoutFoundation/Model/Constraints/IBLayoutConstraint.m:1141 Details: We only understand width/height, not 0x3 Object: &lt;IBLayoutConstraint: 0x600001772c80&gt; Method: -absoluteGeometricDescriptionInCoordinateSpaceOfView:userInterfaceLayoutDirection:ofItem:attribute: Thread: &lt;_NSMainThread: 0x600002e780c0&gt;{number = 1, name = main} Hints: Backtrace: 0 -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation) 1 _DVTAssertionHandler (in DVTFoundation) 2 _DVTAssertionFailureHandler (in DVTFoundation) 3 -[IBLayoutConstraint absoluteGeometricDescriptionInCoordinateSpaceOfView:userInterfaceLayoutDirection:ofItem:attribute:] (in IBAutolayoutFoundation) 4 -[IBLayoutConstraint geometricDescriptionInCoordinateSpaceOfView:userInterfaceLayoutDirection:] (in IBAutolayoutFoundation) 5 -[IBLayoutConstraint geometricCompare:withUserInterfaceLayoutDirection:] (in IBAutolayoutFoundation) 6 -[IBLayoutConstraint compare:withUserInterfaceLayoutDirection:] (in IBAutolayoutFoundation) 7 __63-[NSView(IBViewIntegration) ibConstraintComparatorForDocument:]_block_invoke (in IDEInterfaceBuilderKit) 8 __CFSimpleMergeSort (in CoreFoundation) 9 __CFSimpleMergeSort (in CoreFoundation) 10 CFSortIndexes (in CoreFoundation) 11 -[NSMutableOrderedSet sortRange:options:usingComparator:] (in CoreFoundation) 12 -[NSView(IBViewIntegration) ibPrimitiveAddConstraintsToCandidateListOnly:thatAreAlreadyInDocument:] (in IDEInterfaceBuilderKit) 13 __53-[NSView(IBViewIntegration) _ibUnarchiveConstraints:]_block_invoke_2 (in IDEInterfaceBuilderKit) 14 __NSDICTIONARY_IS_CALLING_OUT_TO_A_BLOCK__ (in CoreFoundation) 15 __NSDictionaryEnumerate (in CoreFoundation) 16 __53-[NSView(IBViewIntegration) _ibUnarchiveConstraints:]_block_invoke (in IDEInterfaceBuilderKit) 17 __76-[IBDocumentUnarchiver registerDelayedReferenceUnarchivingOfType:withBlock:]_block_invoke_2 (in IDEInterfaceBuilderKit) 18 -[IBDocumentUnarchiver recurseWithElement:kind:invokingBlock:] (in IDEInterfaceBuilderKit) 19 __76-[IBDocumentUnarchiver registerDelayedReferenceUnarchivingOfType:withBlock:]_block_invoke (in IDEInterfaceBuilderKit) 20 -[IBDocumentUnarchiver enableUnarchivingReferencesOfType:] (in IDEInterfaceBuilderKit) 21 -[IBDocument unarchivePlatformIndependentDataWithUnarchiver:error:] (in IDEInterfaceBuilderKit) 22 -[IBStoryboardDocument unarchivePlatformIndependentDataWithUnarchiver:error:] (in IDEInterfaceBuilderKit) 23 -[IBDocument unarchiveDocumentWithUnarchiver:error:] (in IDEInterfaceBuilderKit) 24 __48-[IBDocumentUnarchiver unarchiveDocument:error:]_block_invoke (in IDEInterfaceBuilderKit) 25 -[IBDocumentUnarchiver recurseWithElement:kind:invokingBlock:] (in IDEInterfaceBuilderKit) 26 -[IBDocumentUnarchiver unarchiveDocument:error:] (in IDEInterfaceBuilderKit) 27 __61-[IBDocument decodeContentsOfURL:ofType:decodingStyle:error:]_block_invoke (in IDEInterfaceBuilderKit) 28 -[IBDocumentAutolayoutManager ignoreAutolayoutStatusInvalidationDuring:] (in IDEInterfaceBuilderKit) 29 -[IBDocument ignoreAutolayoutStatusInvalidationDuring:] (in IDEInterfaceBuilderKit) 30 -[IBDocument decodeContentsOfURL:ofType:decodingStyle:error:] (in IDEInterfaceBuilderKit) 31 -[IBDocument readFromURL:ofType:error:] (in IDEInterfaceBuilderKit) 32 IBLoadDocument (in ibtoold) 33 -[IBCLIInterfaceBuilderToolPersona invokeArguments:outputDictionary:] (in ibtoold) 34 -[IBCLIInterfaceBuilderToolPersona runSingleInvocation:outputtingToFileHandle:andVerifyingEnvironment:] (in ibtoold) 35 IBCLIServerRunSingleInvocation (in ibtoold) 36 __IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess_block_invoke_2 (in ibtoold) 37 __IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess_block_invoke (in ibtoold) 38 -[IBCLIErrorForwarder forwardErrorOutputToDescriptor:whileInvokingBlock:] (in ibtoold) 39 IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess (in ibtoold) 40 main (in ibtoold) 41 start (in dyld) Command CompileStoryboard failed with a nonzero exit code Any help would be highly Appreciable.
Replies
0
Boosts
1
Views
987
Activity
Jan ’24
GridView addRow height problem
I am trying to add rows to GridView and not able to get expected row height correctly. override func viewDidLoad() { super.viewDidLoad() // Remove the row in IB designer gridView.removeRow(at: 0) let image = NSImage(named: NSImage.colorPanelName)! //image.size = NSMakeSize(80, 80) let imageView = NSImageView(image: image) imageView.imageFrameStyle = .grayBezel imageView.imageScaling = .scaleAxesIndependently imageView.frame = NSMakeRect(0, 0, 80, 80) let label = NSTextField(labelWithString: "test text") let row = gridView.addRow(with: [imageView, label]) row.height = 80 } What was wrong with my code?
Replies
5
Boosts
0
Views
963
Activity
Jan ’24
Image is nil while I'm trying to rotate it
So, i am making an app in which you enter coordinates, confirm them, and then an arrow pops up that shows the direction to the place which coordinates user entered. However when i click confirm, the arrow shows up but doesnt rotate. When i tried some troubleshooting, i found out that arrowImageView is nil. Can anyone please help? ` import UIKit import CoreLocation extension CGFloat { func toRadians() -> CGFloat { return self * CGFloat.pi / 180.0 } } class ViewController: UIViewController { @IBOutlet weak var Latitude_text: UITextField! @IBOutlet weak var Longitude_text: UITextField! @IBOutlet var arrowImageView: UIImageView! let locationManager = CLLocationManager() var destinationCoordinate: CLLocationCoordinate2D? override func viewDidLoad() { super.viewDidLoad() locationManager.delegate = self locationManager.requestWhenInUseAuthorization() locationManager.startUpdatingLocation() locationManager.startUpdatingHeading() } @IBAction func Latitude_import(_ sender: Any) { validateCoordinates() } @IBAction func Longitude_input(_ sender: Any) { validateCoordinates() } @IBAction func confirmButtonTapped(_ sender: UIButton) { validateCoordinates() performSegue(withIdentifier: "ShowArrowScreen", sender: self) } func validateCoordinates() { guard var latitudeText = Latitude_text?.text, !latitudeText.isEmpty, var longitudeText = Longitude_text?.text, !longitudeText.isEmpty else { // Handle empty fields print("Invalid coordinates. Please enter valid latitude and longitude.") return } // Replace commas with dots latitudeText = latitudeText.replacingOccurrences(of: ",", with: ".") longitudeText = longitudeText.replacingOccurrences(of: ",", with: ".") guard let latitude = Double(latitudeText), let longitude = Double(longitudeText) else { // Handle invalid text print("Invalid coordinates. Please enter valid latitude and longitude.") return } destinationCoordinate = CLLocationCoordinate2D(latitude: latitude, longitude: longitude) updateUIWithBearing() } func calculateBearing(from source: CLLocationCoordinate2D, to destination: CLLocationCoordinate2D) -> Double { let theta = atan2(destination.longitude - source.longitude, destination.latitude - source.latitude) return (theta * (180.0 / .pi) + 360.0).truncatingRemainder(dividingBy: 360.0) } func updateUIWithBearing() { guard let currentLocation = locationManager.location, let destination = destinationCoordinate else { print("Error: Could not retrieve location or destination coordinates.") return } let bearing = calculateBearing(from: currentLocation.coordinate, to: destination) print("Bearing to destination: \(bearing) degrees") rotateArrow(bearing: CGFloat(bearing)) } func rotateArrow(bearing: CGFloat) { print("Rotate Arrow function called.") guard let arrowImageView = arrowImageView else { print("Error: Arrow image view is nil.") return } guard let frameworkBundle = Bundle(identifier: "com.myframework.name") else { print("Error: Unable to load framework bundle.") return } guard let arrowImage = UIImage(named: "myImage", in: frameworkBundle, compatibleWith: nil) else { print("Error: Arrow image is nil.") return } arrowImageView.image = arrowImage let radians = bearing.toRadians() UIView.animate(withDuration: 0.5, animations: { arrowImageView.transform = CGAffineTransform.identity.rotated(by: radians) }) { _ in print("Rotation animation completed.") } } } extension ViewController: CLLocationManagerDelegate { func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) { let heading = newHeading.trueHeading print("Current heading: \(heading) degrees") } func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { if let location = locations.last { print("Updated location: \(location.coordinate.latitude), \(location.coordinate.longitude)") } } }
Replies
0
Boosts
0
Views
655
Activity
Jan ’24
Add a button...
Hi. I can't add a Button component to my cocoa resource (.nib) I have xCode version 15.1.
Replies
0
Boosts
0
Views
583
Activity
Dec ’23
Outlets do not work correctly with ViewControllers that inherit from the framework's ViewController
I am creating and selling a third-party SDK. The framework includes a subclass of UIViewController named BaseViewController. I also provide the subclass of BaseViewController (ChildViewController) as *.swift source code and xib file to be integrated into the application along with the *.framework. I encountered an issue during this integration. I cannot access the view property of the parent class UIViewController from .xib file of the ChildViewController which is integrated into the application. Please advise me on how to avoid this issue. I have prepared specific source code and screenshots. I will attach them and send them in a subsequent email.
Replies
0
Boosts
0
Views
542
Activity
Dec ’23
Setup in Unity for Xcode with Toolchains
I'm using iXGuard for my Unity Project and need to build on XCode with iXGuard Toolchains (Xcode menu -> Toolchains -> select iXGuard Toolchains, and also need to add a new script for Post Action (Product -> Scheme -> Edit Scheme -> Archive -> Post-actions ) The question is how can I setup/add in Unity to configure for it instead of manual configure on Xcode?
Replies
0
Boosts
0
Views
671
Activity
Dec ’23
Are storyboard and UIKit due to disappear ?
I read in Xcode 15.2 release notes that @IBDesignable and @Inspectable are deprecated and will disappear in a future release. After the abandon of WatchKit and its storyboard, replaced by SwiftUI, does it mean storyboards (and consequently UIKit) will progressively disappear, leaving developers alone with SwiftUI to design apps (IMHO, inadequate to design complex UI: for instance, I always struggle to position precisely objects for all devices sizes as we miss constraints manager in SwiftUI) ? For sure, IBDesignable is (was) whimsical, but a very useful tool to design sophisticated UI. Replacing by #Preview does not make it. I also understand that Xcode is a very complex piece of code and that maintaining and evolving some tools (as IBDesignable) requires effort. But isn't it what we expect from Apple ? To provide us with the best tools and keep on the promise of WYSIWYG environments, all along ? Is it only me or do others share this view ?
Replies
2
Boosts
0
Views
2.9k
Activity
Dec ’23
Weird problem of NSTableView with auto layout
I have had this issue for a long time. If I configure any auto layout constraints in TableViewCell, I get extremely weird layout behavior in IB designer; however, layout is completely good during runtime. For example, with a completely new project and a single NSTableView on the main view, I get: If I resize main view, the tableview won't get resized Every time I reopen the project, the tableview would shrink by height. It seems the shrinked height is doubled every time. For example, in the following screenshot, the gap is 56. Next reopen will double the gap to 112. Is this a known bug? I would want to file bug report at https://feedbackassistant.apple.com.
Replies
1
Boosts
1
Views
674
Activity
Nov ’23
How to fix: IPA BINARY CODE ANALYSIS in iOS swift
I got MOBSF security check result pdf where i found some "High" - SEVERITY issues Binary makes use of insecure API(s) high CWE: CWE-676: Use of Potentially Dangerous Function OWASP Top 10: M7: Client Code Quality OWASP MASVS: MSTG-CODE-8 The binary may contain the following insecure API(s) _sscanf , _memcpy , _fopen Binary makes use of malloc function high CWE: CWE-789: Uncontrolled Memory Allocation OWASP Top 10: M7: Client Code Quality OWASP MASVS: MSTG-CODE-8 The binary may use _malloc function instead of calloc Anyone who knows about it, please comment it out. Your input would be appreciated. Thanks in Advance
Replies
0
Boosts
0
Views
1.1k
Activity
Nov ’23
Need to exclude Watch from Info plist
So I have an iOS app that I inherited written in MS Visual Studio and it worked last year. I had to update it with a new cert and when I did, now I get this error when publishing via Transporter: Asset validation failed (90906) Missing Info.plist value. A value for the key “WKApplication”, or “WKWatchKitApp” if your project has a WatchKit App Extension target, is required in “epass.iOS.app/build/Release-iphoneos/epass.iOS.app” bundle. For details, see: https://developer.apple.com/documentation/watchkit/creating_independent_watchos_apps/setting_up_a_watchos_project (ID: 629ed136-f531-4079-87c2-f91ee6bdcc58) Now I tried adding to the Info.plist: WKApplication WKWatchKitApp That however had no effect. Any thoughts on how to bypass this?
Replies
1
Boosts
0
Views
909
Activity
Nov ’23
Extra utun interfaces
I know this has been discussed before, but I can't seem to find a solution for this. I have the following on my machine: utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500 inet6 fe80::76b0:d199:d69b:c85b%utun0 prefixlen 64 scopeid 0xd nd6 options=201<PERFORMNUD,DAD> utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380 inet6 fe80::97b:790d:3666:a064%utun1 prefixlen 64 scopeid 0xf nd6 options=201<PERFORMNUD,DAD> utun2: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000 inet6 fe80::af07:a5a1:f350:ccf3%utun2 prefixlen 64 scopeid 0x10 nd6 options=201<PERFORMNUD,DAD> utun3: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1000 inet6 fe80::ce81:b1c:bd2c:69e%utun3 prefixlen 64 scopeid 0x11 nd6 options=201<PERFORMNUD,DAD> I use GlobalProtect VPN, and that's it.. I uninstalled it, removed the routes for all these tunnels, and restarted my machine. These still remain. I can't find any way to set GP to use utun0 like it used too.. seems it increments from time to time and I can't remove all these extras. I tried disabling other network services like USB and Thunderbolt.. but to no avail. Any help would be greatly appreciated. -- Dan
Replies
0
Boosts
0
Views
1.2k
Activity
Nov ’23
NSCollectionView drag n drop; Sections are ignored in the drop's IndexPath
I have a doc, xib based project. it has an NSCollectionView, which properly displays the data. including items and section headers. I have drag n drop enabled where I can drop into the collectionView, and I generate a new object. this is NOT a reordering issue (yet) when I drop into the collectionView, if the drop is on top of a HeaderView, the drop is canceled (before it gets to my delegate code.) But more importantly : the Header views are entirely ignored in every step of the drag and drop. the hinting, only ever shows up adjacent to a collectionViewItemView, Never below or above the section header. The drop ALWAYS has a section of zero in its index path. regardless of where the drop is. I tried to override this behavior in both the validate drop and accept drop methods. with a great deal of frustration and struggle I discovered that I cannot compare the placement of my header views, because the frames of those views are all at the base origin point. is this normal behavior? Has anyone else run into this? is there a fix?
Replies
0
Boosts
0
Views
689
Activity
Nov ’23
Customize number of lines for title and sub-title in a notification
Currently, in my app number of lines for a title and sub-title in a notification is only one. Is there a way to customize the number of lines for a title and sub-title like how we cusomize it in the expandable mode?
Replies
0
Boosts
0
Views
576
Activity
Nov ’23
How to add devices to the device configuration pane in XCODE
I'm using XCODE 15 and trying to add the iPhone XS as a selection option within the device configuration pane. My view controller canvas is limited to the ten iPhone default options that came with XCODE15. While I am able to install and configure an iPhone XS as the device simulator, I can't seem figure out how to change my view controller and canvas to that of an iPhone XS. Welcome any ideas. I've seen some good older posts that relate to much older versions of XCODE, and I've referenced the XCODE documentation such as the interface builder workflow. I'm new to XCODE and still learning, so appreciate any ideas if anyone has figured this out already. For now, my view controller is just set to use the iPhone 11 but it's not quite the same. Thanks.
Replies
1
Boosts
0
Views
2.1k
Activity
Nov ’23
modifying labs
I teach Swift coding to high school students. I would like to be able to assign the various labs in the Fundamentals curriculum where I reduce the opportunities for cheating. Students will share images of the coding answers with each other or they can go on the internet to see the answers. I would like individualize the labs for each student. For example: When they have an assignment where the directions require a longitude property to be set to 50.001. Then changed to another number. I would like to automatically generate slightly different numbers in the lab (a different number for each student) and then save this new lab in the intended student's name. Is that possible? Is it easy to do? Harold Peaden
Replies
0
Boosts
0
Views
480
Activity
Nov ’23
CarPlay Simulator for Xcode 13.4 not working
Hi, I installed a few versions of Additional Tools for Xcode. I was interested the most in the CarPlay Simulator. I installed the Tools for Xcode 15 - they do not work because of my version of macOS (11.7.4). So I went with the earliest and the latest version of those tools for Xcode 14. They didn't work because I have an Intel machine. I tried the earliest ones for Xcode 13 - they didn't work but I assumed that it could be something to do with the Beta version of the CarPlay Sim (labeled as Beta). I installed the latest version for Xcode 13, labeled as for Xcode 13.4. I tried 3 different devices. iPhone 11 running iOS 17.0.2, iPhone 6s running a version of iOS 15 and an iPhone 13 running some version of iOS 16. All 3 of them connect normally to a CarPlay equipped infotainment system (Discover Media, MIB 3 in a 2021 Volkswagen Caddy). The phones connect to the car both wired and wireless flawlessly, but I cannot connect them to the carplay sim. None devices run any non-finished, unreleased app. The CarPlay Sim recognizes all 3, but in the devices tab the dot is red. I tried turning off personal hotspot, clicking the device name in the devices tab, multiple lightning cables and multiple versions of the CarPlay Simulator. Nothing will work, all 3 phones show "Accesory Not Supported - Your phone does not support this accesory". All cables are MFI certified. All of them are USB-A because my computer is pre-USB-C era. What can possibly be wrong, what can I do?
Replies
0
Boosts
1
Views
803
Activity
Nov ’23
Creating a "navigation list" like in Front Row using Interface Builder
I'm making an app for the Apple TV in Swift and I want the main menu of the app to be sorted in a list, like in Front Row. I couldn't find any components which would allow this. Do I have to make one myself? Is there a component like this available in UIKit?
Replies
0
Boosts
0
Views
632
Activity
Nov ’23
UIButton image disappears when “debug executable” is unchecked in edit scheme
I have created a UIButton in storyboard, and have set an image for the UIButton (the image is in assets.xcassets). The button shows up in the simulator and when run on an iPhone. However, if I quit the app on the iPhone and open it again, the button disappears, but I am still able to click it and it works. The same thing happens when I uncheck "debug executable." When I check the view hierarchy, the button is on top of the hierarchy but is invisible. Using infoButton.isHidden = false also does not work. In my button's view controller, I have called view.bringSubviewToFront(_: infoButton) in viewDidLoad(). I have also tried setting the button's image programmatically, but it still doesn't show up. However, when I set a background color for the button with infoButton.backgroundColor = UIColor.blue, I can see a blue box where the button should be, but no image. Here are my settings for the UIButton: I would appreciate any help, thank you.
Replies
2
Boosts
1
Views
2k
Activity
Oct ’23
Firebase and Compiling errors with Xcode 15.0 beta 2
I am getting the following errors when I attempt to build my project since I updated Xcode to Version 15.0 beta 2 (15A5161b). I am wondering if anyone could help me figure it out as I have already cleared the cache and the build folder as well as reinstalling the firebase package entirely. Here are the two errors I have been receiving: "failed to verify module interface of 'Project_Name' due to the errors above; the textual interface may be broken by project issues or a compiler bug" (The code on the line this error is on is on a autogenerated file titled "Project_Title.private" and cannot be edited, "// swift-interface-format-version: 1.0") The other error I assume also has to do with the above issue, "no such module as 'firebase'" ( the code on line of question is "import Firebase".) I would appreciate ay help I could get because I cannot find any documentation or similar problems. I have attached screenshots below for your convenience. Thank you for your help!
Replies
5
Boosts
2
Views
2.2k
Activity
Oct ’23