iboutlet

How to loop through Outlets of a UIViewController with Swift

一笑奈何 提交于 2019-11-27 15:42:39
I'm wondering, if it's possible to loop through all outlets of a UIViewController with swift. Specificly, I want to check if every textfield is filled by the user. This is what Outlet Collections are for. Drag all your textfields in the same Outlet Collection in InterfaceBuilder and create an @IBOutlet to that collection in your class file: To create the outlet collection in InterfaceBuilder, ctrl-drag from the first UITextField to your class file in the assistant editor. Then choose Outlet Collection : ctrl-drag the next UITextField on that @IBOutlet to add it to the collection: Repeat that

Strange error when adding items to prototype cells in storyboard-IB

£可爱£侵袭症+ 提交于 2019-11-27 11:05:21
问题 I have quite a large project (~20 scenes). One of which is a TableViewController with a custom UITableViewController class. I have given the cell a reuse identifier, and added a label to it. When I try and Ctrl+Drag the label to the UITableViewController header file to create an outlet, I get the following error: error: Illegal Configuration: Connection "tableInfoView" cannot have a prototype object as its destination. What is this? Am I overlooking something obvious? Or do I need to create a

Connect outlet of a Cell Prototype in a storyboard

孤人 提交于 2019-11-27 10:41:21
I'm a newbie with the Storyboard and so I have some difficulties... I have created a TableViewController and I would like to customize the Cell Prototype. In the Cell Prototype I have added several Labels I would like to customize with my own class which inherits from UITableViewCell (AreaListCell). In the Storyboard, for the Cell Prototype I have configured the Custom Class with "AreaListCell" and its style is "Custom". In the storyboard, when I select the Cell Prototype and then the assistant, the assistant display my class that implements the UITableViewController (AreasTableViewController)

Could not insert new outlet connection: Could not find any information for the class named

流过昼夜 提交于 2019-11-27 10:02:55
I got an error on Xcode saying that there was no information about the view controller. Could not insert new outlet connection: Could not find any information for the class named Why is this happening? Here are some things that can fix this (in increasing order of difficulty): Clean the project ( Product > Clean ) Manually paste in @IBOutlet weak var viewName: UIView! // or @IBAction func viewTapped(_ sender: Any) { } and control drag to it. (Change type as needed.) Also see this . Completely close Xcode and restart your project. Delete the Derived Data folder (Go to Xcode > Preferences >

UIAlertView crashes when added to app

删除回忆录丶 提交于 2019-11-27 08:30:54
问题 I am trying to impliment a basic UIAlertView into my app (I am using storyboard). But when I run my app, it goes to the debugger screen after stalling at the app's loading screen. my .h: #import <UIKit/UIKit.h> @interface MindTripAnim :UIViewController { IBOutlet UIImageView *animation; } - (IBAction)showMessage:(id)sender; @end and my .m: #import "MindTripAnim.h" @interface MindTripAnim () @end @implementation MindTripAnim - (void)viewDidLoad { animation.animationImages = [NSArray

Make a UIBarButtonItem disappear using swift IOS

拟墨画扇 提交于 2019-11-27 06:33:45
问题 I have an IBOutlet that I have linked to from the storyboard @IBOutlet var creeLigueBouton: UIBarButtonItem! and I want to make it disappear if a condition is true if(condition == true) { // Make it disappear } 回答1: Do you really want to hide/show creeLigueBouton ? It is instead much easier to enable/disable your UIBarButtonItems. You would do this with a few lines: if(condition == true) { creeLigueBouton.enabled = false } else { creeLigueBouton.enabled = true } This code can even be

Can't connect IBOutlet using Xcode 4.2.1, iOS 5.0 and Storyboards

徘徊边缘 提交于 2019-11-27 06:32:49
问题 I'm trying to connect an IBOutlet in a class (DataViewController) to another class (RootViewController) so that I can access the instance of RootViewController in DataViewController. There are no compile warnings or errors. When I select DataViewController in the IB scene, I can see the outlet I've defined in Connections Inspector->Outlets. But when I try to drag a connection from the outlet to RootViewController, it doesn't work. It just fails without any error or indication of what's wrong.

IBOutletCollection set ordering in Interface Builder

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 06:27:27
I am using IBOutletCollections to group several Instances of similar UI Elements. In particular I group a number of UIButtons (which are similar to buzzers in a quiz game) and a group of UILabels (which display the score). I want to make sure that the label directly over the button updates the score. I figured that it is easiest to access them by index. Unfortunately even if I add them in the same order, they do not always have the same indexes. Is there a way in Interface Builder to set the correct ordering. cduhn EDIT: Several commenters have claimed that more recent versions of Xcode return

How to set the UITableView Section title programmatically (iPhone/iPad)?

孤人 提交于 2019-11-26 23:57:15
问题 I've created a UITableView in Interface Builder using storyboards . The UITableView is setup with static cells and a number of different sections. The issue I'm having is that I'm trying to setup my app in several different languages. To do this I need to be able to change the UITableView section titles somehow. Please can someone help me out? Ideally I'd like to approach the issue using IBOutlets however I suspect this isn't even possible in this case. Any advice and suggestions would be

Swift - IBOutletCollection equivalent

╄→гoц情女王★ 提交于 2019-11-26 22:37:15
I'm trying to replicate the Stanford Matchismo game from "Developing ios7 apps for iphone and ipad" in iTunesU in Swift. On page 77 of the 3rd lecture slides , it shows using an IBOutletCollection which isn't an option on Swift. The Swift doc example shows one example that has an array of IBOutlet , but I can't figure out how to make Interface Builder connect multiple outlets to the same IBOutlet / IBOutlet Array. Has anyone figured out how to do this yet? I know that I can create 12 outlets and deal with it that way, but I'd like to make this work as closely as possible to the example in the