I have an old project that I built on iOS 7 with Xcode 5. Recently I upgraded to Xcode 6 GM. I opened that project in new Xcode and tried adding this swift code to one of my method in v1Album.m file.
let alertController = UIAlertController(title: "Hey AppCoda", message: "What do you want to do?", preferredStyle: .Alert)
I get an error saying Use of undeclared identified let
I have been searching, trying to see what I need to do, what settings I need to change in my project in order for it to start recognizing swift code. Every tutorial online I see is explaining how to start writing swift code in a brand new project. All I need is to be pointed in the right direction.
EDIT: What I have read so far on migrating project to swift from Apple Doc here is that
- in order to write swift code I need a brand new swift class
- I need to rewire all my objective-c code from v1Album.m to v1Album.swift
- Then I deselect v1Album.m from my project.
- I cannot use swift code directly in v1Album.m without first defining that method in v1Album.swift file and then using a bridging header.
- Basically I cannot do what I am trying to do i.e. write straight up swift code in *.m file.
Please correct me, I maybe completely wrong.