19 Replies
      Latest reply: Aug 5, 2017 7:49 PM by BillfromABQ RSS
      jv0 Apple Staff Apple Staff (0 points)

        Are you planning to use the new App Development with Swift course and Teacher Guide in your teaching? Use this thread to share feedback and ask questions about these materials. #swiftedu

        • Re: Teaching app development with Swift
          NickO Level 1 Level 1 (0 points)

          I've got my son working throught it. Where do we send feedback - this forum?

          • Re: Teaching app development with Swift
            CGRG Level 1 Level 1 (0 points)

            Hello,

            I am interested in translating the "App Development with Swift" guide to Spanish. How can I get the .iba files (iBooks Author files)?

            Thanks a lot,

               Claudio

            Hola, Estoy interesado en traducir la guía "App Development with Swift" del Inglés al Español. ¿Cómo puedo conseguir la versión editable en iBooks Author ?

            Gracias y saludos,

                Claudio

            • Re: Teaching app development with Swift
              hvoostende Level 1 Level 1 (0 points)

              Hi I'm working my way trough the "App Development with Swift" book and I'm getting stuck at 07_BoogieBot.

              When working trough the exercise the live View doesn't work

              (Xcode 7.3.1)

               

              runBoogieBotDemoMode() Use of unresolved identifier 'runBoogieBotDemoMode'

              any help?

              • Re: Teaching app development with Swift
                drgrant Level 1 Level 1 (0 points)

                I may be mistaken, but there appears to be a bug in the 12_InstancesMethodsProperties.playground, page 16 of 17: "Exercise: Treehouse Pulley".

                 

                In the third exercise, it says "Use the TreehousePulley type's addLoadToBasket method to add the items you defined above."


                However, when attempting to run the following code:

                 

                let item1 = 12
                let item2 = 120
                let item3 = 1080
                
                let ricketyRope = TreehousePulley(weightCapacity: 200)
                let strongRope = TreehousePulley(weightCapacity: 2000)
                
                ricketyRope.addLoadToBasket(item1)
                

                 

                Playground execution failed: error: Exercise-Freight Elevator.xcplaygroundpage:17:13: error: 'addLoadToBasket' is inaccessible due to 'internal' protection level

                ricketyRope.addLoadToBasket(item1)

                 

                I'm new to Swift, so after a lot of digging around through the Swift Reference Guides, I discovered the documentation for public vs private vs internal access for structures and functions. I then went into Exercise-Freight Elevator > Sources > FrieghtElevator.swift and changed the following code:

                mutating func addLoadToBasket(loadWeight: Int) {
                        currentWeight += loadWeight
                    }
                

                to this:

                public mutating func addLoadToBasket(loadWeight: Int) {
                        currentWeight += loadWeight
                    }
                

                 

                It would get further in the code, but give me a different errror:

                Playground execution failed: error: Exercise-Freight Elevator.xcplaygroundpage:17:1: error: cannot use mutating member on immutable value: 'ricketyRope' is a 'let' constant

                ricketyRope.addLoadToBasket(item1)

                 

                So after changing:

                let ricketyRope = TreehousePulley(weightCapacity: 200)
                

                to:

                var ricketyRope = TreehousePulley(weightCapacity: 200)
                

                 

                It got further but then:

                Playground execution failed: error: Exercise-Freight Elevator.xcplaygroundpage:17:29: error: missing argument label 'loadWeight:' in call

                ricketyRope.addLoadToBasket(item1)


                So I changed it to:

                ricketyRope.addLoadToBasket(loadWeight: item1)
                

                 

                and it finally went through.

                 

                Was this intentional? The first error was very confusing and the concepts of private / public / internal access had not yet been introduced in the previous lessons.

                The second error was also confusing, because a let constant was already declared for "rickeyRope" but it is required to be a variable to do the addLoadToBasket function?

                 

                I am very new to Swift and Xcode, so please correct me if I've gotten something wrong here, or I was supposed to do something else 

                  • Re: Teaching app development with Swift
                    Pashgun Level 1 Level 1 (0 points)

                    Meet that problem and lose over 2 hours. Thank you for research and answer.

                    > Was this intentional?

                    Hope not. But i'm from Russia.

                     

                    Nore than you correct:

                    method "removeLoad" needs to add "public" too.

                    And, if i'm not mistake:

                     

                        public func canHandleAdditionalLoad(_ load: Int) -> Bool {
                            if currentWeight + load > weightCapacity {
                                return true
                            } else {
                                return false
                            }
                        }
                    
                    
                    

                     

                    needs to be:

                        public func canHandleAdditionalLoad(_ load: Int) -> Bool {
                            if currentWeight + load < weightCapacity {
                                return true
                            } else {
                                return false
                            }
                        }
                    
                    
                    

                     

                    not ">", it's "<". Is that right?

                    Method check for ability of carry more weight.

                    In sourse it answers "true" if "currentWeight + load" more than "weightCapacity"

                    • Re: Teaching app development with Swift
                      Vox86 Level 1 Level 1 (0 points)

                      Maybe canHandleAdditionalLoad method has some bug too. You may want to change HandleAdditionalLoad method with < instead of >:

                      public func canHandleAdditionalLoad(_ load: Int) -> Bool {

                              if currentWeight + load < weightCapacity {

                                  return true

                              } else {

                                  return false

                              }

                          }

                      • Re: Teaching app development with Swift
                        Capn Dirk Level 1 Level 1 (0 points)

                        I have another suggestion: just add the "_" sign in the declaration:

                         

                            public mutating func addLoadToBasket(_ loadWeight: Int) {

                         

                        So you don't need to know the name of the argument.

                      • Re: Teaching app development with Swift
                        lostthewilltolivealrready Level 1 Level 1 (0 points)

                        I'm working through App development with Swift using xcode 8.2. A problem is that it seems xcode normally writes any changes back to the xcodeproj that was opened. This means that if I make any mistake, the project is messed up and the only solution is to download the teaching materials again. Shouldn't it say something about how to avoid this up front?

                         

                        On lesson 13 QuestionBot page 93 it invites me to change the emoji. This didn't work for me. The emoji changed in the attributes inspector but not anywhere else. Running the project still showed the old emoji. I then tried clicking on View (under View Controller Scene), then clicking back on the emoji label, and this caused the new emoji to appear there and simultaneously the emoji disappeared from the central edit window, except for three white selection squares. It seemed as if the emoji box had been reduced to zero width. See screenclip http://www.brisk.org.uk/pics/a0.png

                        But when run the new emoji did show. Once it has got in this state I cannot restore normal appearance of edit window.

                         

                        (Please ignore my username - I was frustrated eqrlier by something else)

                        • Re: Teaching app development with Swift
                          anee Level 1 Level 1 (0 points)

                          I'm using App Development with Swift in my classroom with the associated XCode files.  I notice that when students are on a playground, it auto-saves whatever changes they make.  But sometimes they really screw things up badly and the page is not really salvagable.  Is there a quick and easy way to get a student back to the default playground page before they started messing around on it?

                           

                          For instance, a student accidentally deleted a huge chunk of the original code on a page and didn't realize it until the next day.  How would we get that page back to its clean state?

                            • Re: Teaching app development with Swift
                              KMT Level 8 Level 8 (8,660 points)

                              Xcode has never employed much of an 'undo/redo' oops word processor-style mode beyond immediate session, as an example. Not it's job, as they say.

                               

                              The traditional way to deal with (big to the user) missteps has always been the same...rely on backups (example Time Machine) and/or source control (see Xcode's SC menu and Help). I'd avoid snapshots, BTW...

                               

                              I'd like to think that particular topic would be one of the basics as part of any coding curriculum

                                • Re: Teaching app development with Swift
                                  anee Level 1 Level 1 (0 points)

                                  Yeah but this isn't a coding job, it's coding curriculum.  When I have students work on files I have created, for instance, I have a quick and easy place they can reload the default files if they screw things up too bad while working and just want to start fresh.  Seems like a pretty necessary thing for students to have access to, to me.

                                    • Re: Teaching app development with Swift
                                      jorisvm Level 2 Level 2 (40 points)

                                      Maybe include a Duplicate-step in the beginning of each exercise:

                                      1. Open playground file

                                      2. In the menu, tap: File - Duplicate...

                                      3. enjoy coding

                                       

                                      In case of extreme problems, you can find back the Duplicated = the original playground file.

                                       

                                      Have fun,

                                      Joris

                                • Re: Teaching app development with Swift
                                  nrbaker02 Level 1 Level 1 (0 points)

                                  Is there an answer key for the exercises?