Interface Builder

RSS for tag

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

Interface Builder Documentation

Posts under Interface Builder tag

107 Posts
Sort by:
Post marked as solved
5 Replies
429 Views
I have started a course on IOS app development. I learnt about basic stuff about the interface like how to add buttons and constraints and stuff. Now I need to add the function to the button in the assistant editor. But it does not let me edit, delete or type anything with it. First I thought i opened the wrong editor but I even tried a shortcut ( control + option + command + return ) and it opens the same editor. I have been stuck on this for the past week. Please suggest :)
Posted Last updated
.
Post marked as solved
2 Replies
1k Views
The need is to persist between launches the state of storyboard objects such as of type UISwitch, UITextField, etc. Can this be done using @AppStorage? If so how can @AppStorage be set to watch these? I tried getting @AppStorage to watch an outlet class member variable that is connected to the storyboard object: @IBOutlet weak var iPhoneName: UITextField! @AppStorage("iPhoneName") var iPhoneName: String = "" This got an error because the variable to be watched is already declared. I decided to make the the watched variable different than the one connected to the Storyboard's UITextField object: @AppStorage("iPhoneName") var striPhoneName: String = "" and got the error: Unknown attribute 'AppStorage' . In what import library is @AppStorage defined? If @AppStorage cannot be used for this, what is the easiest way to code storyboard object persistence? I am looking for an easy, and quick way. I am not concerned with memory usage right now.
Posted
by spflanze.
Last updated
.
Post not yet marked as solved
0 Replies
283 Views
I’m having problems implementing a rather simple concept in a Storyboard (for backward compatibility) using IB, and am wondering if I can ask for help using one of my TSI’s? I’m trying to create a simple 5 or 6 text line app, which takes up about half an iPhone 12 screen in portrait, but then still only takes up about half the screen when rotated into landscape? I haven’t figured out how to do this. Trying to insert some blank imageviews as vertical separators, but can’t get them to be proportional when rotated. Also, please be kind - I’m a COBOL/FORTRAN/Assembler programmer from the 60’s and struggling through the Swift era. I did have a few apps on the app store at one time (objective C), but that was a while ago and struggling to keep up. Thanks in advance.
Posted Last updated
.
Post not yet marked as solved
1 Replies
383 Views
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
Posted
by Qazi09.
Last updated
.
Post not yet marked as solved
0 Replies
525 Views
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.
Posted Last updated
.
Post not yet marked as solved
5 Replies
511 Views
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?
Posted
by imneo.
Last updated
.
Post not yet marked as solved
0 Replies
327 Views
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)") } } }
Posted
by VojTek.
Last updated
.
Post not yet marked as solved
0 Replies
302 Views
Hi. I can't add a Button component to my cocoa resource (.nib) I have xCode version 15.1.
Posted Last updated
.
Post not yet marked as solved
0 Replies
286 Views
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.
Posted Last updated
.
Post not yet marked as solved
0 Replies
355 Views
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?
Posted
by LeHuuChi.
Last updated
.
Post not yet marked as solved
0 Replies
412 Views
I have a view in storyboard, with a tableView and a coloured UIView. The UIView is declared after tableView, so it appears on top of tableView. However, it appears semi transparent over the tableView. In addition, I cannot set its alpha channel to values other than 1 or 0 (e.g., 0.9) But if I create the view programmatically, the view if fully opaque as expected. What am I missing ?
Posted
by Claude31.
Last updated
.
Post marked as solved
1 Replies
850 Views
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 ?
Posted
by Claude31.
Last updated
.
Post not yet marked as solved
0 Replies
388 Views
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.
Posted
by imneo.
Last updated
.
Post not yet marked as solved
1 Replies
1.1k Views
I received the MOBSF security check result PDF, where I found some "High" severity issues. 1.Binary makes use of insecure API(s) with 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. 2.Binary makes use of the malloc function with high CWE: CWE-789: Uncontrolled Memory Allocation OWASP Top 10: M7: Client Code Quality OWASP MASVS: MSTG-CODE-8. The binary may use the _malloc function instead of calloc. I have utilized a static analyzer, but I am unable to identify the APIs such as _sscanf and others in my codebase. This issue is not being shown in Xcode IDE either. I have attempted static analysis in Xcode using the approach: Product -> Analyze, but I am still unable to identify the mentioned issues. Can anyone please help me overcome this scenario and successfully pass the MOBSF test? Thanks in Advance
Posted Last updated
.
Post not yet marked as solved
0 Replies
484 Views
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
Posted Last updated
.
Post not yet marked as solved
1 Replies
436 Views
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?
Posted Last updated
.
Post not yet marked as solved
0 Replies
463 Views
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
Posted
by dlogcher.
Last updated
.
Post not yet marked as solved
0 Replies
358 Views
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?
Posted
by eblu.
Last updated
.
Post marked as Apple Recommended
513 Views
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.
Posted
by Roberto1.
Last updated
.