Questions tagged [cs193p]

CS193P is an iOS programming course offered at Stanford University. The latest Fall 2017 session videos, lecture slides and assignments are available on iTunes U, and have become a popular way of learning to program for the platform.

CS193P is an iOS () programming course offered at Stanford University. The latest Fall 2017 session videos, lecture slides, and assignments focus on iOS 11 and Swift 4 () and are available on iTunes U. This course has become a popular way of learning to program for the platform.

References:

173 questions
1
vote
1 answer

How can I use @EnvironmentObject to initialize @State, without using .onAppear?

I am following Stanfords' CS193p Developing Apps for iOS online course. I'm trying to do the Assignment 6 (Memorize Themes.pdf). When I run my app in simulator, I get the following fatal error: Thread 1: Fatal error: Unexpectedly found nil while…
user14119170
  • 1,191
  • 3
  • 8
  • 21
1
vote
1 answer

Error: Value of type 'some View' has no member 'stroke'

I am following Stanfords' CS193p Developing Apps for iOS online course. I am using Xcode 11.5. (I didn't update because that's the version the course instructor (Paul Heagarty) is using.) I'm trying to do the Assignment 3 (Set Game). Currently (to…
user14119170
  • 1,191
  • 3
  • 8
  • 21
1
vote
1 answer

How can I prevent this kind of logic error? (var x changes between its value is copied to another var y and the use of var y, so that y is outdated)

Summary: I made a mistake in my Swift code and I've fixed it. Then I asked myself why this happened and how I could avoid it. I tried some ways but nothing helps. I put the mistake and my thinking below. I hope you could teach me the right method to…
goxcif
  • 11
  • 3
1
vote
0 answers

cs193p "Could not build objective-C module Twitter"

When I drag the Twitter.xcodeproj into the workspace alongside Smashtag.xcodeproj, the Twitter.frameworkis red-flagged. When I add import Twitter the compiler throws an error saying Could not build objective-C module "Twitter" I've seen the…
dinosaysrawr
  • 348
  • 2
  • 15
1
vote
2 answers

Having trouble plotting the x vs. y graph on Stanford CS193P Assignment 3 (2016)

I am a beginner in iOS development. I have done everything on Assignment 3 (Graphing Calculator) of the 2016 Stanford CS193P iOS development course on iTunes U (gestures, view controllers, views, segues etc.) apart from actually plotting the x vs. y…
Metin S.
  • 68
  • 5
1
vote
2 answers

Stanford iOS9 2016 lecture 6 VCL.swift file, errors with line "print("\(logPrefix)Face \(instance)" + msg)"

In lecture 6 Stanford iOS9 2016 lecture series, a file called VCL.swift was added to the program to demonstrate view controller lifecycle. I have added the file, but for line "print("\(logPrefix)Emotions\(instance)" + msg) and line…
Thor
  • 9,638
  • 15
  • 62
  • 137
1
vote
2 answers

How do member Initializers work in Structs ? (In Swift)

Since I am a complete beginner, I don't even know whether I am asking the right question or not. But I am having trouble understand why the "User(name: "John ...)" part of the code in the for loop works CASE1 struct User { …
209135
  • 517
  • 5
  • 15
1
vote
1 answer

No candidates produce the expected result

I've looked at this answer, but since I am new to Swift and am following along code that should work from Stanford CS193's course, I'm a bit confused. This is from an exercise that involves building a calculator. In the model I have these…
user5480023
1
vote
3 answers

Core Data database doesn't save

I'm trying to implement the Paparazzi 2 assignment from the Stanford CS193 course and I'm running into a problem. My one call to save the database is when the app exits (I'm borrowing heavily from Mike Postel's version to check my code): -…
1
vote
1 answer

Calculator in Swift

I have some logic problem about this calculator. When I push the "=" after first time executive it'll execute twice with same operand. For example: "1"+"2"="3" "3" + "2", then output -> "5" before I press another operands. Here is the source…
Andrew Chiu
  • 11
  • 1
  • 3
1
vote
1 answer

UILabel variable needs to be an Optional Double but I don't want the the label to display optional(valueOfNumber)

I'm trying to complete the CS193P Course independently. I am on assignment 2 of the course and part of the assignment asks for me to do the following: "Change the computed instance variable displayValue to be an Optional Double rather than a…
Sami
  • 579
  • 5
  • 25
1
vote
1 answer

How does initializing UIView subclass properties affect superview's center?

I'm having a problem with the graphOrigin property in my UIView subclass. When I defined graphOrigin as a computed variable, it convert's the superview's center point to this view's center point and displays the graph in the center of the screen.…
egracer
  • 362
  • 3
  • 10
1
vote
1 answer

Cannot assign to 'parameters' in 'self' error - from CS193p Stanford Online Course

I am currently working on the Smashtag application which can be downloaded here: http://web.stanford.edu/class/cs193p/cgi-bin/drupal/ I have been following along with the iTunes U video (YouTube link:…
Tommy
  • 25
  • 1
  • 4
1
vote
5 answers

CS193p - Winter 2015 - Calculator Storyboard Autolayout

I’m working through the Auto Layout portion of the Calculator Assignment of the latest Stanford CS193p course using the latest Xcode in the App Store (6.1.1 6A2008a). The constraints for the Label for the display work properly, but when I was laying…
krger
  • 13
  • 3
1
vote
2 answers

Where to use and initialize UIManagedDocument

I am new to IOS and I am following CS193p Stanford's lecture to learn about Core Data and in the demo the Professor used a category with somehow similar to what actually to if we check core data application checkbox while creating application and it…
Asadullah Ali
  • 1,056
  • 14
  • 31