Questions tagged [swift4.1]

Use this tag only for questions directly related to changes in version 4.1 of Apple's Swift programming language. Use the tag [swift] for more general language questions, or the tags [ios], [cocoa], [apple-watch] etc. for questions about developing on Apple platforms.

Swift 4.1 contains updates to the core language, including more support for generics, new build options, as well as minor enhancements to Swift Package Manager and Foundation. There was also significant progress made in stabilizing the ABI.

Swift 4 is the fourth version of the Swift language developed by Apple that was released in 2017. The language is open source and available on Github (see ).

The development of Swift 4 and its goals can be viewed on the Swift Programming Language Evolution repository on GitHub

229 questions
0
votes
1 answer

Swift 4: Cannot convert return expression of type 'Int' to return type '[String : Any]?'

In a prepare(for segue:) I add the id:Int of the selected project into user defaults like this override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if let viewController = segue.destination as? ReceiverVC, let project = sender…
jgravois
  • 2,559
  • 8
  • 44
  • 65
-1
votes
1 answer

How we can change current Month all Past Dates title Color in FSCalendar in Swift

I want to change all past dates title Color in fscalendar in Swift Not A Particular Date I added this bit of code:- Delegate method:- func calendar(calendar: FSCalendar!, appearance: FSCalendarAppearance!, titleDefaultColorForDate date: NSDate!) ->…
-1
votes
1 answer

How to open automatically ( without click the notification ) view controller when local notification received

I want when local notification received, automatically view controller / (Ios App) is open whithout click on notification,, is possible or not..? func applicationDidEnterBackground(_ application: UIApplication) { print("EnterBackground.") …
-1
votes
2 answers

Apple Mach-O Linker Warning, in xcode 9.4

I update xcode version 9.4 to 10.2.1, I have created a project on xcode 9.4, run it once on xcode 10.2.1 and then delete this version and switch back to xcode 9.4 due to some reasons ... when I tried to run project on xcode 9.4 it gives lot of…
-1
votes
1 answer

How to convert data(Type Data) into a zip file(Type File) in swift 4 and cocoa for Mac OS App?

I am developing a mac os application where i have to convert the data from server API to a zip file. The API is returning a zip file itself(i am fetching a zip file from server) in encoded format of type Data, but i want to convert that data to a…
Bishnu Das
  • 19
  • 6
-1
votes
1 answer

Cannot convert value of type 'ViewController?' to expected argument type '_OptionalNilComparisonType'

I'm implementing MapKit into my app I have been able to display users current location. Now I'm trying to display current street name and street address onto a label which I have on my storyboard but i get this error:: Cannot convert value of type…
chevi99
  • 123
  • 1
  • 2
  • 17
-1
votes
1 answer

Why the swift enum is returning wrong hashValue in swift 4.1?

I have an enum as below enum LoginItems: Int { case email = 0 case password case login static let numberOfItems = LoginItems.login.hashValue + 1 } Previously in xcode 9.3 we were using swift 4.0 and it used to give proper value but…
Shreesha Kedlaya
  • 340
  • 4
  • 19
-1
votes
2 answers

How can I get a string as dynamic and convert it into a base64

let parameterDictionary = ["action": "create", "email": emailTextField?.text, "password": passwordTextField.text] as [String : Any] var request = URLRequest(url: serviceUrl) request.httpMethod = "POST" request.setValue(" application/json",…
raj kumar
  • 1
  • 1
-1
votes
2 answers

Change UIView frame Height and width from user input from UIText field

I am able to change height and width of UIView frame on button click by hardcoding the height and width, but i am unable change it when i get input from user in UItext field in CGFloat format. ` import UIKit class SetBorderSizeViewController:…
Ammad
  • 3
  • 3
-1
votes
1 answer

Initialise Dictionary with Objects and Keys in Swift 4

I am trying to initialise a Dictionary with Objects(Array) and respective keys. I am getting crash which says [NSDictionary initWithObjects:forKeys:]: count of objects (12) differs from count of keys (1)" . Not sure what I am missing here. Can…
AK1188
  • 17
  • 6
-1
votes
1 answer

I cannot import swift 4 module's with Xcode 9.2

I have Xcode 9.2 and I am thinking I automatically have Swift 4.1. So I tried to import some modules like: import Hero import EGFormValidator but it gives me an error saying it does not recognize those modules. How can I access Swift 4.1 on my…
Perewillz
  • 73
  • 8
-1
votes
2 answers

ios notification when firebase update my table view

i want to notify the user when the table view updates. i am using firebase but i want local notifications when the tableview updates. I do not know how to set the trigger for when the tableview updates. i read all the docs i could read and i can not…
-1
votes
2 answers

Swift: UILabel.text value shows nil value

In the cellForRowAtIndexPath method, I have created a custom cell. The cell has a label to display project name. After assigned value to the label, it shows nil value when print. so that label could not display in the table view. let cell =…
A.Yesuvin
  • 25
  • 6
-1
votes
1 answer

How do I change the color of a UITextfield Placeholder in Swift 4?

How do I change the color of a UITextfield Placeholder in Swift 4? Seems like a simple task but I am having some trouble figuring it out as I am new programming and Swift. I want to change the color programmatically. tf.placeholder =…
John
  • 965
  • 8
  • 16
-2
votes
1 answer

Cell Data not showing properly in table view swif4

I am using table view inside table view I have used some views and then I used cell but when i running in simulator its content not showing properly I added screenshot please check it. func numberOfSections(in tableView: UITableView) -> Int { …
1 2 3
15
16