Extra argument 'userinfo' in call CLLocation
Modify code for that:
dispatch_async(dispatch_get_main_queue(), { () -> Void in
NSNotificationCenter.defaultCenter().postNotificationName(SOCurrentLocationDidChangeNotification, object: nil, userInfo: ["kSOLocationKey" : currentLocation])
})
Extra Argument In A Call
According to the document:
- Data Request - Simple with URL string
// Alamofire 3
Alamofire.request(.GET, urlString).response { request, response, data, error in
print(request)
print(response)
print(data)
print(error)
}
// Alamofire 4
Alamofire.request(urlString).response { response in // method defaults to `.get`
debugPrint(response)
}
So you need to remove .GET
argument
Extra argument 'completion' in call
You had an extra argument in your method's signature and some erroneous braces.
@IBAction func createAccount (_ sender: AnyObject) {
Auth.auth().createUser(withEmail: emailField, password: passwordField) { (user, error) in
if error != nil {
print("Can't Create User")
} else {
if let user = user {
self.userUid = user.user.uid
}
}
self.uploadImg()
}
}
Extra argument Swift?
You are probably trying to use a Swift 1.x call with a Swift 2.x compiler.
Swift went through a large change between 1 and 2, now the method (and most others that report errors) throws an exception instead of passing in an error argument.
The current documentation shows the signature as:
class func JSONObjectWithData(_ data: NSData,
options opt: NSJSONReadingOptions) throws -> AnyObject
To see how to hand exceptions look at the documentation.
extra argument in call when creating NSManagedObjectModel
The mapping closure takes an URL as argument and returns the model,
so the signature should be
(url: NSURL) -> NSManagedObjectModel
And
NSManagedObjectModel(contentsOfURL: url!); // errors here
is wrong because url
is not an optional here. On the other hand,NSManagedObjectModel(contentsOfURL: url)
returns an optional
which needs to be unwrapped.
Putting it together:
func createModels(test: [NSURL]) -> [NSManagedObjectModel] {
let newData = test.map {
(url: NSURL) -> NSManagedObjectModel in
return NSManagedObjectModel(contentsOfURL: url)!
}
return newData
}
or with shorthand parameter notation:
func createModels(test: [NSURL]) -> [NSManagedObjectModel] {
let newData = test.map {
NSManagedObjectModel(contentsOfURL: $0)!
}
return newData
}
Related Topics
Reading from Txt File in Swift 3
Accessibility Custom Actions Aren't Announced in Swift
Swift 4 - Hmcharacteristictypeserialnumber Deprecated
How to Present a UIcollectionview in Swiftui with UIviewcontrollerrepresentable
Enum of String Type Vs Struct with Static Constant
iOS Swift, Aws Cognito User Pool, Unable to Refresh Access Token
Produce Sounds of Different Frequencies in Swift
Swift 2.0 Replicate Objc_Association_Retain
Swift System Version Checking on Ubuntu
Where Do I Register a Valuetransformer in Swift
Uidatepicker Show Only Sunday's Date Only
How to Get Reliable Timing for My Audio App
Xcode 7 Cast from Xcuielement to Unrelated Type 'string' Always Fails While Fetching JSON
Swift - Measurement Convert(To:) Miles to Feet Gives Wrong Result
Ambiguous Use of 'Filter' When Converting Project to Swift 4
"This Class Is Not Key Value Coding-Compliant" Using Coreimage