# Swift

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

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

**Page:** 18

---

## [Xcode 10-beta error. need help](https://forums.kodeco.com/t/xcode-10-beta-error-need-help/47346)

<div class="topic-metadata">

**Author:** [@anon44759713](https://forums.kodeco.com/u/anon44759713)\
**Replies:** 3\
**Last updated:** [December 12, 2018, 3:15am UTC](https://forums.kodeco.com/t/xcode-10-beta-error-need-help/47346 "2018-12-12T03:15:24Z")

</div>

so I’m learning the courses from the ios development and I’m getting an error on the xcode 10 beta. it says “error: variables currently must have initial value when entered at the top level of the REPL let lifeStage: S…

---

## [Core Data not playing fair](https://forums.kodeco.com/t/core-data-not-playing-fair/55035)

<div class="topic-metadata">

**Author:** [@dadixon](https://forums.kodeco.com/u/dadixon)\
**Replies:** 4\
**Last updated:** [December 12, 2018, 2:34am UTC](https://forums.kodeco.com/t/core-data-not-playing-fair/55035 "2018-12-12T02:34:25Z")

</div>

I have 2 entities. 1 is a parent of the other with the relationship of one-to-many. The deletion rule is nullify. I create a parent entity. Then I created some child entities. When I delete a child entity everything is g…

---

## [PDF Image Is Not Visible](https://forums.kodeco.com/t/pdf-image-is-not-visible/47401)

<div class="topic-metadata">

**Author:** [@jport1130](https://forums.kodeco.com/u/jport1130)\
**Replies:** 1\
**Last updated:** [December 8, 2018, 1:48am UTC](https://forums.kodeco.com/t/pdf-image-is-not-visible/47401 "2018-12-08T01:48:46Z")

</div>

I am using HTML to create a PDF. When I preview my PDF the image is visible, but when I PDF the view the image is not visible. Does anyone have any suggestions? let logoImageURL = “File\_PDF@2x.png” HTMLContent = HTML…

---

## [Please i have question on photo vault app in swift language](https://forums.kodeco.com/t/please-i-have-question-on-photo-vault-app-in-swift-language/15792)

<div class="topic-metadata">

**Author:** [@almass](https://forums.kodeco.com/u/almass)\
**Replies:** 1\
**Last updated:** [December 8, 2018, 1:40am UTC](https://forums.kodeco.com/t/please-i-have-question-on-photo-vault-app-in-swift-language/15792 "2018-12-08T01:40:47Z")

</div>

Hello , I Hope All Is Well Please I Have Create Photo Vault App In Swift Language And Am Try To Get All Albums In My App Like Photos App In iPhone Am Using The Photos Framework But I Couldn’t Get The Albums I Don’t K…

---

## [In ios1,how to modify the code so the slider doesn't reset the halfway but start from the same position in each round?](https://forums.kodeco.com/t/in-ios1-how-to-modify-the-code-so-the-slider-doesnt-reset-the-halfway-but-start-from-the-same-position-in-each-round/15331)

<div class="topic-metadata">

**Author:** [@felixli](https://forums.kodeco.com/u/felixli)\
**Replies:** 1\
**Last updated:** [December 8, 2018, 1:38am UTC](https://forums.kodeco.com/t/in-ios1-how-to-modify-the-code-so-the-slider-doesnt-reset-the-halfway-but-start-from-the-same-position-in-each-round/15331 "2018-12-08T01:38:01Z")

</div>

---

## [Networking layer tutorial](https://forums.kodeco.com/t/networking-layer-tutorial/56026)

<div class="topic-metadata">

**Author:** [@swiftwitcher](https://forums.kodeco.com/u/swiftwitcher)\
**Replies:** 5\
**Last updated:** [December 5, 2018, 7:25am UTC](https://forums.kodeco.com/t/networking-layer-tutorial/56026 "2018-12-05T07:25:20Z")

</div>

Hello, So i just finished the learning path for iOS, and i know a little bit about MVC, but i can’t find a tutorial here with the networking layer described/explained. Do we have one here and i’m just missing it? Than…

---

## [Bull's Eye Tutorial - Score is not adding correctly](https://forums.kodeco.com/t/bulls-eye-tutorial-score-is-not-adding-correctly/56645)

<div class="topic-metadata">

**Author:** [@hunterfitch](https://forums.kodeco.com/u/hunterfitch)\
**Replies:** 4\
**Last updated:** [November 30, 2018, 4:25pm UTC](https://forums.kodeco.com/t/bulls-eye-tutorial-score-is-not-adding-correctly/56645 "2018-11-30T16:25:47Z")

</div>

Hello there! I’ve just completed the portion of the Bull’s Eye tutorial where we’ve added 100 additional points for a perfect score and 50 points for a 99… the score on the alert menu is correct. For instance if I get a …

---

## [Why i can't use singleton? Why it is bad design pattern?](https://forums.kodeco.com/t/why-i-cant-use-singleton-why-it-is-bad-design-pattern/56168)

<div class="topic-metadata">

**Author:** [@wellbranding](https://forums.kodeco.com/u/wellbranding)\
**Replies:** 2\
**Last updated:** [November 30, 2018, 4:50am UTC](https://forums.kodeco.com/t/why-i-cant-use-singleton-why-it-is-bad-design-pattern/56168 "2018-11-30T04:50:52Z")

</div>

Hello, I came from Android world and still feel confused in IOS… The reason is design pattern. For instance one of coolest and actually preferable by Google way of developing android app is using MVVM + repository. Basic…

---

## [Rotate UIView with constraints](https://forums.kodeco.com/t/rotate-uiview-with-constraints/56121)

<div class="topic-metadata">

**Author:** [@efthemiosprime](https://forums.kodeco.com/u/efthemiosprime)\
**Replies:** 2\
**Last updated:** [November 30, 2018, 4:45am UTC](https://forums.kodeco.com/t/rotate-uiview-with-constraints/56121 "2018-11-30T04:45:27Z")

</div>

I’m trying to achieve this: I have tried rotating it with transform such as: greenView.transform = CGAffineTransform(rotationAngle: -(.pi/2)) But can’t achieve the desire effect. Can anyone please, let me know on …

---

## [Convert timestamp from Firebase to readable date](https://forums.kodeco.com/t/convert-timestamp-from-firebase-to-readable-date/55588)

<div class="topic-metadata">

**Author:** [@stianand](https://forums.kodeco.com/u/stianand)\
**Replies:** 2\
**Last updated:** [November 30, 2018, 4:42am UTC](https://forums.kodeco.com/t/convert-timestamp-from-firebase-to-readable-date/55588 "2018-11-30T04:42:21Z")

</div>

I would like to convert a timestamp posted in firebase to readable data. I am able to read the timestamp, but not able to convert it, or append it to an array. This is my progress: var orderDateHistoryArray = \[String:I…

---

## [How to Add a Method to Core Data Model Subclasses](https://forums.kodeco.com/t/how-to-add-a-method-to-core-data-model-subclasses/56206)

<div class="topic-metadata">

**Author:** [@msuboh](https://forums.kodeco.com/u/msuboh)\
**Replies:** 2\
**Last updated:** [November 29, 2018, 9:32am UTC](https://forums.kodeco.com/t/how-to-add-a-method-to-core-data-model-subclasses/56206 "2018-11-29T09:32:10Z")

</div>

want to add a method or a custom attribute to the generate subclass Entity. //---------------- Books+CoreDataClass.swift ---------- import Foundation import CoreData @objc(Books) public class Books: NSManagedObject …

---

## [Anyone familiar with StoreKit?](https://forums.kodeco.com/t/anyone-familiar-with-storekit/56195)

<div class="topic-metadata">

**Author:** [@tjl037](https://forums.kodeco.com/u/tjl037)\
**Replies:** 1\
**Last updated:** [November 24, 2018, 9:29pm UTC](https://forums.kodeco.com/t/anyone-familiar-with-storekit/56195 "2018-11-24T21:29:25Z")

</div>

After following the auto-renewable subscriptions course, I found it far too confusing - and throws in a lot of information my app just doesn’t need. I really just need something simple that shows an alert pop up after th…

---

## [How do you pick a random string from an array?](https://forums.kodeco.com/t/how-do-you-pick-a-random-string-from-an-array/55368)

<div class="topic-metadata">

**Author:** [@tjl037](https://forums.kodeco.com/u/tjl037)\
**Replies:** 7\
**Last updated:** [November 14, 2018, 7:33am UTC](https://forums.kodeco.com/t/how-do-you-pick-a-random-string-from-an-array/55368 "2018-11-14T07:33:52Z")

</div>

Hello there, how do you pick a random string in Swift from an array? for example; let names = \[“Timmy”, “Von”, “Bimmy”\] Thank you.

---

## [Countries spinner with flags!](https://forums.kodeco.com/t/countries-spinner-with-flags/55257)

<div class="topic-metadata">

**Author:** [@wellbranding](https://forums.kodeco.com/u/wellbranding)\
**Replies:** 1\
**Last updated:** [November 12, 2018, 8:50pm UTC](https://forums.kodeco.com/t/countries-spinner-with-flags/55257 "2018-11-12T20:50:16Z")

</div>

Hello, I am developing a framework which needs to use countries spinner… I have tried to find good library for this purpose, but it becomes difficult to build my framework with external dependency. You need to ship you f…

---

## [Use switch as global variable on multiple classes in Swift 4](https://forums.kodeco.com/t/use-switch-as-global-variable-on-multiple-classes-in-swift-4/54859)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 1\
**Last updated:** [November 10, 2018, 6:34am UTC](https://forums.kodeco.com/t/use-switch-as-global-variable-on-multiple-classes-in-swift-4/54859 "2018-11-10T06:34:11Z")

</div>

I am trying to use a global variable to determine the background color of multiple classes. So if the switch in settingsViewController is on the background color should be red if it’s off it should be blue. I am also use…

---

## [Use Symbols in storyboard just like in Sketch](https://forums.kodeco.com/t/use-symbols-in-storyboard-just-like-in-sketch/54827)

<div class="topic-metadata">

**Author:** [@mesqueeb](https://forums.kodeco.com/u/mesqueeb)\
**Replies:** 1\
**Last updated:** [November 7, 2018, 6:23pm UTC](https://forums.kodeco.com/t/use-symbols-in-storyboard-just-like-in-sketch/54827 "2018-11-07T18:23:43Z")

</div>

Hi, I’m used to creating designs in Sketch, then writing that same design in JavaScript and CSS. I recently started learning iOS development here. I see that the storyboard design part is similar to just something like …

---

## [How to position textview in text in arkit](https://forums.kodeco.com/t/how-to-position-textview-in-text-in-arkit/41795)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 0\
**Last updated:** [April 20, 2018, 3:30pm UTC](https://forums.kodeco.com/t/how-to-position-textview-in-text-in-arkit/41795 "2018-04-20T15:30:18Z")

</div>

I am trying to enter textfield text as arkit text and place the text as a object in the arkitview. What I have below is not working and there are a couple of compiling errors. let cZ = randomFloat(min: -2, max: -0.2) …

---

## [Reset orientation, scale](https://forums.kodeco.com/t/reset-orientation-scale/54133)

<div class="topic-metadata">

**Author:** [@efthemiosprime](https://forums.kodeco.com/u/efthemiosprime)\
**Replies:** 4\
**Last updated:** [October 31, 2018, 4:47pm UTC](https://forums.kodeco.com/t/reset-orientation-scale/54133 "2018-10-31T16:47:35Z")

</div>

I have scene.allowsCameraControl = false. after interacting scaling, rotating. how can i reset it?

---

## [Nested Comments UI - UITableView](https://forums.kodeco.com/t/nested-comments-ui-uitableview/53221)

<div class="topic-metadata">

**Author:** [@el\_cid](https://forums.kodeco.com/u/el_cid)\
**Replies:** 4\
**Last updated:** [October 31, 2018, 4:34pm UTC](https://forums.kodeco.com/t/nested-comments-ui-uitableview/53221 "2018-10-31T16:34:55Z")

</div>

I am working on news reading app - and I am having trouble with the comments UI. What is the proper way to nest comments - eg: Apollo, Narwhal etc. Do they just indent the content in the cell based on the ‘depth’ of the …

---

## [Physics on objects in SceneKit, when did it reach the end position?](https://forums.kodeco.com/t/physics-on-objects-in-scenekit-when-did-it-reach-the-end-position/53439)

<div class="topic-metadata">

**Author:** [@verti](https://forums.kodeco.com/u/verti)\
**Replies:** 2\
**Last updated:** [October 31, 2018, 8:44am UTC](https://forums.kodeco.com/t/physics-on-objects-in-scenekit-when-did-it-reach-the-end-position/53439 "2018-10-31T08:44:02Z")

</div>

Hi, for the first time I am trying to make a game using 3d and Physics in SceneKit. I thought I start simple with a game of dice, and all goes well except for one thing: if I throw the dice, and the roll around by the p…

---

## [Have user place 3d arkit object (swift4)](https://forums.kodeco.com/t/have-user-place-3d-arkit-object-swift4/53756)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 1\
**Last updated:** [October 29, 2018, 6:48pm UTC](https://forums.kodeco.com/t/have-user-place-3d-arkit-object-swift4/53756 "2018-10-29T18:48:10Z")

</div>

Right now in my ark app. My 3d object just shows up. I would like to have the user to be able to control where they place the object using the touches began function. I would like the user to be able to place the object …

---

## [Looking for a GitHub API Package for Vapor](https://forums.kodeco.com/t/looking-for-a-github-api-package-for-vapor/53396)

<div class="topic-metadata">

**Author:** [@mikebronner](https://forums.kodeco.com/u/mikebronner)\
**Replies:** 4\
**Last updated:** [October 29, 2018, 8:39am UTC](https://forums.kodeco.com/t/looking-for-a-github-api-package-for-vapor/53396 "2018-10-29T08:39:08Z")

</div>

Can anyone point me to a GitHub API package for use with Vapor? I’ve been googling but have come up empty-handed. What are others doing to interface with the Github API? Thanks :slight\_smile:

---

## [Create and write on dxf file](https://forums.kodeco.com/t/create-and-write-on-dxf-file/53112)

<div class="topic-metadata">

**Author:** [@xinlok](https://forums.kodeco.com/u/xinlok)\
**Replies:** 1\
**Last updated:** [October 28, 2018, 5:46am UTC](https://forums.kodeco.com/t/create-and-write-on-dxf-file/53112 "2018-10-28T05:46:11Z")

</div>

Can any one assist by providing information or tutorial how to create a dxf file using swift and draw a line inside this file?

---

## [macOS: Menu bar app that fetches data periodically](https://forums.kodeco.com/t/macos-menu-bar-app-that-fetches-data-periodically/51247)

<div class="topic-metadata">

**Author:** [@graemeing](https://forums.kodeco.com/u/graemeing)\
**Replies:** 1\
**Last updated:** [October 27, 2018, 9:33am UTC](https://forums.kodeco.com/t/macos-menu-bar-app-that-fetches-data-periodically/51247 "2018-10-27T09:33:30Z")

</div>

I have an intermediate knowledge of swift on macOS (thanks to these tutorials!) but lack the building block knowledge to do this: A lightweight app that runs on the menu bar (status bar). It periodically fetches web dat…

---

## [IOS device not showing up in the active scheme](https://forums.kodeco.com/t/ios-device-not-showing-up-in-the-active-scheme/53858)

<div class="topic-metadata">

**Author:** [@thammaporn](https://forums.kodeco.com/u/thammaporn)\
**Replies:** 4\
**Last updated:** [October 27, 2018, 9:18am UTC](https://forums.kodeco.com/t/ios-device-not-showing-up-in-the-active-scheme/53858 "2018-10-27T09:18:03Z")

</div>

Hello , I have downloaded the project from " Beginning Collection Views" Tutorial VDO. But I have some trouble when run the project. There are not IOS device (such as Iphone7 , IphoneX ) in the active scheme as pic…

---

## [Fetch core data string and place in a label (Swift4)](https://forums.kodeco.com/t/fetch-core-data-string-and-place-in-a-label-swift4/45574)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 1\
**Last updated:** [October 24, 2018, 8:15pm UTC](https://forums.kodeco.com/t/fetch-core-data-string-and-place-in-a-label-swift4/45574 "2018-10-24T20:15:35Z")

</div>

I am trying to call 2 different core data strings and place them each on separate labels. Right now I am getting the error Cannot invoke initializer for type ‘init(\_:)’ with an argument list of type ‘(\[NSManagedObject\])’…

---

## [Geofencing iOS12 Screen Time](https://forums.kodeco.com/t/geofencing-ios12-screen-time/53229)

<div class="topic-metadata">

**Author:** [@vincentday](https://forums.kodeco.com/u/vincentday)\
**Replies:** 2\
**Last updated:** [October 19, 2018, 12:13pm UTC](https://forums.kodeco.com/t/geofencing-ios12-screen-time/53229 "2018-10-19T12:13:25Z")

</div>

I am a HS teacher working with a student who is hoping to create an app to limit distractions. Is it possible to use geofencing to access Apple’s controls? Specifically, would she be able access the screen time controls? …

---

## [Development video streaming for youtube](https://forums.kodeco.com/t/development-video-streaming-for-youtube/26379)

<div class="topic-metadata">

**Author:** [@vladyslavv8](https://forums.kodeco.com/u/vladyslavv8)\
**Replies:** 3\
**Last updated:** [October 18, 2018, 10:05pm UTC](https://forums.kodeco.com/t/development-video-streaming-for-youtube/26379 "2018-10-18T22:05:46Z")

</div>

Is there a samples for swift in youtube live streaming? I have read the guide YouTube Live Streaming API Overview | Google Developers, and do not found anything for iOS, I’m trying to do it on videoCore toolkit and rt…

---

## [ARC Memory Management - not deallocating Objects](https://forums.kodeco.com/t/arc-memory-management-not-deallocating-objects/50712)

<div class="topic-metadata">

**Author:** [@speedlearner](https://forums.kodeco.com/u/speedlearner)\
**Replies:** 2\
**Last updated:** [October 17, 2018, 7:00pm UTC](https://forums.kodeco.com/t/arc-memory-management-not-deallocating-objects/50712 "2018-10-17T19:00:00Z")

</div>

Hi there, this is my first thread in this forum. I did the following introduction to memory management, but unfortunately it is not deallocating the the objects as expected (given in the tut). May you can help and I m…

---

## [Two table views in single view controller](https://forums.kodeco.com/t/two-table-views-in-single-view-controller/52971)

<div class="topic-metadata">

**Author:** [@jport1130](https://forums.kodeco.com/u/jport1130)\
**Replies:** 3\
**Last updated:** [October 17, 2018, 8:59am UTC](https://forums.kodeco.com/t/two-table-views-in-single-view-controller/52971 "2018-10-17T08:59:58Z")

</div>

I have two table views in a single view contorller and want to be able to make a selection in the first table view and then show the details in the second table view. I have tried may options with no success. I assume …

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

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