diff --git a/DebuggingAndProfiling.xcodeproj/project.pbxproj b/DebuggingAndProfiling.xcodeproj/project.pbxproj index 76b915d..6452a99 100644 --- a/DebuggingAndProfiling.xcodeproj/project.pbxproj +++ b/DebuggingAndProfiling.xcodeproj/project.pbxproj @@ -433,7 +433,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"DebuggingAndProfiling/Preview Content\""; - DEVELOPMENT_TEAM = 3ZQJ35HR4K; + DEVELOPMENT_TEAM = 2N3K33KLKM; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; @@ -462,7 +462,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"DebuggingAndProfiling/Preview Content\""; - DEVELOPMENT_TEAM = 3ZQJ35HR4K; + DEVELOPMENT_TEAM = 2N3K33KLKM; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; diff --git a/DebuggingAndProfiling/ContentView.swift b/DebuggingAndProfiling/ContentView.swift index f931a6d..117280a 100644 --- a/DebuggingAndProfiling/ContentView.swift +++ b/DebuggingAndProfiling/ContentView.swift @@ -35,3 +35,14 @@ struct ContentView_Previews: PreviewProvider { ContentView() } } + +// Calculating temp was using the wrong type being var instead of let. Also its calulations was wrong. + + //Original -> var cel = (fah + 32) * 5 / 9 + //Correct -> let cel = (fah - 32) * 5 / 9 + //Original -> var fah = (cel * 5 / 9 ) + 32 + //Correct -> let fah = (cel * 9 / 5) + 32 + + //2. Foreground in OccassionalUpdate was redrawn 7 times and stress test continues to grow while in foreground + + //3. OccasionalUpdate takes awhile after button click. However Stress test runtime is about a quarter of the time. diff --git a/DebuggingAndProfiling/DebugThisCode.swift b/DebuggingAndProfiling/DebugThisCode.swift index 647fc57..78c1bbb 100644 --- a/DebuggingAndProfiling/DebugThisCode.swift +++ b/DebuggingAndProfiling/DebugThisCode.swift @@ -22,7 +22,7 @@ struct DebugThisCode: View { print("Fah changed to \(fahrenheitTemp)") if let fah = Double(fahrenheitTemp) { print("Value is \(fah)") - var cel = (fah + 32) * 5 / 9 + let cel = (fah - 32) * 5 / 9 celsiusTemp = String(cel) } else { print("Not a valid number") @@ -42,7 +42,7 @@ struct DebugThisCode: View { TextField("Temperature in Celsius", text: $celsiusTemp) Button(action: { if let cel = Double(celsiusTemp) { - var fah = (cel * 5 / 9 ) + 32 + let fah = (cel * 5 / 9 ) + 32 fahrenheitTemp = String(fah) } else { print("Not a valid number")