# Swift

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

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

**Page:** 25

---

## [Use dateFormatter as Timed Notification trigger (swfit4)](https://forums.kodeco.com/t/use-dateformatter-as-timed-notification-trigger-swfit4/38182)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 0\
**Last updated:** [January 3, 2018, 3:13am UTC](https://forums.kodeco.com/t/use-dateformatter-as-timed-notification-trigger-swfit4/38182 "2018-01-03T03:13:35Z")

</div>

Right now my code uses a textfield to to select a date and time via datePicker. The code also has a button to trigger a notification 4 seconds after the button is pressed. I just wanted to use the date that was selected …

---

## [Create native iOS application using the technology of React Native](https://forums.kodeco.com/t/create-native-ios-application-using-the-technology-of-react-native/38131)

<div class="topic-metadata">

**Author:** [@zhenglibao](https://forums.kodeco.com/u/zhenglibao)\
**Replies:** 0\
**Last updated:** [January 1, 2018, 9:59am UTC](https://forums.kodeco.com/t/create-native-ios-application-using-the-technology-of-react-native/38131 "2018-01-01T09:59:43Z")

</div>

FlexLib is an Objective-C layout framework for iOS. It’s based on flexbox model which is standard for web layout. So the layout capability is powerful and easy to use. With FlexLib, you can write iOS UI much faster than…

---

## [How to layer image over photo taken with imagePicker](https://forums.kodeco.com/t/how-to-layer-image-over-photo-taken-with-imagepicker/38075)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 1\
**Last updated:** [December 31, 2017, 4:42am UTC](https://forums.kodeco.com/t/how-to-layer-image-over-photo-taken-with-imagepicker/38075 "2017-12-31T04:42:05Z")

</div>

My code right now has a image overlay the photo in image picker. The problem is that the layer over the image is not being saved over the photo. It is just being displayed when the user is in the camera mode. How can I s…

---

## [\[VNClassificationObservation\] enumerated()](https://forums.kodeco.com/t/vnclassificationobservation-enumerated/38083)

<div class="topic-metadata">

**Author:** [@jingo\_man](https://forums.kodeco.com/u/jingo_man)\
**Replies:** 0\
**Last updated:** [December 29, 2017, 10:13pm UTC](https://forums.kodeco.com/t/vnclassificationobservation-enumerated/38083 "2017-12-29T22:13:22Z")

</div>

Trying some CoreML stuff, with an image classification. I am inside the loop of the results taken from the video feed, which is updating for every frame taken and doesn’t occur on the main thread. For debugging, I need …

---

## [Convert Solidworks to Scenekit](https://forums.kodeco.com/t/convert-solidworks-to-scenekit/27112)

<div class="topic-metadata">

**Author:** [@cirrusbob](https://forums.kodeco.com/u/cirrusbob)\
**Replies:** 2\
**Last updated:** [December 25, 2017, 11:47pm UTC](https://forums.kodeco.com/t/convert-solidworks-to-scenekit/27112 "2017-12-25T23:47:29Z")

</div>

Solidworks seems to be able to export models in every format except for Collada (.dae). My solution so far is to use Strata Design as an intermediate step to convert the file. Export from Solidworks as a .STL file. Imp…

---

## [Call var from different class swift 4](https://forums.kodeco.com/t/call-var-from-different-class-swift-4/36663)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 1\
**Last updated:** [December 20, 2017, 1:05pm UTC](https://forums.kodeco.com/t/call-var-from-different-class-swift-4/36663 "2017-12-20T13:05:31Z")

</div>

I want to be able call var persons in vc2 to be displayed on a label in vc2 where it says l.text = . Thats if it is possible. VC import UIKit class ViewController: UIViewController { @IBOutlet …

---

## [How to append entry to userdefualt](https://forums.kodeco.com/t/how-to-append-entry-to-userdefualt/36605)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 1\
**Last updated:** [December 20, 2017, 12:41pm UTC](https://forums.kodeco.com/t/how-to-append-entry-to-userdefualt/36605 "2017-12-20T12:41:19Z")

</div>

My code right now saves the label that displays a tuple. The problem is that if I changed view controllers and return to this view controller and enter a new entry all of the prior data is deleted. Everything works fine …

---

## [How do you add an Contact email link to an apps Info page?](https://forums.kodeco.com/t/how-do-you-add-an-contact-email-link-to-an-apps-info-page/37659)

<div class="topic-metadata">

**Author:** [@chicago](https://forums.kodeco.com/u/chicago)\
**Replies:** 5\
**Last updated:** [December 20, 2017, 3:28am UTC](https://forums.kodeco.com/t/how-do-you-add-an-contact-email-link-to-an-apps-info-page/37659 "2017-12-20T03:28:39Z")

</div>

I would like to add my Contact email address to the Info page of my app. I have tried several things, but the added link remains static text. I would like for the user to tap the link and be taken to my apps email page…

---

## [Print image on top of imagePicker when taking photo (swift4)](https://forums.kodeco.com/t/print-image-on-top-of-imagepicker-when-taking-photo-swift4/37550)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 1\
**Last updated:** [December 13, 2017, 1:01pm UTC](https://forums.kodeco.com/t/print-image-on-top-of-imagepicker-when-taking-photo-swift4/37550 "2017-12-13T13:01:52Z")

</div>

Right now my code does a two step process to print a image Over the current image. Take Image and save image to imageView. Then via another button its print the image over the imageView. How can I do all of this in 1 but…

---

## [Custom Cell - button in cell updates multiple cells](https://forums.kodeco.com/t/custom-cell-button-in-cell-updates-multiple-cells/37503)

<div class="topic-metadata">

**Author:** [@stianand](https://forums.kodeco.com/u/stianand)\
**Replies:** 2\
**Last updated:** [December 13, 2017, 8:41am UTC](https://forums.kodeco.com/t/custom-cell-button-in-cell-updates-multiple-cells/37503 "2017-12-13T08:41:57Z")

</div>

I have a table view with custom cells. The cell consists of two buttons and a label. The buttons is a pluss button, and a minus button. The label is used for counting buttonpresses. When the pluss button is pressed, the…

---

## [Guide to make an iPhone menu like this](https://forums.kodeco.com/t/guide-to-make-an-iphone-menu-like-this/37420)

<div class="topic-metadata">

**Author:** [@alejandrossh](https://forums.kodeco.com/u/alejandrossh)\
**Replies:** 2\
**Last updated:** [December 11, 2017, 1:03pm UTC](https://forums.kodeco.com/t/guide-to-make-an-iphone-menu-like-this/37420 "2017-12-11T13:03:33Z")

</div>

Hello all! I need to make a menu like the one in the image. Where it “slides” from the side without covering the entire main view and where you can select your options and then it will shut down and show you that vie…

---

## [Camera Capture, Variable Scope & "Main thread" purple errors](https://forums.kodeco.com/t/camera-capture-variable-scope-main-thread-purple-errors/37430)

<div class="topic-metadata">

**Author:** [@jingo\_man](https://forums.kodeco.com/u/jingo_man)\
**Replies:** 1\
**Last updated:** [December 10, 2017, 4:14am UTC](https://forums.kodeco.com/t/camera-capture-variable-scope-main-thread-purple-errors/37430 "2017-12-10T04:14:56Z")

</div>

I am new to Swift and iOS dev, and this is the first app I am messing about with. I have a CoreML Image Classification task, that takes the “camera capture stream” from the iOS device’s \[video\] camera and occurs in the …

---

## [Chess Knight Shortest Path - Algorithm Question](https://forums.kodeco.com/t/chess-knight-shortest-path-algorithm-question/37455)

<div class="topic-metadata">

**Author:** [@kwstasna](https://forums.kodeco.com/u/kwstasna)\
**Replies:** 0\
**Last updated:** [December 9, 2017, 4:56pm UTC](https://forums.kodeco.com/t/chess-knight-shortest-path-algorithm-question/37455 "2017-12-09T16:56:44Z")

</div>

Hello. I’m trying to make the Knight short path problem in swift Based on this code // all 8 possible movements for a knight fileprivate let knightMoves = \[ \[ 2, -1\], \[ 2, 1\], \[-2, 1\], \[-2, -1\], …

---

## [Your First Swift App: Lesson 15 question](https://forums.kodeco.com/t/your-first-swift-app-lesson-15-question/37389)

<div class="topic-metadata">

**Author:** [@gottzilla](https://forums.kodeco.com/u/gottzilla)\
**Replies:** 1\
**Last updated:** [December 8, 2017, 12:57am UTC](https://forums.kodeco.com/t/your-first-swift-app-lesson-15-question/37389 "2017-12-08T00:57:48Z")

</div>

Hi, I suspect this isn’t the right place to post my question, but I’m new to the site and I haven’t figured out how else to raise this problem. So I followed the lesson to the best of my abilities and when I initiate th…

---

## [I'm new learner and](https://forums.kodeco.com/t/im-new-learner-and/37236)

<div class="topic-metadata">

**Author:** [@berkeyagizsevim](https://forums.kodeco.com/u/berkeyagizsevim)\
**Replies:** 1\
**Last updated:** [December 3, 2017, 5:35pm UTC](https://forums.kodeco.com/t/im-new-learner-and/37236 "2017-12-03T17:35:25Z")

</div>

Hello, I just started this course 2 weeks ago and i’m new learner on Swift. I don’t know how can i use this website and which steps do i use. Could you please help me for my serious problem? Thanks.:slight\_smile:

---

## [Help: view is not in the window hierarchy!](https://forums.kodeco.com/t/help-view-is-not-in-the-window-hierarchy/37118)

<div class="topic-metadata">

**Author:** [@alejandrossh](https://forums.kodeco.com/u/alejandrossh)\
**Replies:** 2\
**Last updated:** [December 1, 2017, 10:31pm UTC](https://forums.kodeco.com/t/help-view-is-not-in-the-window-hierarchy/37118 "2017-12-01T22:31:08Z")

</div>

Hi all, I need your help. I have a very simple app with just 3 swift files (AppDelegate, LoginViewController, SecondViewController) and the idea is that as soon as the user open the app he/she is prompted to log in with…

---

## [How to append array data when switching classes (swift4)](https://forums.kodeco.com/t/how-to-append-array-data-when-switching-classes-swift4/36708)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 1\
**Last updated:** [December 1, 2017, 8:12pm UTC](https://forums.kodeco.com/t/how-to-append-array-data-when-switching-classes-swift4/36708 "2017-12-01T20:12:44Z")

</div>

My code below submits ints to an array the problem is when the user segues to another view controller and then segues back to the original view controller and tries to submit more ints it saves over the original ints tha…

---

## [Trying to print log file on label (swift4)](https://forums.kodeco.com/t/trying-to-print-log-file-on-label-swift4/37192)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 0\
**Last updated:** [December 1, 2017, 1:48am UTC](https://forums.kodeco.com/t/trying-to-print-log-file-on-label-swift4/37192 "2017-12-01T01:48:53Z")

</div>

My code below is calling coreData to print on a label. If I print on a label it only takes the last entry of coreData unlike what is printed on the log file. for i in user! { print( "color: \\(i.username!) Score: \\(…

---

## [UserDefaults not working when switching classes (Swift 4)](https://forums.kodeco.com/t/userdefaults-not-working-when-switching-classes-swift-4/36695)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 3\
**Last updated:** [November 28, 2017, 12:40pm UTC](https://forums.kodeco.com/t/userdefaults-not-working-when-switching-classes-swift-4/36695 "2017-11-28T12:40:24Z")

</div>

My code right now takes new entries into its array. When the user hits the home button on the simulator and returns to the original view controller it works perfectly. However when the view controller is sugued to anothe…

---

## [Call coreData object defined in another class](https://forums.kodeco.com/t/call-coredata-object-defined-in-another-class/37001)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 0\
**Last updated:** [November 27, 2017, 1:18am UTC](https://forums.kodeco.com/t/call-coredata-object-defined-in-another-class/37001 "2017-11-27T01:18:14Z")

</div>

The following code in vc prints the only defined userName in the log. All I want to do is know what to call in twoViewController so I can print the same userName. I want viewcontroller and twoViewController to print the …

---

## [How to add array using CoreData](https://forums.kodeco.com/t/how-to-add-array-using-coredata/36793)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 0\
**Last updated:** [November 21, 2017, 11:03pm UTC](https://forums.kodeco.com/t/how-to-add-array-using-coredata/36793 "2017-11-21T23:03:13Z")

</div>

The following code is just a blank coreData set. I just want to add a string array to this current code. import UIKit import CoreData class ViewController: UIViewController { @IBOutlet var txt: UITextField! @IBActio…

---

## [Time Stamp: How to convert ZuluTime to Pacific Tim](https://forums.kodeco.com/t/time-stamp-how-to-convert-zulutime-to-pacific-tim/36706)

<div class="topic-metadata">

**Author:** [@hcri50](https://forums.kodeco.com/u/hcri50)\
**Replies:** 4\
**Last updated:** [November 20, 2017, 4:17pm UTC](https://forums.kodeco.com/t/time-stamp-how-to-convert-zulutime-to-pacific-tim/36706 "2017-11-20T16:17:12Z")

</div>

I seem not to be able to grasp the time ahead and subtracting the time to Pacific. What I have is a JSON Can iOS convert the Time Stamp that was created by the server?

---

## [Check textfield in alertview](https://forums.kodeco.com/t/check-textfield-in-alertview/36208)

<div class="topic-metadata">

**Author:** [@joachimfh](https://forums.kodeco.com/u/joachimfh)\
**Replies:** 3\
**Last updated:** [November 5, 2017, 10:55am UTC](https://forums.kodeco.com/t/check-textfield-in-alertview/36208 "2017-11-05T10:55:48Z")

</div>

I am more or less new to iOS and there is a lot of fundamental stuff I am missing. I am following your HitList tutorial, and I would like to check wheter my textfield in the alertview is empty or not. So if the field is …

---

## [Type 'Any' has no subscript](https://forums.kodeco.com/t/type-any-has-no-subscript/34496)

<div class="topic-metadata">

**Author:** [@ghost6ix](https://forums.kodeco.com/u/ghost6ix)\
**Replies:** 2\
**Last updated:** [November 5, 2017, 5:57am UTC](https://forums.kodeco.com/t/type-any-has-no-subscript/34496 "2017-11-05T05:57:12Z")

</div>

This is my struct : struct LocationDemo { var name : String? var type : Array\<Any\>? var coordinates : Array\<Any\>? subscript(index: Int) -\> Any { return(coordinates)! } } t…

---

## [CollectionView Layout height from imageView](https://forums.kodeco.com/t/collectionview-layout-height-from-imageview/36098)

<div class="topic-metadata">

**Author:** [@pietrzakmarcin](https://forums.kodeco.com/u/pietrzakmarcin)\
**Replies:** 2\
**Last updated:** [November 5, 2017, 5:49am UTC](https://forums.kodeco.com/t/collectionview-layout-height-from-imageview/36098 "2017-11-05T05:49:08Z")

</div>

Hi, I need help with layout in collection view. I need to make cell with screen width and auto height taking from image. How can I make this?

---

## [Count Dictionary Entries in Plist Swift Xcode](https://forums.kodeco.com/t/count-dictionary-entries-in-plist-swift-xcode/36046)

<div class="topic-metadata">

**Author:** [@kailas198](https://forums.kodeco.com/u/kailas198)\
**Replies:** 3\
**Last updated:** [November 5, 2017, 5:45am UTC](https://forums.kodeco.com/t/count-dictionary-entries-in-plist-swift-xcode/36046 "2017-11-05T05:45:50Z")

</div>

Hey everyone, I was wondering if I could ask for some help? I am currently learning about NSArrays and NSDictionaries. I’m trying to make a pickerview with the number of NSDictionaries in my plist (below) . So far my …

---

## [Trying to populate a picker view](https://forums.kodeco.com/t/trying-to-populate-a-picker-view/36088)

<div class="topic-metadata">

**Author:** [@kailas198](https://forums.kodeco.com/u/kailas198)\
**Replies:** 1\
**Last updated:** [November 1, 2017, 12:00pm UTC](https://forums.kodeco.com/t/trying-to-populate-a-picker-view/36088 "2017-11-01T12:00:12Z")

</div>

Hi Everyone, I was wondering if I could have some help please? I’m trying to populate a pickerview with numbers from 1 to my integer count (number of questions in my plist). I’ve got this so far import Foundation im…

---

## [Returning data from a URLRequest/URLSession response](https://forums.kodeco.com/t/returning-data-from-a-urlrequest-urlsession-response/35996)

<div class="topic-metadata">

**Author:** [@tgregoryknox](https://forums.kodeco.com/u/tgregoryknox)\
**Replies:** 4\
**Last updated:** [October 30, 2017, 6:28pm UTC](https://forums.kodeco.com/t/returning-data-from-a-urlrequest-urlsession-response/35996 "2017-10-30T18:28:37Z")

</div>

I made a function (based on examples online) to get that data and it looks something like this: private func GetResponse(request: URLRequest, completion: @escaping (\_ response: String?) -\> Void) { let task = URLSes…

---

## [Store segue data on different view controller](https://forums.kodeco.com/t/store-segue-data-on-different-view-controller/35942)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 1\
**Last updated:** [October 27, 2017, 3:57am UTC](https://forums.kodeco.com/t/store-segue-data-on-different-view-controller/35942 "2017-10-27T03:57:31Z")

</div>

My code takes text from a textfield and segues to a separate view controller. The problem is that it can only store 1 segue entry. The new one replace the old every time the button is pressed. How on vc2 can I store ever…

---

## [Call struct from different view controller (swift4)](https://forums.kodeco.com/t/call-struct-from-different-view-controller-swift4/35588)

<div class="topic-metadata">

**Author:** [@timswift](https://forums.kodeco.com/u/timswift)\
**Replies:** 6\
**Last updated:** [October 25, 2017, 10:17am UTC](https://forums.kodeco.com/t/call-struct-from-different-view-controller-swift4/35588 "2017-10-25T10:17:34Z")

</div>

I am trying to cal the let name statement inside struct person from twoVIEWCONTROLLER. I thought I can just call a structs entries from another view controller but I am not sure. You can see in twoVIEWCONTROLLER i have “…

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

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