So I'm trying to have a user press Done and then an alert will be returned. So here's the issue. When I try to create an outlet from the Done button I can't. This is all I see
I'd expect for the little window to pop up then I'd be able to create it. Any ideas? I'm trying to add the outlet in my ViewController.swift file
GitHub download
Check to make sure your UIViewControler in the storyboard is set to the right class:
Per the solution recommended by everyone:
Related
I'm working on a new codebase that has everything laid out in storyboards and I'm trying to implement the new ASAuthorizationAppleIDButton button as part of the new Sign In With Apple feature.
Reading online it looks like I can add a UIButton to the view and then override the class to be ASAuthorizationAppleIDButton. Easy enough. The weird parts comes when I try and wire that button up to an action in the VC. I can't do it. Even if I go the other way and drag from the button to the VC, the action item is missing from the connection menu.
Has anyone had success adding and interacting with this button from a storyboard? I'd prefer not to redo the entire view just because of this one issue.
ASAuthorizationAppleIDButton is not a button but its a control. And this is stated in that way to avoid misuse of this as a button. And only one action is associated with it which cannot be override. The only control you get is to use the delegate method of
didCompleteWithAuthorization & didCompleteWithError.
So if you want to use/include some extra selector or methods. you can add those in these delegate- methods.
I am trying to create an outlet but xcode doesn't let me, I press ctrl+drag as always.
Here a screenshot of the viewcontroller and conversationVC.swift:
btw in the top right when I write the class as conversationVC.swift it always delete itself and stays empty,
please share your knowledge.
I have found the answer here, need to click on yellow button and then to set the class name
I'm new to iOS XCode6 ,trying to create a single view app . When I try to create an outlet connection to the label by drag and drop , nothing shows up as you see in the picture below. I did search the web all over to find an answer but nothing worked. I'm working from a text book which is made for beginners,following all instructions and nothing there mentioned about this issue. Any help will be appreciated.Thanks .
What you select is a LaunchScreen. You can not drag and drop from there into your viewController
Select the storyboard,set the class to the right viewController,then you can drag outlets
Set the class to the viewController here
Then you can drag outlets like this
I'm using Xcode. I've just added a button in the storyboard. I control-drag to the implementation file. The function doesn't show up in the implementation file. Strangely enough if I do a search with on the newly added function it DOES show up in the new screen in the implementation file.
How can I solve this? Because it's time consuming not being sure the function was added and not being able to add code without performing a search?
Thanks
For people looking for the answer: one has to put the link on automatic. If the link is set to manual control drag will not change the file on your screen. Beware that is was created though.
I made an simple UITableViewCell. I put there image view and an label.
I'm trying to drag them to the header file and then use them.
But once I'm clicking on the tuxedo icon I'm getting an NSObject.h instead of WorkoutCell.h .
Here is a picture:
(source: gyazo.com)
I'm trying to add the label and the image view. but I'm pretty new to ios/iphone/xcode so if there is any other way to do it without dragging it (with the ctrl key ofc) to the header file. please let me know .. ;)
and yes I tried to navigate to that header file, but it doesn't appear there ..
May be your cell's class in the identity inspector is NSObject . Change it to WorkoutCell.h . Now try
In your Interface Builder you need to set the custom class of the view.
1) Click on the view in interface builder.
2) On the right pan choose the 3rd tab from the left.
3) Choose the right Custom Class.
I've seen this happen lots of times before.
If you click the third icon from the left of the tuxedo, you can navigate your project files.
From here select the folder your WorkOutCell.h is in.
Maybe someone else can provide a more comprehensive answer as to why this happens, but with this navigation you will at least be able to access your WorkOutCell.h