Git Product home page Git Product logo

unwrap's Introduction

Unwrap logo

Twitter: @twostraws

Unwrap is an app that helps you learn Swift faster and more effectively.

At its core lies almost 100 video lessons that teach all the fundamentals of the Swift programming language, with each lesson backed up by an interactive review.

Once you’ve made some progress learning, you can dive into a selection of practice activities that make you write code by tapping, dragging, or typing, find errors, predict program output, and more. There are also daily challenges that test your overall language knowledge once per day, helping your new skills really sink in.

Unwrap app is available to download for free on the App Store. I’ve made the code available so that anyone who wants to can see how I structure my code and perhaps learn from it. If you’d like to help you’re most welcome to and there are many opportunities, but make sure you read the contribution guidelines first.

Trying it yourself

Unwrap is written using Xcode 10.2 and Swift 5.0. All the CocoaPods are checked in to this repository, so you should be able to clone this and build it immediately by opening Unwrap.xcworkspace.

As far as I know the app is feature complete, but there are likely to be errors all over the place at least to begin with – if you hit problems, either building or running the app, please let me know.

Contribution guide

Any help you can offer with this project is most welcome, and trust me: there are opportunities big and small, so that someone with only a few weeks of Swift experience can help.

However, before you start please read the LICENSE.md and CONTRIBUTING.md files. Although all the source code of Unwrap is available under the MIT license, the assets are not redistributable – please see the license for more detail.

If you’d like to help, here are some suggestions ordered from most easy to most difficult. I’ve added documentation to most if not all of the code, but there’s also a separate document in this repository called CONTRIBUTING.md that documents how the code is structured and how it works.

Easy

  1. Just try running the app and let me know if you hit any problems.
  2. I’ve written a huge amount of all-new content for this app, so if (and when!) you see any typos please correct them and open a PR.
  3. If you spot any redundant code, or code that repeats itself that can sensible be refactored not to repeat, you’re welcome to clean it up. Any unused code should be deleted rather than just commented out.
  4. If you can write (sensible!) solutions for Free Coding problems that aren’t currently accepted, please add them.
  5. If you see any Sixty Seconds chapters that don’t have a postscript (alert message shown between the chapter text and review), and you think there’s something important to add there, add it.
  6. Write new tests. It doesn’t matter how small they might seem, tests are always appreciated and won’t require you to modify any of the core code.

Intermediate

  1. If you find any bugs and can fix them, by all means do.
  2. If you spot any performance hotspots that can be resolved smoothly, go for it.
  3. All the practice activities have their data stored as JSON. I’ve tried to create samples of each of them, but it would be awesome to add more.
  4. Right now the app is available only in English. We could look at localizing all the text, but I have concerns partly because Swift continues to change and partly because the videos will get in the way. If you have suggestions, let me know!
  5. Did I already mention adding tests?

Advanced

  1. Although I’m pretty happy with the app’s architecture, it could always be improved – if you have suggestions, let me know!
  2. I’ve added the basics of theme support, but it’s not implemented or tested yet. This could be expanded to work everywhere, and new themes could be added.
  3. The storyboard started off small and grew far too big for its boots. This is particularly annoying because many screens are similar. Some of the UI is now built in code already. To resolve this we could switch to building even more UI in code, starting with a direct copy of the storyboard, then try to refactor it so that similar view controllers are created using shared code.

Again, please make sure you read the LICENSE.md and CONTRIBUTING.md files before you start just to avoid problems.

Credits

Unwrap was designed and built by Paul Hudson. Hacking with Swift, Swift in Sixty Seconds, Unwrap, and the Unwrap logo are all copyright © Paul Hudson 2019.

Unwrap is built using some third-party frameworks and fonts: DZNEmptyDataSet, Font Awesome, MKRingProgressView, QuickLayout, SDWebImage, Sourceful, Zephyr, and SwiftEntryKit. Their licenses are stored inside their respective Pods directories, and are repeated inside the app’s credits screen.

