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
1
vote
0 answers

Crash when logging in with Facebook App. (Safari or Web works). Swift 4.1

I'm getting a bizarre crash after upgrading to Swift 4.1 Every time a user logs in to my app with the Facebook app using the NATIVE option (this opens your facebook app itself if its installed on the device). I am getting the following…
Unome
  • 6,750
  • 7
  • 45
  • 87
1
vote
1 answer

Why do I have to implement append(contentsOf newElements: S) in my custom RangeReplaceableCollection

I am currently trying to update a custom collection type to Swift 4.1. However, when I adhere to the documentation and implement all requirements for Collection and RangeReplaceableCollection, Xcode is still complaining that my type does not conform…
Jan Nash
  • 1,883
  • 19
  • 30
1
vote
1 answer

JSON parsing float in swift4.1 has unexpected behaviour

A simple function that parse json variable and returns a float. func parseMyFloat(jsonString: String) -> Float? { if let data = jsonString.data(using: String.Encoding.utf8, allowLossyConversion: true), let parsedJSON = try?…
Bilal
  • 18,478
  • 8
  • 57
  • 72
1
vote
2 answers

Superscript string in Swift

I'm trying to make my text more readable to the user in my app. I'm reading my text from a JSON from "https://api.myjson.com/bins/ss5jb". Is there a way to superscript the verseNumber and change its color to a light gray in my collectionView…
1
vote
1 answer

Swift get all KeyPath for a protocol

In the latest version of Swift, is there any way to get all the vars defined by a protocol? Imagine I have something like: protocol Foo { var a: Double { get set } var b: Double { get set } } class SomeClass: Foo { var a: Double = 1 …
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
1
vote
0 answers

I just upgraded to Xcode 9.3 gives Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)

My project was working absolutely fine, until the upgrade to 9.3. Right after the upgrade I started seeing the EXC_BAD_ACCESS error at my AppDelegate class. I'm new to IOS development and this is my first Xcode update, are there any steps that I'm…
virajd
  • 150
  • 1
  • 15
1
vote
1 answer

Module compiled with Swift 4.0.3 cannot be imported in Swift 4.1

I'm trying to import a framework in app, after to update Xcode to version 9.3 that supports swift 4.1. When I import it, appears this error: Module compiled with Swift 4.0.3 cannot be imported in Swift 4.1:…
Mateo G
  • 21
  • 3
1
vote
1 answer

BOOL is incompatible with Bool in Swift 4.1

When overriding in a Swift subclass of an Objective-C class, I get a message saying: Property type 'BOOL' (aka 'bool') is incompatible with type 'Boolean' (aka 'unsigned char') inherited from 'ChildClass' I tried to use Other Boolean types but it…
Antzi
  • 12,831
  • 7
  • 48
  • 74
1
vote
1 answer

What does "Expression implicitly coerced" warning mean?

func downloadCurrentWeather(completed: @escaping DownloadComplete){ Alamofire.request(API_URL).responseJSON { (response) in let result = response.result let json = JSON(result.value) // <-- (EXPRESSION IMPLICITLY COERCED…
1
vote
2 answers

Unable to properly animate the frame of a subview within a parent view

I am trying to animate the frame change of a subview within a view. Within the animation block I am setting the size of the subview to half its original width and height. However, when I run the code, the subview unexpectedly started with a larger…
Hong Wei
  • 1,397
  • 1
  • 11
  • 16
0
votes
0 answers

How was Proposal: SE-0185 implemented under the hood?

Synthesizing Equatable and Hashable conformance. I would like to take a look at source code where it is implemented. But I can't find it at https://github.com/apple/swift/ Particularly I'm interested in: we propose that a type synthesize…
Roman
  • 1,309
  • 14
  • 23
0
votes
1 answer

How to change date colors of all Sunday's in fscalendar in swift

How do I change colors of Sunday's to red and disable them . Actually I did not found any solution for this . Specially changing date color of only Sunday not the weekends.
Supreet Patil
  • 21
  • 1
  • 4
0
votes
0 answers

Is sqlite INSERT..ON CONFLICT..DO UPDATE supported in Swift 4.1?

I've been unsuccessfully trying to implement the following: var queryResult: OpaquePointer? var query = "INSERT INTO myTable (id, remarks, status) VALUES (?,?,?) ON CONFLICT(id) DO UPDATE SET remarks=?, status=?" if…
iSofia
  • 1,412
  • 2
  • 19
  • 36
0
votes
0 answers

WebView Should not cover entire screen (Not showing navigation bar using navigation controller )

When I load web view it is covering the entire screen it is not displaying the navigation bar using a navigation controller How to display a web view with navigation bar using a navigation controller without covering the whole screen Chatter…
0
votes
0 answers

Is there any way how WebView is loaded with navigation bar (using navigation controller story board) without covering the entire screen?

enter image description hereWhen I load web view it is covering the entire screen it is not displaying the navigation bar using a navigation controller How to display a web view with navigation bar using a navigation controller without covering…