Questions tagged [swift4]

Use this tag only for questions directly related to changes in version 4 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 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.

5684 questions
2
votes
1 answer

Upgrading Swift 3 to 4, swift extension no longer in objective c

I just finished upgrading a mixed language project (objective-c and Swift) from Swift 3 to Swift 4. Everything seemed to go well except all of my Swift extensions are no longer accessible in objective-c. I can't figure out how to get any Swift…
Aaron Hayman
  • 8,492
  • 2
  • 36
  • 63
2
votes
0 answers

Compressing Video using HEVC Codec with swift 4

Apple is using a new video codec hevc and i am trying to compress videos with my application using the hevc codec. For some reason the app just crashes and returns the file size as 0 mb. It works when i compress it using H264, however when I use…
vApp
  • 249
  • 1
  • 6
  • 18
2
votes
2 answers

Build time error swift 4 xCode 9 with Alamofire added in pod

I was working on a project which I required to updated to support Swift 4. After making related changes, When I have run the application I got the similar error mentioned below. After which I have created a new and empty project to check which also…
Er. Vihar
  • 1,495
  • 1
  • 15
  • 29
2
votes
1 answer

UiPickerView over UiToolBar - Swift 4 Upgrade Error

I updated my project to Swift 4 XCode 9 I have a InputText whit a input view using a Picker I added a UIToolBar at InputText. It was working well before upgrade. now it's like the UIPickerView it's over the UIToolBar. I can see but if i click on…
Piedecess
  • 23
  • 5
2
votes
1 answer

Time-related calculations

I am writing an app using Swift 4. This apps first gets the current device time and puts it in a label (currentTimeLabel) in the format HH:mm. It also gets a time in a different timezone from a firebase database as a String and puts this in two…
user8622187
2
votes
1 answer

Swift 3 to 4 Migration Errors when button clicked

I have an array of images that you scroll through by clicking a button. I migrated to Swift 4 today and now instead of remaining on the same page and scrolling through the images, it switches back to the home tab when the button is clicked. It was…
techgirl
  • 293
  • 1
  • 3
  • 18
2
votes
1 answer

How to remove UITableViewCell left space?

I have searched everywhere but cannot find answer to this question. In my UITableView's cells, there is empty space on the left side. How do I get rid of it? I'm using swift-4 IOS-11, xCode- Version 9.0 beta 6 As shown in this picture, I can not…
Rahmican
  • 123
  • 1
  • 6
2
votes
1 answer

Compiler issues when chaining multiple calls to the same method

I'm trying to fix this bug by overloading prefix(_ maxLength) for all lazy sequences and collections, but I'm running into weird compiler issues. I'm using Xcode 9.0 beta 6 (9M214v), but it's also reproducable in all of the latest snapshots for…
Dennis Vennink
  • 1,083
  • 1
  • 7
  • 23
2
votes
3 answers

Using CocoaPods mixed Swift3 and Swift4 pods

Using CocoaPods, most pods are still Swift3 pods, but when imported in Xcode, all pods defaults to Swift 4, which makes the compilation step fail. How can I use Swift4 pods with legacy Swift3 pods in my Podfile without having to manually changed the…
Claude Houle
  • 41,064
  • 8
  • 33
  • 42
2
votes
1 answer

Converting to Xcode 9 - pod framework not showing up for conversion?

Ok, having some difficulty here getting a specific pod to work in Xcode 9. It's a large problem and I don't know what to do here - the issue is https://github.com/tinypass/piano-sdk-for-ios was last written in Swift 3.1 and Xcode 9 only imports…
blue
  • 7,175
  • 16
  • 81
  • 179
2
votes
1 answer

Swift 4.0 Decoder error with closure property

I'm trying to serialize my objects with the Swift 4.0 Codable protocol. I'm hitting an error when trying to decode closure properties: guard let influenceFunction = try? container.decode(((E, Double) -> (E))!.self, forKey:…
jbm
  • 1,248
  • 10
  • 22
2
votes
2 answers

Get the value of a Swift variable from a constructed name

I am stuck at a problem which i am trying to figure out in Swift 4. Let say, i have the below variables let var1 = "One" let var2 = "Two" let var3 = "Three" var counter = 1 // Loop Start let currentVariable = "var" + "\(counter)" //Fetch the…
2
votes
1 answer

swift 4 access C struct values in library

I am trying to access C values stored in the Aubio library and believe it's how I am accessing the Struct value. The library has C Struct and fvec_get_data function: typedef struct { uint_t length; /**< length of buffer */ smpl_t *data; /**<…
robmsmt
  • 1,389
  • 11
  • 19
2
votes
0 answers

Perform the segue from table view to the web view error

I run into an error when I try to perform the segue from table view to the web view (for youtube videos). I attached the Code for both views, the error and the target output from console. It seems to be a problem with the WKWebView class... but I…
2
votes
1 answer

Get class type dynamically from string for JSONDecoder.decode()

I want to decode json responses of a websocket "notification" where the type of notification is within the json response. JSON example: { "jsonrpc": "2.0", "method": "Application.OnVolumeChanged", "params": { "data": { …