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
2 answers

How to get lyrics for Now Playing song in iOS10 (Swift 3)

I want to display lyrics from song that is currently playing by iOS system player. Here is my custom player: import UIKit import MediaPlayer import AVFoundation class NowPlayingController: NSObject { var musicPlayer: MPMusicPlayerController { …
dandepeched
  • 424
  • 5
  • 20
5
votes
0 answers

swift 3 Implicit use of 'self' in closure; use 'self.' to make capture semantics explicit

I'm trying to use a func I extended UIViewController with. I added self to the different func's arguments but the func not gives me "Implicit use of 'self' in closure; use 'self.' to make capture semantics explicit" error. Tried even to apply a weak…
biggreentree
  • 1,633
  • 3
  • 20
  • 35
5
votes
3 answers

Single and double taps on UITableViewCell in Swift 3

I have storyboard segue on TableViewCell, which I use for transfering to another VC on cell click in didSelectRowAt method. Now I made double tap TapGestureRecognizer to handle touble tap on cell. Problem is that on single tap, segue is performing…
bzadm
  • 133
  • 2
  • 9
5
votes
1 answer

NavigationBar & BarButtonItem color change for MessageComposer presented on choosing from UIActivityViewController

I am sharing a text using UIActivityViewController, And on choosing "Message" from the options listed my screen appears as follows, But there is a cancel button at right bar button which is white color as assigned in my AppDelegate. The problem…
Bharath
  • 2,064
  • 1
  • 14
  • 39
5
votes
0 answers

Unit Testing : cellForItem(at: IndexPath.init(item: 0, section: 0)) returns nil for UICollectionView

I am running into a very weird problem where my code for unit testing a UiCollectionViewCell returns nil. var indexPath = IndexPath.init(item: 0, section: 0) let cell = libraryGridViewController?.libraryCollectionView.cellForItem(at:…
5
votes
1 answer

Currency code is scarab (¤) for es-419

---- UPDATE March 28, 2017 ---- When you set the language and region for the app via "Edit Scheme" in Xcode, you get the combined locale identifier of es-419_MX. However, when you change the actual language and region of the device/simulator by…
Naveed J.
  • 3,176
  • 2
  • 12
  • 11
5
votes
1 answer

Set Cookies for URL Request

Currently I have an iOS app that pulls prices and data from websites. So far its been working well, but I want to make it more accurate. To do so, I need to set the cookies for the URL request that I'm currently using String(contentsOf: _)…
odonckers
  • 243
  • 1
  • 2
  • 11
5
votes
1 answer

AudioPlayer and lockscreen/control center control Swift

I'm new on Swift. I write because I want to ask a question. Me and my friend we are developing an audio player, but we have a problem. The player also works in background and remote controls from the lockscreen and the control center work, but if…
5
votes
2 answers

Member operator '==' must have at least one argument of type

I am trying to implement Equatable protocol in equalityClass, but showing Member operator '==' must have at least one argument of type 'eqaualityClass' .can any one explain whats going wrong here? protocol Rectangle: Equatable { var width:…
adarshaU
  • 950
  • 1
  • 13
  • 31
5
votes
1 answer

iOS Share Extension flow

I have problems with creating share extension like share extension of the Pinterest app. When user is not logged to the containing app the share extension only presents alert with an option to log in and cancel. Where in code decide which view…
Marcin Kapusta
  • 5,076
  • 3
  • 38
  • 55
5
votes
1 answer

How to test a combineLatest observable with RxTest?

So I have this viewModel which has a validation observable that is simply the combination of 5 other signals into a boolean. import RxSwift class SchedulingFormViewModel: BaseViewModel { let places = Variable<[String]>([]) var…
5
votes
1 answer

Swift 3 Eureka Forms change button row font color

I am creating an IOS app using Swift 3 and implementing Eureka Forms. As part of a form I have a Button Row that is being used as a Delete button. I'm therefore looking to change the text colour to white. I have tried the following, however cell…
Michael Moulsdale
  • 1,488
  • 13
  • 34
5
votes
1 answer

Replace occurrences swift regex

I'm trying to use the String.replacingOccurrences to change all occurrences of the following characters into commas: #.$[] However I can't seem to get it to accomplish this with what I have: func cleanStr(str: String) -> String { return…
MarksCode
  • 8,074
  • 15
  • 64
  • 133
5
votes
2 answers

How to prevent single tap from being called when double taps occurs in touchesBegan method

I have implemented both single and double tap. But whenever I double tap the screen the single tap code is also run. Please see code below: override func touchesBegan(_ touches: Set, with event: UIEvent?) { let touch = touches.first…
ItsMeAgain
  • 595
  • 4
  • 18
5
votes
2 answers

How do you tell if a UIScrollView content overflows

I have a UIScroll view with content in it. If that content overflows, making the scroll view scrollable, I'd like to set the bottom of the view to be a certain color. If it does not, I'd like to set it to a different color. My issue is, I do not…
steventnorris
  • 5,656
  • 23
  • 93
  • 174
1 2 3
99
100