peterlamar / swiftui-examples

Collection of SwiftUI examples for beginner ios developers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IOS-Examples SwiftUI

  1. Local Notification - Simple background notifications only

  2. Foreground Notifcations - Notifications that also occur in the foreground while your app is open.

  3. ViewBuilder

  4. UserActionNotification - Create user actions in Notifications that appear below the notification when viewed from the main screen

  5. buttonStateChange - Update a swiftUI button's state on button press

  6. buttonChangeText - Update a separate swiftUI text field from a button press

  7. exclusiveButton - Exclusive OR implemented with two buttons, one turns on while it turns off the other.

  8. listinlist - Display a list in list

  9. animatedbuttons - Basic example showing buttons with a scale effect on press as well as buttonstyle to apply to multiple buttons.

  10. transitionButtons - Simple button that transitions into frame

  11. sublistDelete - Delete from a sublist with tricky swiftui syntax

  12. coredatasample - Intro to storing data on iOS

  13. coredatarelationships - Core data with swiftui and member objects

  14. photoLibrary - load photos from phone's library using wrapped UIKit

IOS-Examples UIKit

  1. UI Kit Basics - Follow basic arrangement and understanding of UIKit and storyboard
  2. Storyboard Actions - Add functions to storyboard
  3. UIKitNotification - Example of custom UIKit notification from Swift

Combine Examples

  1. Basic Combine Example - Getting started, playground only example of pub/sub with Combine
  2. Full Combine Playground - Full Combine playground with examples
  3. Combine Grid Layout - Simple example using combine to layout an array and images
  4. Visual Combine Magic - involved 4 step tutorial on swiftui and combine
  5. Combine Free E-Book - Full book about combine

Cloud

  1. AWS AppSync/Combine Tutorial - Intro tutorial into AWS AppSync resources and service
  2. Firebase Swift2 - Google exercises updated for swift2

External Links Only

  1. Dynamic Lists
  2. MVVM Example
  3. UserNotifications Framework Delegate Protocol - Handle notification actions
  4. Clean Architecture/Deep Linking example
  5. Navigate between views - Great tutorial on Navigation thats not just the navigationview/list example but rather logic based between views
  6. Swift $ Prefix - Explains that $ is a 'read/write binding'
  7. @Binding vs @Published - 'You'll generally use @Binding to pass a binding that originated from some source of truth (like @State) down the view hierarchy and @Published in an ObservableObject to allow a view to react to changes to a property.'
  8. Expandable List Detailed UI kit implementation of an expandable list
  9. Async Image Loading Demonstrates how to load images from urls with loading text

Misc Useful Links

  1. Swift Reference
  2. Apple Swift Book
  3. Awesome Swift
  4. Custom SwiftUI Control
  5. Parsing JSON with Swift
  6. SwiftUI Guide
  7. TestFlight tutorial
  8. Local notification testing

Swift Language Mechanics

  1. initDescribing
  2. map

InitDescribing

Creates a string representing the given value as a sort of representation

import Foundation
struct Person {
    var first: String
    var last: String
    var age: Int
}
let p = Person(first:"Matt", last:"Neuburg", age:3)
print("p is \(String(describing:p))")  // p is Person(first: "Matt", last: "Neuburg", age: 3)
let x = 3
print("x is \(String(describing:x))") // x is 3
var someTuple = (9, 99)  
print("someTuple is \(String(describing:someTuple))") // someTuple is (9, 99)
func someFunction(left: Int, right: Int) {}
print("someFunction is \(String(describing:someFunction))") // someFunction is (Function)
let someArray: [String] = ["Alex", "Brian", "Dave"]
print("someArray is \(String(describing:someArray))") // someArray is ["Alex", "Brian", "Dave"]
let someDictionary: [String: Int] = ["Alex": 31, "Paul": 39]
print("someDictionary is \(String(describing:someDictionary))") // someDictionary is ["Paul": 39, "Alex": 31]
var optionalInteger: Int?
optionalInteger = 42
print("optionalInteger is \(String(describing:optionalInteger))") // optionalInteger is Optional(42)

Map

Returns an array containing the results of mapping the given closure over the sequence’s elements.

let cast = ["Vivien", "Marlon", "Kim", "Karl"]
let lowercaseNames = cast.map { $0.lowercased() } // 'lowercaseNames' == ["vivien", "marlon", "kim", "karl"]
let letterCounts = cast.map { $0.count } // 'letterCounts' == [6, 6, 3, 4]

About

Collection of SwiftUI examples for beginner ios developers


Languages

Language:Swift 99.5%Language:Ruby 0.5%