100DaysOfSwift

This is my repository for the 100DaysOfSwift challenge created by Paul Hudson.

All projects were either inspired by him or at least heavily influenced and instructed.

If you want to learn more about Swift I highly recommend his wonderful site Hacking with Swift with tons of well-written and educative articles and learning materials.

Also if you enjoy his work he has written a lot of books on Swift which you can find here (this is not sponsored in any way, I just think it's highly recommendable).

Below you can find the list of projects:

1. 🌪 Storm Viewer (Days 16 - 18)

Creating a simple image viewer with a detail page.

  • Working with FileManager
  • Loading resources from Storage (Bundle)
  • Creating TableViews and TableViewCells in Storyboards
  • Simple Navigation

2. 🇩🇪 Guess the Flag (Days 19 - 22)

Developing a flag guessing game which asks the user to guess contries of different flags.

  • Auto Layout in Interface Builder
  • UIButtons and Layers
  • Handling user input for UIButtons
  • UIAlertController

3. 🎌 Fun with Flags (Milestone - Day 23)

Allowing user to browse flags and show details for the country in a detail page.

  • Custom UITableView and UITableViewCells
  • UIActivityViewController and sharing data
  • dequeuing TableViewCells
  • repetition of navigation

4. 🖥 Easy Browser (Days 24 - 26)

Creating a basic browser rendering custom websites that the user can select.

  • Intro to WebKit and WKWebView
  • Using .actionSheet presentation style of UIAlertController
  • showing progress using UIToolbar and UIProgressView

5. 🤔 Word Scramble (Days 27 - 29)

Word game implemented in UIKit making the user create own words from given strings.

  • Capture lists: weak vs. unowned vs. strong
  • Reading contentsOf from disk
  • Receiving text input in UIAlertController
  • Checking text with UITextChecker and String manipulations

6. 🚗 Auto Layout (Days 30 - 31)

Playing around with Auto Layout in code with anchors and visual format language.

  • Advanced Auto Layout (e.g. aspectRatio, anchors)
  • Visual Format Language (VFL)

🛍 Shopping List (Milestone - Day 32)

Building up a shopping list app with option to share the list.

  • more String manipulations and slicing
  • inserting and deleting rows in UITableViews
  • sharing lists with UIActivityViewController

7. 🇺🇸 Whitehouse Petitions (Days 33 - 35)

Loading data for current petitions at the White House and displaying statistics about it.

  • UITabBarController
  • parsing JSON with Codable
  • rendering HTML with loadHTMLString
  • using didFinishLaunchingWithOptions in AppDelegate

8. 🤓 Swifty Words (Days 36 - 38)

Little game creating different words and allowing the user to combine different words together.

  • creating UI in programmatically with Auto Layout
  • Array and String manipulations like components(separatedBy:) and joined(separator:)
  • using property observers like didSet

9. 🤖 Grand Central Dispatch (Days 39 - 40)

Introduction to background processing and taking computation away from the main thread.

  • GCD basics and relieving the main thread
  • asynchronous code execution
  • updating UI from other thread using performSelector(onMainThread:)

👮 Hangman (Milestone - Day 41)

Hangman clone created with UIKit.

  • Character as elements of String
  • loading data in backgorund using GCD
  • creating a game in UIKit

10. 😁 Names to Faces (Days 42 - 44)

Load people's images and assign names to them that get saved.

  • using UICollectionView with UICollectionViewCells
  • importing photos with UIImagePickerController
  • sublassing NSObject

11. 🏀 Pachinko (Days 45 - 47)

SpriteKit game challenging users to collect points and destroy objects.

  • intro to SpriteKit
  • learning about elements like SKSpriteNode, SKLabelNode, SKPhysicsBody and SKEmitterNode
  • creating SKActions and chaining them
  • catching collisions with SKPhysicsContactDelegate

💾 UserDefaults (Days 48 - 49)

How to save and load data from UserDefaults.

  • saving data in UserDefaults
  • using NSCoding in combination with NSKeyedArchiver and NSKeyedUnarchiver
  • using JSONEncoder and JSONDecoder with Codable

📸 Capture Images (Milestone - Day 50)

Capturing images and storing them using Codable.

  • capturing images from the camera
  • storing user data in UserDefaults
  • repetition of Codable, UITableView and navigation

📹 Watching talks (Day 51)

13. 🔮 Instafilter (Days 52 - 54)

Image manipulation app that makes use of iOS built-in filters with CoreImage.

  • using UISlider in the UI
  • applying filters using CoreImage and CIFilter/CIContext
  • writing images to the library using UIImageWriteToSavedPhotosAlbum()

14. 🐧 Whack-a-Penguin (Days 55 - 56)

SpriteKit game were users need to be fast to hit disappearing penguins.

  • more SpriteKit with SKCropNode and custom SKNodes with maskNodes
  • action sequences with SKAction
  • using zPosition for stacking SKNodes

15. 💫 Animation (Days 57 - 58)

Introduction to different animation types in UIKit.

  • using simple animations with UIView.animate(withDuration:)
  • applying CGAffineTransform with scaling, rotating and translating views
  • using spring, velocity and damping for more lively animations

🇲🇻 Country Info (Milestone - Day 59)

Showing infos of different countries and allowing users to share facts about them.

  • showing JSON encoded information with Codable
  • providing cool UI with navigation
  • sharing country facts with UIActivityViewController

16. 🏙 Capital Cities (Days 60 - 61)

Creating a map with interesting events pinned that show more information on click.

  • intro to MapKit with MKMapView, MKAnnotation and CLLocationCoordinate2D
  • using MKPinAnnotationViews
  • changing map types with e.g. .satellite

17. 🛰 Space Race (Days 62 - 63)

SpriteKit game that shows spaceship and needs to avoid hitting space objects.

  • using more of SKPhysicsBody and SKPhysicsContactDelegate to detect and show collisions between nodes
  • combine Timer, linearDamping and angularDamping to animate nodes

🛠 Debugging (Days 64 - 65)

Introduction to debugging iOS apps with Xcode.

  • debugging with print() vs. assert() vs. breakpoints
  • view debugging of the UI with Capture View Hierarchy

18. 🔪 Shooting Gallery (Milestone - Day 66)

Creating a SpriteKit game similar to a shooting gallery.

  • auto-creating differently colored and typed SKNodes
  • moving nodes and handling click targets

19. 💉 JavaScript Injection (Days 67 - 69)

Creating a Safari Extension with the option to run custom JavaScript.

  • how to make a shell app and using NSExtensionItem
  • registering as a Safari extension
  • editing multi-line text with UITextView

20. 🎇 Fireworks Night (Days 70 - 71)

SpriteKit game showing fireworks that the user needs to destroy.

  • using colorBlendFactor on SKNodes
  • creating paths using UIBezierPaths and orientToPath
  • detecting swipe gestures to destroy multiple SKNodes at once

21. 🛑 Local Notifications (Days 72 - 73)

Using local notifications in an app.

  • getting started with UNUserNotificationCenter and UNNotificationRequest
  • requesting authorization from the user for notifications
  • acting on responses in notifications with UNNotificationCategory and UNNotificationActions

✏️ Notes clone (Milestone Day 74)

Cloning the iOS Notes app as closely as possible.

  • use Codable to save notes to a file
  • allow sharing with UIActivityViewController
  • keep editing history

22. 📍 Detect-a-Beacon (Days 75 - 76)

Use iBeacons to detect how far away objects are from the user.

  • using CoreLocation and CLLocationManager to ask for and detect the user location
  • detecting iBeacons using CLBeaconRegion
  • measuring proximity with CLProximity

23. 🐼 Swifty Ninja (Days 77 - 79)

Fruit Ninja clone with SpriteKit.

  • using SKShapeNode and SKTexture
  • creating action with CGPath and UIBezierPaths
  • playing sound with SKAction and AVAudioPlayer

24. ✨ Swift Strings (Days 80 - 81)

How to use NSAttributedString with labels and text views.

  • how to work with Strings in Swift as they are not arrays
  • formatting Strings with NSAttributedString

🤩 Swift language extensions (Milestone - Day 82)

Creating different language extensions that make it easier to use the features they implement.

  • extension of UIView to have a bounceOut(duration:) method
  • adding a times() method to Int that runs a closure as many times
  • provide a remove(item:) method for Arrays with the Comparable constraint

25. 🤳 Selfie Share (Days 83 - 84)

Sharing selfies with multipeer connectivity.

  • getting started with MultipeerConnectivity and MCSession
  • identifying users with MCPeerID and looking for others with MCAdvertiserAssistant and MCBrowserViewController
  • sending data over the peer network and showing it in a UICollectionView

26. 🤷 Marble Maze (Days 85 - 87)

Creating a rolling ball game for iPad with use of accelerometer.

  • working with categoryBitMask, collisionBitMask and contactTestBitMask
  • using CMMotionManager to access the accelerometer data from the device
  • runnign code only in simulator with #if targetEnvironment(simulator)
  • detecting contacting with collisions

27. 📈 Core Graphics (Days 88 - 89)

Using CoreGraphics to draw directly to the screen.

  • drawing in CoreGraphics with UIGraphicsImageRenderer
  • using setFillColor(), setStrokeColor() and setLineWidth() for custom drawing
  • drawing rectangles, ellipses, checkerboards, transforms and lines
  • drawing images and text directly on the screen

🤬 Meme Generator (Milestone - Day 90)

Creating a meme generating app that draws user created text on user selected images.

  • importing images
  • drawing text in different places of the image using CoreGraphics
  • saving the manipulated image to user's photos library

🤯 Core Graphics redux (Day 91)

Working through a custom CoreGraphics playground from Paul to practice drawing.

  • getting more practice in drawing different shapes
  • creating flags and checkerboards and icons from scratch with CoreGraphics

28. 🤫 Secret Swift (Days 92 - 93)

Save data using the keychain and limiting access with biometric authentication.

  • writing and reading from the iOS Keychain with KeychainWrapper
  • using NotificationCenter to get notified when app enters the background
  • using biometric authentication using Touch ID or Face ID with the LocalAuthentication framework

29. 🐒 Exploding Monkeys (Days 94 - 96)

SpriteKit game using CoreGraphics and dynamic level creation and physics effects.

  • filling paths with SKTextures and using texture atlasses in SpriteKit
  • drawing randomized nodes in certain bounds as building objects
  • adding UIKit elements in the SpriteKit game
  • using presentScene() to switch between scenes

30. 🪕 Instruments (Days 97 - 98)

Using Instruments in Xcode to detect slow running code, incorrect usage of main thread and memory allocations.

  • using Time Profiler to detect length of execution of different code portions
  • how to effectively draw shadows by adding a shadowPath with UIBezierPath
  • analyzing and fixing object allocations (by dequeuing UITableViewCells with Allocations tool

🃏 Pairs (Milestone - Day 99)

Creating a memory game in UIKit with fancy animations and different topics and content.

  • creating matching pairs and loading them
  • using a UICollectionView to show different cards (with delayed reveal animation)
  • animating flipping of cards and drawing patterns on back of the cards (using CoreGraphics)

🎓 Final test (Day 100)

Completed the final test with Certificate of distinction (> 95% correct answers).

Certificate for Stefan Blos