Swift, the Swift logo, Xcode, Instruments, Cocoa Touch, Touch ID, AirDrop, iBeacon, iPhone, iPad, Safari, App Store, watchOS, tvOS, Mac and macOS are trademarks of Apple Inc., registered in the U.S. and other countries.

Unwrap includes an iMessage sticker pack that incorporates a variety of logos from around the Swift community – these are used with permission, and we're grateful to each person or project for granting that permission:

If you liked Unwrap and want more like it, I have a whole website full of free Swift tutorials.

unwrap's People

Contributors

anibalrodriguez avatar carrione avatar darrarski avatar erikdrobne avatar fsalata avatar heyrahulrs avatar il-pazzo avatar jaspalsuri avatar jaypen7 avatar jdkouris avatar jjoao-spotify avatar jmcsmith avatar julianschiavo avatar l-rettberg avatar marcoc88 avatar marton-zeisler avatar mattterees avatar mike011 avatar prabal4546 avatar ramzesenok avatar rizwankce avatar robinlmp avatar roryslingo avatar sergiob-dev avatar slk333 avatar sorcerercoding avatar twostraws avatar wakaidev avatar wayni208 avatar will-1-am avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unwrap's Issues

Tab Bar icons pixelated, and titles are shrunk.

When tapping in a cell in a LearnCoordinator view controller and quickly return back. The tab bar pixelate.
Tested on iPhone 6s.

Before tapping in any cell in the LearnCoordinator view controller.

img_4776

After returning back.

img_4777

Learn text is editable

When tapping any row in the Learn section, the text accompanying the video becomes editable by double tapping it

Wrong answer of this question

This question’s answer should be true. But according to the app, answer is false.

Screenshot of app

I ran the code in Xcode Playgrounds and it also prints “Success”.

Result in Xcode Playground

The file that needs to be fixed is in Content/SixtySeconds/conditions.json

No such module 'SwiftEntryKit'

I just downloaded the app and attempted to run it and got the below error. I'm not too familiar with cocoapods so not sure what's missing.
screen shot 2018-08-14 at 9 36 33 pm

Problem in a Daily Challenge question

Today I got this Predict the Output challenge.

In the code shown in the challenge, there are no variable named age2 and age3. Instead there are numberOfUsers2 and bottles3.

Crash in taptocode/rearrange exercise

device: iPhone 6s, iOS 12.1.4

I'm not sure exactly how to reproduce, and unfortunately I've only seen it once, but I crashed today in one of the exercises during my first daily quiz. Unfortunately I didn't think at the time to grab a screenshot or call stack.

The problem itself asked the user to drag the tiles into the working area to complete an expression using the ternary operator to return a true value for a new constant if both existing variables were true (or something like that). The app froze when I dragged the equals sign into the working area (I think I had most of the other tiles in place already).

At first I didn't realize it had crashed, but when I returned to Xcode I saw it stopped on Unwrap/Activities/Practice/TapToCode/TapToCodeModel.swift line 67, "usedWords.insert(word, at: destinationIndexPath.item)". There was an out of bounds exception, I believe.

Sorry for the lack of information here. If I knew an easy way to return to this problem I'd give it a shot and see if I could reproduce. If you have any suggestions or want me to try anything, I'm happy to do so.

Thanks for writing this fantastic app!

-Eli

1+2+1 !=4

  • Is there a way the specific json test can be tested in isolation?
  • It would be awesome if there was a way to load all the questions so they could all be tested.
  • It comes across as overkill but can be super useful if the json tests were unit tested. That would make fixing this bug trivial.

simulator screen shot - iphone xs - 2019-01-07 at 06 00 32

Can't complete "Protocols and extensions: Summary" lesson

You can't seem to finish the "Protocols and extensions: Summary" section under "Protocols" under the "Learn" tab. You get the points for completing it, but you don't get the green check mark or the badge for completing the section (Provided you completed all the other lessons in it)

The Unwrap scheme is missing.

On launch of the workspace after rebasing with the latest master at the top by the play and stop buttons it says "No Scheme"
screen shot 2019-01-07 at 5 54 23 am

