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

Transfer Data From Apple Watch To iPhone in Swift

I have been trying for multiple hours to find a way to send a global variable from the Apple Watch to the iPhone. There are a lot of questions abut transferring data from iPhone to Apple Watch but not vice versa in Swift 3. This is not a duplicate…
Dylan Murphy
  • 167
  • 1
  • 13
5
votes
0 answers

Parsing XML with entities in Swift with XMLParser

Is there a way to get XML entities expanded when processing a document using the XMLParser in Swift? I don't see anything in the API but I find it hard to believe this is an exotic requirement. If the libxml2 API is used directly from Swift this can…
Julian
  • 2,837
  • 17
  • 15
5
votes
3 answers

MBProgressHud View Customization Not Work In Swift 3 And Not Showing?

i am using the following code but not showing progress hud so please help for that.simple hud showing fine but customise not showing let loadingHUD = MBProgressHUD() loadingHUD.mode = MBProgressHUDModeCustomView loadingHUD.labelText =…
BHAVIK
  • 890
  • 7
  • 35
5
votes
8 answers

RealTime Reload UITableview without "Index out of Range" swift

I'm trying to reload my tableview every second. what I have now reload tableview objects but since I'm clearing Order array before reloading, it crashes due to index out of range. This is my current code var orders = [Order]() override func…
AlmoDev
  • 969
  • 2
  • 18
  • 46
5
votes
2 answers

How insert image in HTML Body Email Swift 3?

I'm working hard in my app, but I got a problem. Need insert a image in my HTML code from Swift to send a email. this is my code, but of course doesn't work! var h = "" h = h +…
Gilko
  • 69
  • 1
  • 5
5
votes
2 answers

NSTableView Cell with Identifier keep giving nil

I am working on building MacOS app. I am trying to make table view that updates the cell when I press add button. Following is my code: func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { let…
user3284302
  • 129
  • 1
  • 8
5
votes
1 answer

Argument of '#selector' does not refer to an '@objc' method, property or initializer

Can anyone tell me why this code gives the error message "Argument of '#selector' does not refer to an '@objc' method, property or initializer"? timer = Timer.scheduledTimer(timeInterval: 0.1, target: self, selector:#selector(updateTimer(until: 3)),…
skytect
  • 387
  • 3
  • 15
5
votes
1 answer

nstableview drag and drop with custom cell views

I work with swift 3 for osx and I'm searching for a drag and drop solution between two NSTableViews in different view controllers. I have an simple working solution for the case, that each tableview has only one column, no custom cell view and…
Trombone0904
  • 4,132
  • 8
  • 51
  • 104
5
votes
1 answer

Will it cause memory leak with in a swift class method

My problem is I'm not sure if a closure inside a class method can leads to memory leak. Here is my code class func SomeDownloadFun (pdfDirectory:String) { let destination : DownloadRequest.DownloadFileDestination = { _,…
Tek.ke
  • 115
  • 8
5
votes
1 answer

Type casting with type in variable

Is it possible to cast an object to a type which is stored in a member variable? I've tried this: let targetClass = type(of: MyTargetClass) ... if anyObject is targetClass { // ERROR: use of undeclared type 'targetClass' let test = anyObject as!…
mahega
  • 3,231
  • 4
  • 20
  • 32
5
votes
1 answer

Convert a JSON string to Dictionary in Swift 3

as a coding exercise, I wrote a small program to take MySql data frm the web to the iPhone. On the server side. I wrote the php script to get the script to return the json data. On xcode I have [code] . . . let jsonString = try?…
Tony
  • 155
  • 1
  • 3
  • 9
5
votes
1 answer

Extracting hours and minutes from UIDatePicker

I have a UIDatePicker set in time mode, and have a property referencing that date picker. I don't know how to extract hour and minutes components from UIDatePicker when set to time mode in Swift 3. Please help
ar_shabazov
  • 398
  • 1
  • 4
  • 13
5
votes
2 answers

Wait till local notifications from UNUserNotificationCenter gets deleted using removePendingNotificationRequests ios 10 swift 3

Using new local notifications from UNUserNotificationCenter. I try to delete notification with some identifiers: UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: identifiers) and from documention: This method…
Igor Lantushenko
  • 1,771
  • 10
  • 19
5
votes
3 answers

Swipe vertical gesture not working with UITableView

I have UIViewController and I have added a UITableView to it in the storyboard, later I added a swipe Up gesture recognizer to the view, but nothing happened. this is my code import UIKit class ViewController: UIViewController,…
MEH
  • 1,777
  • 3
  • 15
  • 34
5
votes
4 answers

Alamofire response object mapping

I am an android developer new to swift 3 programming, I am using Alamofire for making api calls and to avoid tedious json paring I am using AlamofireObjectMapper library. I have a ApiController which has a function to make api calls below is the…
Syn3sthete
  • 4,151
  • 3
  • 23
  • 41