# Swift

**URL:** https://forums.kodeco.com/c/general/swift/15.md?page=23

[Latest](https://forums.kodeco.com/latest.md) · [Categories](https://forums.kodeco.com/categories.md) · [Tags](https://forums.kodeco.com/tags.md)

**Page:** 24

---

## [Running localhost for local files in WKWebkitView](https://forums.kodeco.com/t/running-localhost-for-local-files-in-wkwebkitview/39213)

<div class="topic-metadata">

**Author:** [@deniznasif](https://forums.kodeco.com/u/deniznasif)\
**Replies:** 5\
**Last updated:** [February 18, 2018, 7:33pm UTC](https://forums.kodeco.com/t/running-localhost-for-local-files-in-wkwebkitview/39213 "2018-02-18T19:33:49Z")

</div>

Hello, I have a local html build which loads content dynamically, so therefore it needs localhost to run. Before when running content through the old webView this was done automatically so no additional setup was needed.…

---

## [Play a video from shared iTunes library (Home Sharing)](https://forums.kodeco.com/t/play-a-video-from-shared-itunes-library-home-sharing/39388)

<div class="topic-metadata">

**Author:** [@soofle616](https://forums.kodeco.com/u/soofle616)\
**Replies:** 1\
**Last updated:** [February 18, 2018, 6:25pm UTC](https://forums.kodeco.com/t/play-a-video-from-shared-itunes-library-home-sharing/39388 "2018-02-18T18:25:49Z")

</div>

Been digging around the dev documentation from Apple and posted on SO but can’t seem to find anything or even get a response on this. Is it possible to create an app that can connect to a user’s shared iTunes library via…

---

## [Swift 3.0 Cheat sheet Question](https://forums.kodeco.com/t/swift-3-0-cheat-sheet-question/30840)

<div class="topic-metadata">

**Author:** [@derekm](https://forums.kodeco.com/u/derekm)\
**Replies:** 3\
**Last updated:** [February 17, 2018, 1:32am UTC](https://forums.kodeco.com/t/swift-3-0-cheat-sheet-question/30840 "2018-02-17T01:32:23Z")

</div>

I thought I had a bit of a handle on arrays, but I don’t understand this. Can some one explain what the waldo part is doing at the array.append and why var waldo = array\[2\]. the (person) comes from that is being printe…

---

## [Display binary data on image view](https://forums.kodeco.com/t/display-binary-data-on-image-view/39316)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 10\
**Last updated:** [February 12, 2018, 2:12am UTC](https://forums.kodeco.com/t/display-binary-data-on-image-view/39316 "2018-02-12T02:12:47Z")

</div>

I am trying to to call binary data from core data and display in a image view in a collection view cell. This code below works on a string being called from core data and it being displayed in a label. TRYING TO DISPLAY…

---

## [Show ViewSontrollers without using buttons](https://forums.kodeco.com/t/show-viewsontrollers-without-using-buttons/39239)

<div class="topic-metadata">

**Author:** [@equiavia](https://forums.kodeco.com/u/equiavia)\
**Replies:** 2\
**Last updated:** [February 7, 2018, 4:46am UTC](https://forums.kodeco.com/t/show-viewsontrollers-without-using-buttons/39239 "2018-02-07T04:46:05Z")

</div>

Hi I have a settings ViewController that I want to show if the users want to add details. Therefore i have no need for a button and want to display the screen when a data set is nil. I for the life of me cannot figure o…

---

## [Use Userdueflts on a struct](https://forums.kodeco.com/t/use-userdueflts-on-a-struct/35531)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 1\
**Last updated:** [February 6, 2018, 12:07pm UTC](https://forums.kodeco.com/t/use-userdueflts-on-a-struct/35531 "2018-02-06T12:07:49Z")

</div>

My code below uses a struct to organize the data. However when I go to the next view controller and return to the original one all of the data is deleted. How can I use user defaults to save the data to the label. …

---

## [Print coedata on a collection view cell label (swift4)](https://forums.kodeco.com/t/print-coedata-on-a-collection-view-cell-label-swift4/39092)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 1\
**Last updated:** [February 3, 2018, 8:09am UTC](https://forums.kodeco.com/t/print-coedata-on-a-collection-view-cell-label-swift4/39092 "2018-02-03T08:09:56Z")

</div>

This code below prints all of the entries of coreData on a label. var users = \[User\]() override func viewDidLoad() { super.viewDidLoad() if cdHandler.fetchObject() != nil { users = cdHandler.fetchObject()! f…

---

## [AutoLayout Overlapping Problem](https://forums.kodeco.com/t/autolayout-overlapping-problem/37857)

<div class="topic-metadata">

**Author:** [@chicago](https://forums.kodeco.com/u/chicago)\
**Replies:** 1\
**Last updated:** [January 30, 2018, 12:01am UTC](https://forums.kodeco.com/t/autolayout-overlapping-problem/37857 "2018-01-30T00:01:54Z")

</div>

I am trying to eliminate all warnings in my app to update it to the App Store. Warnings are deceptive because while they do not appear on one iPhone model, warnings can pop up when viewed on another iPhone model. I hav…

---

## [PDFKit iOS 11 , Displaced Pdf](https://forums.kodeco.com/t/pdfkit-ios-11-displaced-pdf/39005)

<div class="topic-metadata">

**Author:** [@miladbigle](https://forums.kodeco.com/u/miladbigle)\
**Replies:** 3\
**Last updated:** [January 29, 2018, 11:44pm UTC](https://forums.kodeco.com/t/pdfkit-ios-11-displaced-pdf/39005 "2018-01-29T23:44:25Z")

</div>

I have This Code for Read UITable var documents = PDFDocument override func tableView(\_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -\> UITableViewCell { let cell = tableView.dequeueReusa…

---

## [How to insert podcasts files into a Xcode podcast](https://forums.kodeco.com/t/how-to-insert-podcasts-files-into-a-xcode-podcast/38001)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 2\
**Last updated:** [January 29, 2018, 11:19pm UTC](https://forums.kodeco.com/t/how-to-insert-podcasts-files-into-a-xcode-podcast/38001 "2018-01-29T23:19:11Z")

</div>

If i wanted to created a specifically to play certain podcasts from the iTunes library how would i do this. I look online for tutorials but have not seen a lot of stuff that specifically relates to this.

---

## [Trigger core data save after tableview text change](https://forums.kodeco.com/t/trigger-core-data-save-after-tableview-text-change/31069)

<div class="topic-metadata">

**Author:** [@erich\_snijder](https://forums.kodeco.com/u/erich_snijder)\
**Replies:** 1\
**Last updated:** [January 29, 2018, 6:29pm UTC](https://forums.kodeco.com/t/trigger-core-data-save-after-tableview-text-change/31069 "2018-01-29T18:29:33Z")

</div>

I use in my OSX App a Core Data Api. It create’s an sqlite database. I’ve connected the core data to my NSArrayController bij bindings. The NSArrayController is connect to an NSTableView by bindings. All the data is …

---

## [Videos VS Books](https://forums.kodeco.com/t/videos-vs-books/35352)

<div class="topic-metadata">

**Author:** [@astro](https://forums.kodeco.com/u/astro)\
**Replies:** 1\
**Last updated:** [January 29, 2018, 5:50am UTC](https://forums.kodeco.com/t/videos-vs-books/35352 "2018-01-29T05:50:02Z")

</div>

Hello everyone, I hesitate between buying “swift apprentice” or taking a subscription. Is there a difference between the videos “Programming in Swift” and the book? If I take a subscription do I have access to the boo…

---

## [Why don't we build example apps using MVVM?](https://forums.kodeco.com/t/why-dont-we-build-example-apps-using-mvvm/36523)

<div class="topic-metadata">

**Author:** [@dnesh](https://forums.kodeco.com/u/dnesh)\
**Replies:** 1\
**Last updated:** [January 29, 2018, 5:42am UTC](https://forums.kodeco.com/t/why-dont-we-build-example-apps-using-mvvm/36523 "2018-01-29T05:42:29Z")

</div>

It would be great to show the usage and power of MVVM by practicing it while working on these tutorials

---

## [How do I copy an array within and object?](https://forums.kodeco.com/t/how-do-i-copy-an-array-within-and-object/38951)

<div class="topic-metadata">

**Author:** [@jport1130](https://forums.kodeco.com/u/jport1130)\
**Replies:** 2\
**Last updated:** [January 29, 2018, 2:51am UTC](https://forums.kodeco.com/t/how-do-i-copy-an-array-within-and-object/38951 "2018-01-29T02:51:30Z")

</div>

I have an array of objects and each object contains another array. How do I copy the array within the object? Using NSCopying I have been able to copy the object but the array within it will not copy.

---

## [Deferring Location Updates not working](https://forums.kodeco.com/t/deferring-location-updates-not-working/38794)

<div class="topic-metadata">

**Author:** [@anand4u](https://forums.kodeco.com/u/anand4u)\
**Replies:** 3\
**Last updated:** [January 24, 2018, 3:05am UTC](https://forums.kodeco.com/t/deferring-location-updates-not-working/38794 "2018-01-24T03:05:12Z")

</div>

Do any of you guys experience the same issue that i’ve been experiencing. Here is my code: let locationManager : CLLocationManager = CLLocationManager() locationManager.delegate = self locationManager.desiredAccuracy …

---

## [coreData not fetching](https://forums.kodeco.com/t/coredata-not-fetching/38777)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 2\
**Last updated:** [January 23, 2018, 3:01am UTC](https://forums.kodeco.com/t/coredata-not-fetching/38777 "2018-01-23T03:01:43Z")

</div>

My code below is using core data to add entities to a tableview. The problem is that when I hit the button to add a new entry the data is not displayed on the tableview. But if I quit the simulator and re install the app…

---

## [How to access three edittext value in tableview](https://forums.kodeco.com/t/how-to-access-three-edittext-value-in-tableview/38789)

<div class="topic-metadata">

**Author:** [@bibhu065](https://forums.kodeco.com/u/bibhu065)\
**Replies:** 1\
**Last updated:** [January 23, 2018, 12:42am UTC](https://forums.kodeco.com/t/how-to-access-three-edittext-value-in-tableview/38789 "2018-01-23T00:42:58Z")

</div>

How to access three edit text value from each section row of the table view from user interface menu?

---

## [Background processing when app is not running](https://forums.kodeco.com/t/background-processing-when-app-is-not-running/38073)

<div class="topic-metadata">

**Author:** [@mkeramat](https://forums.kodeco.com/u/mkeramat)\
**Replies:** 2\
**Last updated:** [January 22, 2018, 7:50pm UTC](https://forums.kodeco.com/t/background-processing-when-app-is-not-running/38073 "2018-01-22T19:50:35Z")

</div>

Is it possible to wake up an iOS app (when its NOT Running) to execute couple of background tasks (i.e communicate with a Bluetooth LE device and upload the data to a web server) without user interaction? I have conside…

---

## [Vapour v Perfect](https://forums.kodeco.com/t/vapour-v-perfect/28851)

<div class="topic-metadata">

**Author:** [@jonny](https://forums.kodeco.com/u/jonny)\
**Replies:** 1\
**Last updated:** [January 21, 2018, 8:32pm UTC](https://forums.kodeco.com/t/vapour-v-perfect/28851 "2018-01-21T20:32:13Z")

</div>

Hi @raywenderlich Great to see multiple Server Side Swift products with tutorials. In your work so far which one do you prefer and why? If that is too direct a question as I know some of the tutorials are sponsored, per…

---

## [How to use JSON2HTML in Swift?](https://forums.kodeco.com/t/how-to-use-json2html-in-swift/26077)

<div class="topic-metadata">

**Author:** [@javid94](https://forums.kodeco.com/u/javid94)\
**Replies:** 1\
**Last updated:** [January 21, 2018, 8:08pm UTC](https://forums.kodeco.com/t/how-to-use-json2html-in-swift/26077 "2018-01-21T20:08:20Z")

</div>

let jsfile1 = try!String(contentsOfFile: Bundle.main.path(forResource: “json2html”, ofType: “js”)!) func loadJS() { var getData={} var context = JSContext() var valSwiftyJson:JSON = \[:\] var test = context?.evaluate…

---

## [How to rebuild a core data stack?](https://forums.kodeco.com/t/how-to-rebuild-a-core-data-stack/27446)

<div class="topic-metadata">

**Author:** [@timdavey](https://forums.kodeco.com/u/timdavey)\
**Replies:** 1\
**Last updated:** [January 21, 2018, 7:18pm UTC](https://forums.kodeco.com/t/how-to-rebuild-a-core-data-stack/27446 "2018-01-21T19:18:48Z")

</div>

I’m having trouble rebuilding my core data stack (using Swift 3). My data is essentially an offline cache, never a source of truth, and is read-only, so when I update my model I should be able to just tear down my core d…

---

## [Detecting nodes near the hit node](https://forums.kodeco.com/t/detecting-nodes-near-the-hit-node/38256)

<div class="topic-metadata">

**Author:** [@maxshuty](https://forums.kodeco.com/u/maxshuty)\
**Replies:** 1\
**Last updated:** [January 20, 2018, 6:31pm UTC](https://forums.kodeco.com/t/detecting-nodes-near-the-hit-node/38256 "2018-01-20T18:31:41Z")

</div>

Hello all, I’m struggling to figure out the best way to handle this scenario. Basically what I have now is a scene with a sphere made of cubes like this: At the end of the day I jus…

---

## [App crashes first time loading on iPad](https://forums.kodeco.com/t/app-crashes-first-time-loading-on-ipad/38561)

<div class="topic-metadata">

**Author:** [@jport1130](https://forums.kodeco.com/u/jport1130)\
**Replies:** 7\
**Last updated:** [January 16, 2018, 1:24pm UTC](https://forums.kodeco.com/t/app-crashes-first-time-loading-on-ipad/38561 "2018-01-16T13:24:21Z")

</div>

The first time I tried to load my app onto my iPad I received this error: Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value. My app stopped in the “numberOfItemsInSection” at the array co…

---

## [How to clear uiview drawing](https://forums.kodeco.com/t/how-to-clear-uiview-drawing/38576)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 1\
**Last updated:** [January 16, 2018, 12:10am UTC](https://forums.kodeco.com/t/how-to-clear-uiview-drawing/38576 "2018-01-16T00:10:10Z")

</div>

I am working on a drawing app where the user draws something on a view. On the same view controller I would like to create a button that would erase everything that was on the view and give it a blank slate. How would I …

---

## [Do statement not firing notification (swift4)](https://forums.kodeco.com/t/do-statement-not-firing-notification-swift4/38285)

<div class="topic-metadata">

**Author:** [@zalubski](https://forums.kodeco.com/u/zalubski)\
**Replies:** 1\
**Last updated:** [January 14, 2018, 4:14pm UTC](https://forums.kodeco.com/t/do-statement-not-firing-notification-swift4/38285 "2018-01-14T16:14:47Z")

</div>

First off I am not very familiar with do statements but I think they can be used just like a action button. My code below is a alarm. All I wanted to do is when the alarm goes off for the notification to appear. Thats it…

---

## [What is the best way to delete an object from a filtered array?](https://forums.kodeco.com/t/what-is-the-best-way-to-delete-an-object-from-a-filtered-array/38470)

<div class="topic-metadata">

**Author:** [@jport1130](https://forums.kodeco.com/u/jport1130)\
**Replies:** 9\
**Last updated:** [January 14, 2018, 2:33am UTC](https://forums.kodeco.com/t/what-is-the-best-way-to-delete-an-object-from-a-filtered-array/38470 "2018-01-14T02:33:34Z")

</div>

I have a search bar that allows me to filter through an array. Once I have the results of the filter I would like to be able to delete a object, if necessary. Currently when I try to delete a search result it removes i…

---

## [Improve localization usability and maintainability](https://forums.kodeco.com/t/improve-localization-usability-and-maintainability/38500)

<div class="topic-metadata">

**Author:** [@ulay](https://forums.kodeco.com/u/ulay)\
**Replies:** 1\
**Last updated:** [January 11, 2018, 10:52am UTC](https://forums.kodeco.com/t/improve-localization-usability-and-maintainability/38500 "2018-01-11T10:52:46Z")

</div>

Thinking about this powerful tool that is localization in Xcode projects, I came with the problem that in case you have to change a key of the localizable file you will also have to change it in the whole project looking…

---

## [Spinning wheel concept in iOS](https://forums.kodeco.com/t/spinning-wheel-concept-in-ios/38130)

<div class="topic-metadata">

**Author:** [@gkrz11](https://forums.kodeco.com/u/gkrz11)\
**Replies:** 1\
**Last updated:** [January 5, 2018, 11:09pm UTC](https://forums.kodeco.com/t/spinning-wheel-concept-in-ios/38130 "2018-01-05T23:09:21Z")

</div>

I followed these tutorial, Spinning wheel iOS. Working fine. I want to enable userinteraction for subviews. My Stackoverflow question link Userinteraction enable for subviews How to get userinteraction enable for subvi…

---

## [ZombieConga image files for 2D Apple Games by Tutorials](https://forums.kodeco.com/t/zombieconga-image-files-for-2d-apple-games-by-tutorials/27211)

<div class="topic-metadata">

**Author:** [@aliiiiiiceee](https://forums.kodeco.com/u/aliiiiiiceee)\
**Replies:** 4\
**Last updated:** [January 4, 2018, 9:31pm UTC](https://forums.kodeco.com/t/zombieconga-image-files-for-2d-apple-games-by-tutorials/27211 "2018-01-04T21:31:46Z")

</div>

So I just started reading this book and learning how to use Xcode and it says to drag appropriate icons from starter/resrources/icon but hwere are these files?

---

## [Tutorial: Setting up Codeanywhere for Swift/Vapor development](https://forums.kodeco.com/t/tutorial-setting-up-codeanywhere-for-swift-vapor-development/38192)

<div class="topic-metadata">

**Author:** [@supernova](https://forums.kodeco.com/u/supernova)\
**Replies:** 2\
**Last updated:** [January 4, 2018, 4:29am UTC](https://forums.kodeco.com/t/tutorial-setting-up-codeanywhere-for-swift-vapor-development/38192 "2018-01-04T04:29:42Z")

</div>

Recently, Codeanywhere has started to provide a Swift container for assisting developers to jumpstart Swift development. Unfortunately, the Swift release provided in the container is only version 2.2, while the Vapor fra…

[Previous page](https://forums.kodeco.com/c/general/swift/15.md?page=22)

[Next page](https://forums.kodeco.com/c/general/swift/15.md?page=24)
