Then the "Accounts" screen will come up. So click on your Apple Id, and login if requested. Make sure this is the account your are developing and publishing with.

Click on the team that has publishing permissions and press the "Manage Certificates.." button. A new screen will scroll down showing the certs associated with the team.

If a certificate is expired, it is here that it will show up. You can leave it in your account, or you can simply create a new one. In this instance, creating a new one worked best as I was missing the key to the Distribution cert. So I clicked on the [+] to drop down the list of what I was going to add.

(I went through and deleted all my keys and certs to start over. May not have been necessary but DID require a new cert to be created.)

Just selecting the type of cert you are developing for will create it under your account and add it to your signing certs automatically. You should be good to go.

TROUBLESHOOTING

You may need to go through and delete all certs and keys and simply start over. You may also need to go into your developer account on Apple's website to remove accounts that are no longer in use or expired. It doesn't seem that it is manageable from here. In doing so, everyone that is possibly using those certs as well will be notified.

Here I am using the real-world example of sending data through a notification by sending beacon data to a listener every time the CoreLocation refreshes. This is intended to demonstrate how the notification services can transmit data to a listener.

// /* 1 */ - In the AppDelegate I am sending a notification //every time CoreLocation hears a set of beacons.// /* 2 */ - In another class, I am listing for the // Notice and pass along the data to a method.// /* 3 */ - Do somethign with the data when the // method receives it.

This uses a real-world example where beacons are being passed, and I am selectively putting close beacons, which are a dictionary of data, into an array.

The notification that contains all the beacon data is repeated over and over so I don't want duplicates making it into my list, so I use a filter to determine if the Beacon data already exists before appending it to the array.

// I am including lots of "stuff" so that it is clear how this came together in a real example. // The code won't work without something feeding becaons to the notification system. But that doesn't matter.// The important bits will have /* # */ next to it.import UIKit
import CoreLocation
class ListBeacons2: UITableViewController {
// /* 1 */ - Create a varriable that will act as your array container of dictionaries.// /* 2 */ - Filter array to see if the new dictionary exists// /* 3 */ - If it doesn't append the Dictionary to the array.// Setup the variable that will hold the array [] of objects of the type CLBeacon/* 1 */var nearestBeacons = [CLBeacon]()
//....later in code
override func viewDidLoad() {
super.viewDidLoad()
//Listen for a message containing an array of beacons// This comes from another page that sends the package of beacons every time CoreLocation refreshes its search.
NSNotificationCenter.defaultCenter().addObserver(self, selector:#selector(ListBeacons.getAllBeacons), name:"sendAllBeacons", object: nil)
} //viewDidLoad
func getAllBeacons(notification: NSNotification){
//clear the array
nearestBeacons = []
// Put the package (that contains the beacons) from the notification into a variablevar packageOfBeacons =Array(arrayLiteral: notification.object!)
//Put the array of beacons into a variable called "beacons"let beacons = packageOfBeacons[0] as! [CLBeacon]
// loop over that array with the contents of type "CLBeacon"for eachBeacon in beacons {
// Check the proximity, and if it is close move into the IFif (eachBeacon.proximity as CLProximity).rawValue ==1 {
// Filter to see if the beacon already exists in this list.// NOTE : We have cast the info coming across as type "CLBeacon" which means that the name of the original key, // such as "uuid" will actually need to be referenced by the object's variable name "proximityUUID". // The casting to a system object of CLBeacon, in line 40, is what does this. /* 2 */let predicate = NSPredicate(format:"%K == %@ AND %K == %@ AND %K == %@" ,
"proximityUUID", eachBeacon.proximityUUID,
"major", eachBeacon.major,
"minor", eachBeacon.minor)
let sorted = self.nearestBeacons.filter({
return predicate.evaluateWithObject($0)
})
// If there are no beacons like it in the array, append it.if sorted.count ==0 {
/* 3 */ self.nearestBeacons.append(eachBeacon)
print("Added new one")
print(eachBeacon)
}
}
}
} // getAllBeacons
}

The goal here is just to demonstrate how to add an object to an array using a real-world example. The code is commented and includes an example of a NSPredicate filter.

Look for /* # */ to indicate where that happens.

