interface-builder

Link Storyboard to UIViewController with Generic

喜你入骨 提交于 2020-04-08 10:42:45
问题 I have this view controller, meant to present model object details in a generic way: class APIModelDetailsVC<T where T: APIModel>: UIViewController {...} I'd like my storyboard to use this class. I'm able to assign it in Interface Builder: I do the preparation of this ViewController in a tableview's didSelect method (including specifying the type for the generic placeholder): override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { print(

menu item is enabled, but still grayed out

青春壹個敷衍的年華 提交于 2020-04-08 02:51:37
问题 I have a menu with several items created in interface builder. It looks fine there and 'enabled' is checked. But when I run application, all menu items are grayed out. I've checked isEnabled , it returns true. Also, menu items created programmatically (with initWithTitle and without interface builder) work just fine. Am I missing something here? I'm really quite new to OSX development (in fact, this is my first day). Thank you 回答1: Remember to set your menu item's target and ensure that said

menu item is enabled, but still grayed out

北城余情 提交于 2020-04-08 02:50:27
问题 I have a menu with several items created in interface builder. It looks fine there and 'enabled' is checked. But when I run application, all menu items are grayed out. I've checked isEnabled , it returns true. Also, menu items created programmatically (with initWithTitle and without interface builder) work just fine. Am I missing something here? I'm really quite new to OSX development (in fact, this is my first day). Thank you 回答1: Remember to set your menu item's target and ensure that said

menu item is enabled, but still grayed out

断了今生、忘了曾经 提交于 2020-04-08 02:49:00
问题 I have a menu with several items created in interface builder. It looks fine there and 'enabled' is checked. But when I run application, all menu items are grayed out. I've checked isEnabled , it returns true. Also, menu items created programmatically (with initWithTitle and without interface builder) work just fine. Am I missing something here? I'm really quite new to OSX development (in fact, this is my first day). Thank you 回答1: Remember to set your menu item's target and ensure that said

Not able to set proportional height for a UIView in storyboard in Xcode 11

柔情痞子 提交于 2020-03-04 23:10:45
问题 When I am trying to set the width of a UIView to be proportional to the superview from storyboard the option is not showing up in Xcode 11. But in Xcode 10 it's showing the "Equal Widths" and "Equal Heights" option. 回答1: Works fine for me in Xcode 11.2: 来源: https://stackoverflow.com/questions/58683474/not-able-to-set-proportional-height-for-a-uiview-in-storyboard-in-xcode-11

Not able to set proportional height for a UIView in storyboard in Xcode 11

会有一股神秘感。 提交于 2020-03-04 23:07:25
问题 When I am trying to set the width of a UIView to be proportional to the superview from storyboard the option is not showing up in Xcode 11. But in Xcode 10 it's showing the "Equal Widths" and "Equal Heights" option. 回答1: Works fine for me in Xcode 11.2: 来源: https://stackoverflow.com/questions/58683474/not-able-to-set-proportional-height-for-a-uiview-in-storyboard-in-xcode-11

Weird animations when editing custom cell?

瘦欲@ 提交于 2020-03-04 21:31:12
问题 I created a UITableViewCell in Xcode 4 using IB. But for some weird reason when I trigger my edit button, the cell acts really weird and doesn't have the same animations as a normal table view cell. I don't know what is happening, I tried implementing -(void)setEditing:(BOOL)editing animated:(BOOL)animated in my custom cell class but still nothing works. UPDATE: My ViewController that I am using the cell in, has this code under cellForAtIndex to display the cell. CustomCell *cell =

Weird animations when editing custom cell?

拈花ヽ惹草 提交于 2020-03-04 21:27:50
问题 I created a UITableViewCell in Xcode 4 using IB. But for some weird reason when I trigger my edit button, the cell acts really weird and doesn't have the same animations as a normal table view cell. I don't know what is happening, I tried implementing -(void)setEditing:(BOOL)editing animated:(BOOL)animated in my custom cell class but still nothing works. UPDATE: My ViewController that I am using the cell in, has this code under cellForAtIndex to display the cell. CustomCell *cell =

Xcode 11 add new constraints set zero: use set value instead of default / standard

妖精的绣舞 提交于 2020-02-26 04:52:09
问题 I used to use autolayout add new constraints to make simple constraints to superview / relative view like this (for loooong time): However, recently after updated to the latest xcode (11.3.3 or just 11.3/11C29), I have this weird issue: when I set the constant = 0, they always generate the constraints in an unwanted way like this: And it seems default value is somehow 20 and making my view look so wrong (0 compared to 20?) If I fix that by edit the constraint like this: Then it'll correct

Xcode 11 add new constraints set zero: use set value instead of default / standard

我与影子孤独终老i 提交于 2020-02-26 04:51:48
问题 I used to use autolayout add new constraints to make simple constraints to superview / relative view like this (for loooong time): However, recently after updated to the latest xcode (11.3.3 or just 11.3/11C29), I have this weird issue: when I set the constant = 0, they always generate the constraints in an unwanted way like this: And it seems default value is somehow 20 and making my view look so wrong (0 compared to 20?) If I fix that by edit the constraint like this: Then it'll correct