Top "Swift3" questions

Use this tag only for questions directly related to changes in version 3 of Apple's Swift programming language.

How to convert Data to hex string in swift

I want the hexadecimal representation of a Data value in Swift. Eventually I'd want to use it like this: let …

swift swift3
Get Weekday from Date - Swift 3

I have looked around a bit, but didnt find a quick answer for this in swift 3. I get todays weekday …

xcode date swift3
Using Swift 3 Stopping a scheduledTimer, Timer continue firing even if timer is nil

We call startTimer function to start a timer. When we wanted to stop it we call stopTimerTest function but after …

timer swift3
Selector syntax for swift 3.0

I am trying to add target into button this way: btnAll.addTarget(self, action: #selector(buttonTapped(_:)), for: .touchUpInside) But it …

ios iphone swift swift3 uibutton
Single line if statement in Swift

How would one convert the following to Swift from Objective-C? if (myVar) return; Swift does not use parentheses around the …

ios objective-c swift swift3 swift4
POST request with data in body with Alamofire 4

how is it possible to send a POST request with a data in the HTTP body with Alamofire 4? I used …

ios swift encoding swift3 alamofire
Swift 3 - find number of calendar days between two dates

The way I did this in Swift 2.3 was: let currentDate = NSDate() let currentCalendar = NSCalendar.currentCalendar() var startDate : NSDate? var endDate : …

nsdate swift3 nscalendar
How to add PageControl inside UICollectionView Image Scrolling

I have UICollectionView Horizontal Image listing codes. I want to add PageControl when scrolling images will shows, I added pagecontrol …

ios swift uicollectionview swift3 uipagecontrol
Swift 3: Drawing a rectangle

I'm 3 days new to swift, and I'm trying to figure out how to draw a rectangle. I'm too new to …

swift graphics draw drawrect swift3
How to create managedObjectContext using Swift 3 in Xcode 8?

Facing issue "Value of type 'AppDelegate' has no member 'managedObjectContext' In new Xcode 8 (using Swift 3, iOS 10) when trying to create …

ios xcode swift core-data swift3