Looks like the Unwrap scheme was either removed from
./Unwrap.xcodeproj/xcsharedatea/xcschemes/Unwrap.xcsheme or deleted, or had share turned off.

What about iPad support?

In the Target I switched it to universal and ran it on my iPad and it looks okay, some minor layout stuff, but doesn't by any means look horrible. Thoughts?

Correction

I think a pop-up alerting the user as to why their answer was wrong during the review process would help teach the content more. Now you can get an answer wrong and not review your work or figure out what mistake you made.

Daily challenge progress

I'm not sure if this is intended behavior, but you can answer a couple of questions on the daily challenge and then close the app. Opening the app back up has the daily challenge reset as if you haven't attempted it.

I believe it should track a user's progress so that the daily challenge can be completed throughout the day and not all at once.

Use Spaced Repetition to come up with a better set of questions.

Record if the person got any question right or wrong and use spaced repetition to determine when they would be asked the question again. This would be a huge improvement as you would be asked questions you struggled with or haven't seen first.

Also analytics could be added to report troublesome questions. For example if a question has a really low success rate the question might be worded poorly.

No such module 'SwiftEntryKit'

I downloaded the Zip, extracted it, opened the Xcode project file and tried to compile it without any changes. But the project doesn't compile. Instead it shows this error:

Swift Compiler Error
No such module 'SwiftEntryKit'
ChallengesCoordinator.swift 

iPhone SE Visual Bug on Badges

On the iPhone SE when you first run the app, the section of Badges on the home tab, some of the badges is cut off. But when you go to the Learn tab and earn some points, this visual bug disappears. Also you cannot navigate through the rest of the badges. You can see this bug again by closing the app and earn a few points.

screen shot 2018-08-09 at 9 37 18 pm

screen shot 2018-08-09 at 9 46 52 pm

No such module 'SwiftEntryKit'

image

I saw this error when i build, seems can't find all the dependencies
can you take a look? thx

xcode: Version 9.4.1
swift: 4.1

Correct result not honoured

IMG_0031

As pr Playground below

import Cocoa

print ( [1,5,2,5,3,5].filter{ $0 % 5 == 0 }.compactMap{ $0 / 5 } .reduce( 0, + ) )
3

Localization

I saw some user-facing strings that are not wrapped in an NSLocalizedString and I was wondering about the plans of localizing the app?

It might be a good idea to prepare for that, and it could be a nice task to get an overview of the code base. :)

(I might want to pick this one up myself 😄)

Value missing in challenge.

When taking the nil coalescing review, the last value after the ?? would be missing until the answer is submitted.

C242056F-739D-4FD0-8BB2-3BEE2661A889

375DA147-08C4-492C-8FA5-FA19F52DBF1F

New TestFlight build 6 did not persist UserDefaults from earlier build

GitHawk Upload by wayni208

Please close if this is a non issue.

This was was a reply to your tweet regarding the new TestFlight build released yesterday. As far as I can tell, this could but should not happen. I have not seen this type of issue outside of TestFlight.

I noticed that, in TestFlight, earlier builds are not being listed when I go to TestFlight>Unwrap - Learn Swift>Previous Builds>1.0

If you would like, I could test this via a closed TestFlight and see if this will continue to be a problem.

Sent with GitHawk

iOS 12 and Xcode Beta build failures

NSLayoutAttribute has been renamed to NSLayoutConstraint.Attribute
NSLayoutRelation has been renamed to NSLayoutConstraint.Relation

The above errors are being thrown when loading up the workspace file, and trying to play on iOS 12.

Is this because the app currently doesn't support iOS 12 at this time?

Cheers

Daily challenge questions have duplicates.

Sometimes there is duplicates in the daily challenges questions.

To recreate the bug, simply restart the app on ur phone or simulator and then do your daily challenges. Happens pretty frequently.

CircleCI Setup

Since the project is open source, it would be trivial to setup CircleCI to ensure that the project builds, and the unit test and UI tests pass. Paul would have to authorize CircleCI on this repo, but a PR could be done to setup the yaml file used to configure CircleCI.

