This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
// Dispatch Groups | |
func collectAllReviewIds() { | |
let group = DispatchGroup() | |
var reviewIds: [Int] = [] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// GradientsinSwiftUI | |
// | |
// Created by Mohammad Azam on 3/2/21. | |
// | |
import SwiftUI | |
struct ContentView: View { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# EXCEPTIONS | |
# try and except go together | |
try: | |
result = 1/2 | |
number = int(input("Enter any number: ")) # e | |
except ZeroDivisionError: | |
print("Please don't divide by zero!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomerListScreen extends StatelessWidget { | |
final customers = ["Alex", "John", "Bryan", "Jerry", "Mary"]; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("Customers") | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomerList extends StatelessWidget { | |
final List<String> customers; | |
final Function(String) onSelected; | |
CustomerList({@required this.customers, this.onSelected}); | |
@override | |
Widget build(BuildContext context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomerList extends StatelessWidget { | |
final List<String> customers; | |
CustomerList({@required this.customers}); | |
@override | |
Widget build(BuildContext context) { | |
return ListView.builder( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomerListScreen extends StatelessWidget { | |
final customers = ["Alex", "John", "Bryan", "Jerry", "Mary"]; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("Customers") | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MainScreen.swift | |
// IntroductionToSwiftUI-Workshop | |
// | |
// Created by Mohammad Azam on 2/6/21. | |
// | |
import SwiftUI | |
class Settings: ObservableObject { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Data Types in Python | |
# String - Combination of alphanumeric characters 33AAA$%^ | |
# Int - Numbers without decimal (whole numbers) 34, 2,1 100, 986 | |
# Float - Numbers with decimal 5.23, 3.142, 5.0 | |
# Bool - YES/NO, TRUE/FALSE, 1/0, ON/OFF | |
# Variables | |
name = "John" | |
age = 34 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var body: some View { | |
NavigationView { | |
VStack { | |
// get the selected customer | |
CustomerListView(customers: customers) { (customer) in | |
selectedCustomer = customer | |
} | |
if let selectedCustomer = selectedCustomer { |
NewerOlder