Questions tagged [unwrap]

181 questions
-1
votes
2 answers

How to unwrap programmed UIButton (swift4)

I am trying to create a button using programmed constraints. I am trying to not use the storyboard. I am having trouble unwrapping the button. How do I do this? import UIKit var aa: [NSLayoutConstraint] = [] class ViewController: UIViewController…
user8105388
-1
votes
2 answers

How can I safely unwrap deeply nested values in a dictionary in Swift?

I understand how to print the values of upper level things such as the value of "email" or the value of "name" but how would I safely unwrap the dictionary to print a deeper nested value such as the value of "url"?
Jason Park
  • 77
  • 1
  • 1
  • 10
-1
votes
1 answer

How to unwrap the optional value

I have a method like this: internal func handlePan(_ sender: UIPanGestureRecognizer) { if (sender.state == .began) { let initialPanPoint = sender.location(in: collectionView) findDraggingCellByCoordinate(initialPanPoint) }…
user1960169
  • 3,533
  • 12
  • 39
  • 61
-1
votes
1 answer

How to unwrap the content value from XML in Objective-C

I'm receiving correctly in XML file the value in debug. - (void)connectionDidFinishLoading:(NSURLConnection *)connection { LogDebug(TAG_SETTINGS, @"Provisioning file downloaded, %lu bytes", (unsigned long)[self.provisioningData length]); …
Steven
  • 762
  • 1
  • 10
  • 27
-1
votes
4 answers

Why cant I unwrap a UserDefault type string? [Swift 3.0 - Xcode 8]

I've stored data sent back by delegate as a user default and I'm trying to prepare it to send in a segue. I am able to send it in a segue, the problem I'm having is the data comes out in the form "optional[Data]" I know what optional means, but it…
Dan.code
  • 431
  • 2
  • 14
-1
votes
2 answers

swift3 How to remove Optional

this is my code: func uplouadPost() { // shortcut to data to be php let parseJSON = UserDefaults.standard.value(forKey: "parseJSON") as? NSDictionary let userID = parseJSON!["userID"] as! String .... if error == nil { …
Ding
  • 11
  • 1
  • 3
-1
votes
1 answer

jquery insert new open close div

I have some menu loop coding, how to insert some div before start loop, and after end loop. I was try with .prepend but not working.