Search typeSearch syntax
tags[tag]
exact"words here"
authoruser:1234
user:me (yours)
scorescore:3 (3+)
score:0 (none)
answersanswers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
viewsviews:250
sectionstitle:apples
body:"apples oranges"
urlurl:"*.example.com"
favoritesinfavorites:mine
infavorites:1234
statusclosed:yes
duplicate:no
migrated:no
wiki:no
typesis:question
is:answer
exclude-[tag]
-apples
For more details on advanced search visit our help page
results found tagged with search options user 1921348

Swift is a general-purpose, open-source programming language developed by Apple Inc. for their platforms and Linux. Use the tag only for questions about language features, or requiring code in Swift. Use the tags [ios], [macos], [watch-os], [tvos], [cocoa-touch], and [cocoa] for (language-agnostic) ...

113 results
relevancenewest

Swift is a general-purpose, open-source programming language developed by Apple Inc. for their platforms and Linux. Use the tag only for questions about language features, or requiring code in Swift. Use the tags [ios], [macos], [watch-os], [tvos], [cocoa-touch], and [cocoa] for (language-agnostic) ...

14
votes
$0 is a shorthand name for first argument passed to closure. In this case, as you're mapping a Dictionary, that argument is a tuple - hence $0.0 is a key, and $0.1 is a valueFor more info on shorthand argument names, see Swift documentation on closures…
answered Sep 28 '17 by mag_zbc
5
votes
For Swift 3 just drop let before error if let data=data, error==nil {// do stuff}Before Swift 3 the syntax was a little different if let data=data where error==nil {}…
answered Aug 4 '17 by mag_zbc
2
votes
Don't declare your array as [AnyObject] because you clearly want to store a concrete type - Dictionary. Use instead var rows: [[String : AnyObject]]=[[:]]let firstLine: [String : AnyObject]=[ …
answered Jul 18 '17 by mag_zbc
1
vote
Instead of String{oldIncatYears}use String(oldIncatYears)
answered Oct 5 '17 by mag_zbc
3
votes
The answer is - dictionaries in those two cases are actually not identical.In second case, the value of dict["num"] in of Int type, because you explicitly assigned an Int to it.In first case howev …
answered Feb 9 by mag_zbc
6
votes
It has indeed been changed in Swift 3 $0.news.thumbUrl=request?.url?.absoluteString…
answered Sep 7 '17 by mag_zbc
2
votes
=newSequence[i]if(index==0){// we need to store the correct answer indexcurrentCorrectAnswerIndex=i}i +=1}do it the correct Swift way for (index, value) in newSequence.enumerated() {if value==0 {currentCorrectAnswerIndex=index}}…
answered Mar 15 by mag_zbc
0
votes
Swift's Data is not a valid JSON data type. Rather than adding it to dictionary and serializing a JSON try if let photoData=UIImagePNGRepresentation(Photo){request.httpBody?.append(photoDat …
answered Jul 13 by mag_zbc
1
vote
Insert a subview in your button let circleFrame=CGRect(x: 0, y: 0, width: circleDimension, height: circleDimension)let circle=UIView(frame: circleFrame)circle.backgroundColor=UIColor.clear…
answered Oct 6 '17 by mag_zbc
1
vote
Use maximumDate property of your date picker.let yesterdayDate=Calendar.current.date(byAdding: .day, value: -1, to: Date())yourPicker.maximumDate=yesterdayDate
answered Jul 3 by mag_zbc
1
vote
From documentation on becomeFirstResponder(): Never call this method on a view that is not part of an active viewhierarchy.So calling it from viewDidLoad is definitelly not a good idea. Tr …
answered Jul 13 '17 by mag_zbc
0
votes
'NSInternalInconsistencyException', reason: 'could not dequeue a viewof kind: UICollectionElementKindCell with identifier cell - mustregister a nib or a class for the identifier or connect a …
answered Jul 21 '17 by mag_zbc
2
votes
| is not a character allowed in URL. Try to percent escape the URL string let url=URL(string:"https://maps.googleapis.com/maps/api/directions/json?origin=colombo&destination=kandy&waypoints=opt …
answered Aug 4 '17 by mag_zbc
0
votes
It will be perfectly round by rounding corners only if your view is a perfect square. If it is rectangular, you will need to use an elliptic shape layerlet shapeLayer=CAShapeLayer()shapeLayer.pat …
answered Mar 16 by mag_zbc
1
vote
Unless a and b are instances of a class, your varToMutate will only be a copy, because everything besides a Class is a value-type in Swift. Maybe try UnsafeMutablePointer<T>?…
answered Jul 6 '17 by mag_zbc

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,