Questions tagged [swift3]

Use this tag only for questions directly related to changes in version 3 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 3 is the version of Apple's programming language Swift. It was released on September 13, 2016. The language is open source and available on Github (see ).

The development of Swift 3 and its goals can be viewed on the Swift Programming Language Evolution repository on Github.

For more information, please visit Swift's Getting Started page.

18453 questions
5
votes
1 answer

Swift3 Microphone Audio Input - play without record

I am trying to play microphone audio input using swift3 without recording. I can record the audio with the following code: let session = AVAudioSession.sharedInstance() try! session.setCategory(AVAudioSessionCategoryPlayAndRecord,…
RandallShanePhD
  • 5,406
  • 2
  • 20
  • 30
5
votes
1 answer

Weak delegate becomes nil

In my app I'm using delegates, so that I can read the data when ever it's ready. I'm calling a delegate from two classes. Here is my code protocol MyDelegate: class { func getData() } class MyDelegateCalss { weak var delegate:…
user7925427
5
votes
0 answers

How to animate UISlider Handle like in Apple's Music App?

I have a custom image as the handle for my UISlider, using the following code: slider.setThumbImage(UIImage(named: "scrollerHandle")!, forState: .normal) In the default music app on iOS, when you want to change the position of a song and you click…
Kevin T
  • 303
  • 2
  • 7
5
votes
3 answers

Nil cannot be assigned to type ()->()?

So this is a function from a class that lets you have a double tap and a single tap gesture. It's working fine in Swift 2.3, but after converting to Swift 3 it's throwing a few errors. I can't understand/figure out for the life of me. I commented…
Pablo Escobar
  • 111
  • 2
  • 5
5
votes
2 answers

How to suppress warnings in Swift 3?

Using clang* I could do #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" // ... #pragma clang diagnostic pop However this does not work in swift. So how to do suppress warnings in Swift?
Meniny
  • 660
  • 8
  • 22
5
votes
3 answers

How to query realm swift for a specific object

Edited to simplify my question... I'm new to Realm and so far, it's pretty cool, but I'm having an extremely hard time figuring out how to querying my Realm DB to check if a specific item exists in it. Here's my Realm Model: import Foundation import…
jammyman34
  • 1,399
  • 4
  • 15
  • 22
5
votes
3 answers

how to make only a subview landscape?

I know there is a samilar question Only ONE VIEW landscape mode, and I've readed it carefully before I ask this one. I have a WKWebview named as webview in my app, and the webview have a subview named as player. I used webview to load web page, and…
LF00
  • 27,015
  • 29
  • 156
  • 295
5
votes
2 answers

Image of contacts is not fetching

I am using this code to fetch contact image from device but its not printing any output. if contact.isKeyAvailable(CNContactImageDataKey) { if let contactImageData = contact.thumbnailImageData { print("image \(String(describing:…
Mitu Vinci
  • 455
  • 9
  • 21
5
votes
1 answer

Create a XIB only Cocoa Project in xcode 8.3

I'm trying to create a XIB based application in XCode 8.3 but the option to Start a project without a Storyboard has been removed. Here are the steps I am taking to set up my project: Create a new Cocoa Application. Delete Main.Storyboard Delete…
Phil
  • 71
  • 1
  • 6
5
votes
2 answers

Routing Viper architecture

How to create good routing in project on Viper architecture? I start create file for routing but i don't understand what i must do next. I create a file wireframe first controller and wireframe protocol: // …
Andrei Trotsko
  • 347
  • 2
  • 12
5
votes
2 answers

Integrate Paytm with swift 3.0

I want to integrate paytm payment gateway with swift 3.0.I just follow github link . but i have probelm in ["CHECKSUMHASH"]= "" . What can i put in this key. orderDict["MID"] = strMid orderDict["ORDER_ID"] = strOrderId …
5
votes
2 answers

How to pass data from view controller to a navigation controller and then to another view controller?

I have data from a view controller I want to pass another view controller, but I have it set to present modally, so I have a navigation controller between them. How do I pass data from the first view controller through the navigation controller to…
Ethan Zhao
  • 229
  • 1
  • 6
  • 18
5
votes
1 answer

iOS Assistive Touch messing up screen with black patches

I have a UITableView with each UITableViewCell having a black card like background UIView in it. The black cards are not entirely opaque but instead have an alpha of 0.6. All looks fine when I move scroll up and down, no issues. What messes it up is…
Narayan Acharya
  • 1,459
  • 1
  • 18
  • 33
5
votes
3 answers

Module compiled with swift X.1 cannot be imported in Swift X.0.2

Swift 3.1 came out and I'm receiving this error message in my project: Module compiled with swift 3.1 cannot be imported in Swift 3.0.2 So how do I tell Xcode to start updating my project and migrate it to Swift 3.1?
etayluz
  • 15,920
  • 23
  • 106
  • 151
5
votes
1 answer

Swift 3.1: Crash when custom error is converted to NSError to access its domain property

My Swift app has a custom error system where MyError is just a simple class conforming to Error. Now the app seems to crash whenever a third-party library (PromiseKit) tries to convert this error to NSError and then to access its domain property. In…
villapossu
  • 2,737
  • 4
  • 18
  • 19