// I am including lots of "stuff" so that it is clear how this came together in a real example. // The code won't work without something feeding becaons to the notification system. But that doesn't matter.// The important bits will have /*>*/ next to it.importUIKitimportCoreLocationclassListBeacons: UITableViewController {
// /* 1 */ - Create a varriable that will act as your storage container.// /* 2 */ - Append CLBeacon objects to the array.// Setup the variable that will hold the array [] of objects of the type CLBeacon/* 1 */varnearestBeacons= [CLBeacon]()
//....later in codeoverridefuncviewDidLoad() {
super.viewDidLoad()
//Listen for a message containing an array of beacons// This comes from another page that sends the package of beacons every time CoreLocation refreshes its search.NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ListBeacons.getAllBeacons), name: "sendAllBeacons", object: nil)
} //viewDidLoadfuncgetAllBeacons(notification: NSNotification){
//clear the arraynearestBeacons= []
// Put the package (that contains the beacons) from the notification into a variablevarpackageOfBeacons=Array(arrayLiteral: notification.object!)
//Put the array of beacons into a variable called "beacons"letbeacons=packageOfBeacons[0] as! [CLBeacon]
// loop over that array with the contents of type "CLBeacon"foreachBeaconinbeacons {
// Check the proximity, and if it is close move into the IFif (eachBeacon.proximityasCLProximity).rawValue==1 {
// Filter to see if the beacon already exists in this list.letpredicate=NSPredicate(format: "%K == %@ AND %K == %@ AND %K == %@" ,
"proximityUUID", eachBeacon.proximityUUID,
"major", eachBeacon.major,
"minor", eachBeacon.minor)
letsorted=self.nearestBeacons.filter({
returnpredicate.evaluateWithObject($0)
})
// If there are no beacons like it in the array, append it.ifsorted.count==0 {
/* 2 */self.nearestBeacons.append(eachBeacon)
print("Added new one")
print(eachBeacon)
}
}
}
} // getAllBeacons
}

Common Shortcuts for running a build.

CTRL + CMD + OPT + u = Build and run tests under cursor (focusses on single test or single file)

CMD + SHFT + u = Compile the test suite

Create A new Test file

Inherit from XCTestCase

Append "test" or "Tests" to the filename.

File should ONLY be included in the test target

Should move the file under tests.

Your test file and functions should show up under the test area.

Using XCTestCase

As mentioned before, "testExample" and "testPerformanceExample" below that would run.

importXCTest//Added as a reference to the primary target.
@testableimportSwift3_TestingExamplesclassutilMethodsTests: XCTestCase {
letsubject=NSObject() //instantiated for teach 'test' methodoverridefuncsetUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.print("setup")
}
overridefunctearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.super.tearDown()
print("teardown")
}
functestExample() {
// This is an example of a functional test case.// Use XCTAssert and related functions to verify your tests produce the correct results.print("textExample")
}
functestPerformanceExample() {
// This is an example of a performance test case.self.measure {
// Put the code you want to measure the time of here.print("Measure")
}
print("Done measuring")
}
functest_assertion() {
//subject hasn't had anything added to it so it is indeed Nil and will pass.XCTAssertNotNil(subject)
}
functest_assertion2() {
//Subject will equal itself so this will passXCTAssertEqual(subject, subject)
}
}

UtilMethodsTest.swift : This has the unit test that will evaluate the target method we are testing.

importXCTest
@testableimportSwift3_TestingExamplesclassUtilMethodsTest: XCTestCase {
//Bring in the target classletutilMethods=UtilMethods()
overridefuncsetUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
overridefunctearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.super.tearDown()
}
functest_doTheMath() {
letfirstInt=2letsecondInt=3letfinalAnswer=5//Pass the test data to the method we are testingletgetResultingNumber=utilMethods.doTheMath(firstNumber: firstInt, secondNumber: secondInt)
//Check that it isn't nilXCTAssertNotNil(getResultingNumber)
//Does it give the correct answerXCTAssertEqual(finalAnswer, getResultingNumber)
//is the final answer greater than its parts?XCTAssertGreaterThan(getResultingNumber, firstInt)
XCTAssertGreaterThan(getResultingNumber, secondInt)
}
}

In this example, all the assertions come back true but once you remove the numbers or remove the calculation within the function, errors start to come back.

So here are my fixes and their sources just in case you need further explanation as to why it works. Chances are I won't fully understand all of the changes but first things first - get the code to build.

“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

What's going on?

This relates to an imported framework, in this situation it is HanekeSwift, and it would appear there is a version dependency difference that doesn't quite match up.

That said, the app has been updated to Swift 3.0 and it would appear that the app is only compatible with 2.3.

As always, it is best to look at whether others have addressed the issue and in this situation it looks like someone has created a branch that is updated to the most recent 3.0

And now off to StackExchange to figure out what is going on. There I found a suggestion to update Cocoa Pods.

sudo gem update cocoapods

nope...So I downloaded the Branch and performed a compare using BeyondCompare and everything was different in the primary directory. So I just moved everything over from the 3.0 branch to my copy.

After the migration...

Other errors came up, however on removing the derived data (remove or rename the folder for your project at /Users/chriscantley/Library/Developer/Xcode/DerivedData), cleaning the project, executing it to build, cleaning again and then building... a Whole new set of errors came up.