Xcode 6 GM, IB Challenge and Swift - ios

I'm hoping someone can help me or even just let me know that I'm not going out of my mind. I have been searching for an answer to my issue for the past 4 hours and have tried many solutions, none seem to help.
My challenge is that I don't seem to be able to make use of a custom class for a view controller within the GM release of Xcode 6. Here is what I have done.
Begin a new project using File -> New -> Project, selected for an iOS
single view application to start. Once the initial application has
been created, it runs fine within the simulator.
Now I go into my ViewController.swift and change class
ViewController: UIViewController { to class ViewControllerxxx:
UIViewController {
Next, I go into my Main.Storyboard, select the View Controller and
drop down the custom list class where I do not see my custom class.
Now here is where is gets strange.
If I open a project that was created on an earlier beta build of Xcode, the above process works just fine and I see my custom class, just not with newly created projects.
Does anyone else see this behavior, or is it just me?
Hoping someone can shed some light for me...
BTW - manually defining the custom class name doesn't work either - I get a runtime error saying the class is unknown.
Many thanks in advance,
Jon

It would appear that I have fixed it although I have no idea how or why. Basically all of my projects are stored in a folder \Users\jon\code. I renamed the code folder to code.old and then back to code again and for whatever reason, it works now without an issue. I have zero idea as to what caused this issue as nothing in the folder has changed, but the issue is certainly resolved, or at least it appears to be.
So to anyone else experiencing this issue. First try creating a project in a location different to where you are when experiencing the problem. For example, if you are creating your project in Documents, try creating it in the root of your home folder.
If this works, drop to a terminal and using the mv command, rename your projects folder to something else and then back again. After this, I was able to create as many new projects as I wanted, an none had the issue.
Hope this helps someone...

Related

Template Dialogue Box not showing up when trying to create a new file in a Xcode Workspace

When I right click to add a new file (or do File -> New -> File), I don't get a dialogue box asking me which Template I want to use. It just creates a blank file like this:
I tried renaming it to a .swift file and adding in all the necessary code to start off, but two things happen:
First, the autocomplete function is one step behind. So when I've already typed import UIKit and moved on, it starts trying to autocomplete UIKit. And when I've already typed class className: UICollectionViewController {
} and moved on, it starts trying to autcomplete UICollectionViewController
After I manually type in the bare minimum needed to make a swift file into a UICollectionViewController with a colored background, I can't reference it in my other files.
I can only assume this is because of the lack of a template dialogue box, but maybe I'm wrong. Is there any way to toggle this template dialogue box on or off?
This problem is only happening with this particular project since I updated to Xcode 10.1
I can't seem to find anyone else online who's already had this issue. The only similar questions I found online were referring to creating reference folders rather than groups. I didn't find anything regarding the file template dialogue box not showing up.
I fixed this and I'll post the answer in case anyone else comes across this problem.
It was tedious, but I:
Created a new project
Initialized my podfile, added what was in the previous one, and installed it
Opened up the new workspace
Added each file one by one
Maybe there's an easier/quicker way to do it, but after looking through all the settings and not finding anything, I ended up doing this and it worked.
Check that in the left hand pane displaying your project structure you are adding the new file to a folder which comes under your application (identified by a blue Xcode application icon) instead of a general folder as your top level (identified by a blue folder icon). I can't add images yet so please see link.

Xamarin IOS. Reference between xib control and UICollectionViewCell.cs was lost

I'm novice in xamarin, sorry if this is a stupid question. Some time before, I had added UICollectionViewCell via mac vs studio. The studio generated two files : xib and UICollectionViewCell.cs. The reference between both these files worked correctly in the beginning (when I was adding/changing any control in xib file by designer, then the autogenerated code had been changed as well).
But after undeterminated changes from my side(actually, I think, I had not done anything to be reason of this problem), this reference was lost. Now, when I'm changing anything in UI designer, nothing is changing in UICollectionViewCell.cs file.
These files are placed in the same directory.
Also, I don't remember what the File's Owner class field setting contained before. Currently, this field is empty, but filling of this file by UICollectionViewCell.cs class doesn't help.
I think. it is well known issue, could anyone help with it?
I don't know what was happened but when I made checkout to previous branch and then came back to current, the problem was disappeared. Currently the reference is working. Hope it was something temporaly :(

How can I transform my iOS/Swift project to a state where I will be able to use live views?

I have been working on my first iOS/Swift application for the past month or so, and have created all of my class declaration files (i.e. my .Swift files) in my main project folder. I would really like to use live views in my app, because as of right now I cannot build/run the app at all due to errors I don't know how to fix (I'll be posting about those later today in hope of finding someone who can help me fix them).
What would be the best way to go about converting all of my views into embedded frameworks so that I could use the Live Views feature of Xcode ? I am running Xcode 7 and wrote my app in Swift 2.0
Thanks
You apparently don't need to use frameworks for that anymore. At least it works just fine in Xcode 7 for me - for classes that are part of the main project. Just mark your class as #IBDesignable.
But in order to show the preview, your code needs to be able compile, so you will need to resolve your issues first.

Xcode stalls on "loading" when trying to create new project

Xcode 6 never gets past "Loading" when I try to create a new project. I actually was able to create a new project yesterday, but I decided to just ditch it completely (deleted). Clearly there must be a bad file somewhere, possibly related to the project I deleted, since I also see the same stalling behavior now with Xcode 5.1, which has worked fine for creating new projects in the past. Xcode 6 has worked fine when starting with an already existing project and still appears to do so. I did not see this exact problem in your data base, though one person saw the project creation freeze before reaching the stage I get to. Their solution was to delete Xcode and every possible file related to it, which I'm a little squeamish about, since I don't want to affect existing projects, and don't have an understanding of what the various files are for.
Deleting the DerivedData of Xcode should fix the issue. You can do this by heading to ~/Library/Developer/XCode/DerivedData (with a Finder window open press cmd+G) and deleting all the subfolders of it.
This is embarrassing, but if it could happen to me, maybe it could happen to someone else. The problem was that the window that came up after the second step in defining the type of project to be created, the one in which you choose where to save the project's files, extended off the bottom of the screen, so that only the very tops of the buttons were visible. Eventually, I realized the one to the far right might be the one to click to continue. Which it was. Feel free to delete this question.

Xcode going crazy! while coding, loses classes, references and doesn't autocomplete giving often <<error type>>

After I installed the latest version of xcode i'm having a very annoying issue.
While I'm coding, xcode goes nuts. Without me doing anything weird, just typing code, xcode stop recognizing classes.
For example: I want to add UITableViewDelegate to my class, but it doesnt recognize it. After i type it manually sometimes it recognize it and it is shown in purple, some other time it doesnt. But both times it won't really consider it, so if I try to write down a method of that delegate, it won't show it.
Other times if I try to call a variable of a certain class, while trying to autocompleting it, it shows <>.
Other times if I try to call any class, let's say I try to type var test = UIActionSheet, it just shows a few elements in the autocomplete list (raw types, primitives, the classes of my main project, but it doesn't show the majority of classes).
It's like it's missing the documentation and the link with the main frameworks...
I'm working on a simple tabbed app from yesterday and it's the 3rd time i started all over because of this issue, thinking that starting over would fix the issue, but it's not working.
If i open a different project while the issue is going on, the other project works ( but i recoded all over my app so it's not that one the issue, and i also have the same issue on other project... it just doesn't affect 2 project at the same time )
i tried deleting derived data
i tried restarting both xcode and the comp
What's going on?
Here are two screenshoots where you can see what's happening:
I had the same problem earlier.
Exit Xcode and delete Derived Data folder here ~/Library/Developer/Xcode
Restart Xcode and you should see the autocomplete working again.
You have to learn how to take it apart and put back together.
Either reinstall Xcode, if it doesn't help, create a new project.
Then copy source files one by one and see when it breaks.
Freshly install the XCode IDE version 6.1
Use CMD + F to find all _element.
Check that if you named one variable _element
The following code may reproduce the error:
class _element:NSObject {
}
let _element:UIImage = UIImage()
// type _element under this line

Resources