Bug: Current Streak is not updated

Describe the bug
Current Streak is not updated.

To Reproduce
Open the app daily for multiple days.

Expected behavior
Increasing "Current Streak"-count and "Best Streak"-count on "Home"-Screen.

Actual behavior
"Current Streak"-count and "Best Streak"-count are not updated and stay at 1.

Screenshots
img_1982
img_1983

As shown in the first screenshot, I completed multiple daily challenges in a row and thus opened the app these days. But as shown in the second screenshot, my "Current Streak"-count does not increase and I did not get the badge either.

Smartphone (please complete the following information):

  • Device: iPhone 7
  • OS: iOS 12.1.1
  • Version 1.0 (2)

Daily Challenge 8/9 error

I can't remember the exact code but it's something like below. "Odd number" was the correct answer, but "Even number" was the accepted answer.

        let multiplied = 81
        if multiplied % 2 == 0 {
            print("Even number")
        } else {
            print("Odd number")
        }

Free Coding method parameters have to be input1, input2, etc.

The following fails:
simulator screen shot - iphone 8 - 2019-01-29 at 04 03 44

But if I change the parameters names to input1 and input2 it passes. It isn't intuitive from the question that the parameter names have to be input1 and input2
simulator screen shot - iphone 8 - 2019-01-29 at 04 07 41

I don't know if it would be better to say what the parameter names have to be or make the matching work.

This also fails for other questions where you have to pass in parameter names:
simulator screen shot - iphone 8 - 2019-01-29 at 04 10 18

Highlight issues

image

  • The 0 from 32.0 is the wrong colour
  • The .5 from 12.5 is the wrong colour
  • The _000 from 100 is also in the wrong colour. Might be a different issue.

NewsDataSource - Unexpected nil User

First off, I want to say that the app looks awesome! 😃
I ran into a compilation issue on the way to work that I thought I would file here.
I might just be missing something so I apologize in advance if that's the case.

Hardware

  • Xcode 9.3
  • iPhone X Simulator (11.4)

Error

I see the following error:

Fatal error: Unexpectedly found nil while unwrapping an Optional value

for this line

// NewsDataSource.swift
var containsNewArticles: Bool {
    get {
        if let newestArticleID = articles.first?.id {
            // This line here
            if newestArticleID > User.current.latestNewsArticle {
                return true
            }
        }
     set {
    ....
}

Possible Solution

A quick fix I added to get the app to compile is to conditionally unwrap the User.current as so:

if let user = User.current, newestArticleID > user.latestNewsArticle {

However, I think it would help to understand why User.current was nil in the first place to see if this is the best fix. There are other places where User.current is being used so it could possibly affect other areas.

Completing a lesson again gives no more points.

If you do a lesson again you don't get any more points. The lesson questions are different from the challenge questions, so there is value in doing them multiple times. But you are not rewarded for doing them again.

CodeCov Setup

On every PR it could be shown how the code coverage is changing?
CodeCov is a free open source project and it's visualization is awesome. Paul would have to authorize the access, and set the token up in circle ci or what ever ci system is used.

iOS Glyph icons for Tab Bar navigation

Hey 👋

Thank you for sharing your knowledge by creating this app & repo. 🤘
I'm discovering Swift lately and really like your resources.
Coming from a design background wanted to share the free iOS glyphs icon library from @icons8
Their complete library is huge and the iOS style. The license would be fit for this project.

📱https://icons8.com/ios
👩‍⚖️https://icons8.com/license

You're using Font Awesome and this resource is great and often used in web development. Maybe the iOS glyph icons would make the tab bar more Apple like.

What do you think? Is it worth, otherwise just see it as a link reference. ✌️

Badge Improvements?

  • It would be awesome to get a notification when you get a badge
  • For the practice badges after you complete it 10 times, it would be cool to have different colours for the same badge when you complete more. For example at 20, it would go blue, 50 silver, 100 gold

circles vs boxes?

I'm old school and a box means multiple choice and circle means single choice? Is this also true for Swift / iOS?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.