Post

Replies

Boosts

Views

Activity

Reply to How to Center an App Icon Image Vertically in a UITableViewCell
In response to Richard, Thank you for your response! I've tried the centerYAnchor and it just clips the label when the text size gets too large. I've provided my label constraint code below, as well as a picture showing the outcome. Constraint Code // App Icon Image [self.appIconImage.centerYAnchor constraintEqualToAnchor: self.colorLabel.centerYAnchor], [self.appIconImage.leadingAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.leadingAnchor], // Label [self.colorLabel.leadingAnchor constraintEqualToAnchor:self.appIconImage.trailingAnchor constant: 10], [self.colorLabel.trailingAnchor constraintEqualToAnchor:self.contentView.layoutMarginsGuide.trailingAnchor], [self.colorLabel.topAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.topAnchor], [self.colorLabel.bottomAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.bottomAnchor], Picture
Topic: UI Frameworks SubTopic: UIKit Tags:
1w
Reply to How to Constrain a TableView Cell Similarly to Apple's Settings App
I was able to set the constraints conditionally using the UIContentSizeCatagory. - (void) setConstraints { // Get the current size catagory of the text UIContentSizeCategory catagory = self.traitCollection.preferredContentSizeCategory; // Put the label on the trailing edge of the cell if the Dynamic Text size is less than large if (catagory < UIContentSizeCategoryAccessibilityLarge) { [NSLayoutConstraint activateConstraints:@[ // Cell Title Label [self.themeColorLabel.leadingAnchor constraintEqualToAnchor:self.contentView.layoutMarginsGuide.leadingAnchor], [self.themeColorLabel.trailingAnchor constraintEqualToAnchor:self.contentView.layoutMarginsGuide.trailingAnchor], [self.themeColorLabel.topAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.topAnchor], [self.themeColorLabel.bottomAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.bottomAnchor], // Selected Theme Color Label [self.selectedColorLabel.trailingAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.trailingAnchor], [self.selectedColorLabel.topAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.topAnchor], [self.selectedColorLabel.bottomAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.bottomAnchor], ]]; // Put the label below the title in sizes greater than large } else { [NSLayoutConstraint activateConstraints:@[ // Cell Title Label [self.themeColorLabel.leadingAnchor constraintEqualToAnchor:self.contentView.layoutMarginsGuide.leadingAnchor], [self.themeColorLabel.trailingAnchor constraintEqualToAnchor:self.contentView.layoutMarginsGuide.trailingAnchor], [self.themeColorLabel.topAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.topAnchor], // Selected Theme Color Label [self.selectedColorLabel.leadingAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.leadingAnchor], [self.selectedColorLabel.trailingAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.trailingAnchor], [self.selectedColorLabel.topAnchor constraintEqualToAnchor: self.themeColorLabel.bottomAnchor], [self.selectedColorLabel.bottomAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.bottomAnchor], ]]; } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Nov ’25
Reply to Conditionally Adding and Deleting a Row in a UITableView
My tip percentage slider is a Segmented Control, with options ranging from 0% to 20% and then 'Any' is the custom value. When the user selects the 'Any' value, I want to be able to have a TextField appear below it, and then disappear when the user selects a value other than 'Any'. if (isTipPercentageCustom) { // Show the Text Field // Perform calculation, etc. } else { // Hide Text Field } I want to create it once, and then just keep showing and hiding it since I have to keep it in memory until the app closes. Is this even possible with a Segmented Control? Does that clarify it a little bit?
Topic: UI Frameworks SubTopic: UIKit Tags:
Jun ’25
Reply to How to Create Applications with Objective-C Without ARC
Hello! Thank you for your response! I'll take a look at them! Honestly, I should've been more clear about what I wanted to make. I just wanted to make some simple apps, not being released on the App Store, using Objective-C and UIKit, but using modern versions of iOS such as iOS 15+. This will definitely help me on understanding ARC and memory management! Thank you!
Topic: Programming Languages SubTopic: General Tags:
May ’25