[Solved] How to show an image in a UICollection View cell while clicking that cell in swift ios?

Declare one instance of type IndexPath and maintain the cell status is it selected or not with it. Now use this array within cellForItemAt indexPath and didSelectItemAt indexPath like this. var selectedIndexPaths = IndexPath() func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: “Cell”, for: indexPath) as! PlaceCollectionViewCell //Your code … Read more

[Solved] iOS Charts, wavy lines

Please check this : let ds1 = LineChartDataSet(values: yse1, label: “Hello”) ds1.colors = [NSUIColor.red] ds1.drawCirclesEnabled = false ds1.drawValuesEnabled = false ds1.mode = .cubicBezier // add this line data.addDataSet(ds1) let ds2 = LineChartDataSet(values: yse2, label: “World”) ds2.colors = [NSUIColor.blue] ds2.drawCirclesEnabled = false ds2.drawValuesEnabled = false ds2.mode = .cubicBezier // add this line data.addDataSet(ds2) solved iOS Charts, … Read more

[Solved] How to wait core data add functions step by step in swift 3

try using completion handler for your function or may try Operation queue with dependency to wait coreDataAdd (where : “User”, onCompletion: { (isFinished) in if isFinished { coreDataAdd (where : “Profile”, onCompletion: { (isFinished) in if isFinished { coreDataAdd (where : “Profile”, onCompletion: { (isFinished) in if isFinished //Here segue to the next view let … Read more

[Solved] 2017-08-16 05:08:54 Convert String to in Date “17-Aug 13 : 30” using swift 3

The input is yyyy-MM-dd hh:mm:ss and the output is dd-MMM HH:mm.So do like let outFormatter = DateFormatter() // set the input format outFormatter.dateFormat = “yyyy-MM-dd hh:mm:ss” // convert your string to date let date = outFormatter.date(from: “2017-08-16 05:08:54”)! // set the output format outFormatter.dateFormat = “dd-MMM HH : mm” // convert your date to expected … Read more

[Solved] Date string convertion wrong month

As you need please use below method. it will give you proper month formated date func monthFormatechange(_ dateString : String) -> String { let dateFormatter = DateFormatter() dateFormatter.dateFormat = “dd-MM-yyyy” let date = dateFormatter.date(from:dateString) dateFormatter.dateFormat = “dd-MMM-yyyy” let actualDate = dateFormatter.string(from: date!) return actualDate } solved Date string convertion wrong month

[Solved] Convert Swift 2 code to Swift 3

Does this work? let size = text.boundingRect(with: CGSize(width: view.frame.width – 26, height: 2000), options: NSStringDrawingOptions.usesFontLeading.union(.usesLineFragmentOrigin), context: nil).size 2 solved Convert Swift 2 code to Swift 3

[Solved] How do I get the shortest path between two given coordinates in MapView? [closed]

You can use Directions API given by Google Maps SDK. Example: https://maps.googleapis.com/maps/api/directions/json?origin=lat,long&destination=lat1,lon1 It takes source and destination latitude and longitude and returns a JSON object of routes and the distance for each route. You can select the shortest route and map it. 0 solved How do I get the shortest path between two given coordinates … Read more