diff --git a/HomeCafeRecipes/HomeCafeRecipes/Presentation/UploadRecipe/AddRecipeView.swift b/HomeCafeRecipes/HomeCafeRecipes/Presentation/UploadRecipe/AddRecipeView.swift index d011d03..803151c 100644 --- a/HomeCafeRecipes/HomeCafeRecipes/Presentation/UploadRecipe/AddRecipeView.swift +++ b/HomeCafeRecipes/HomeCafeRecipes/Presentation/UploadRecipe/AddRecipeView.swift @@ -175,11 +175,11 @@ final class AddRecipeView: UIView { collectionView.reloadData() } - func getTitleText() -> String? { - return titleTextField.text + var titleText: String { + return titleTextField.text ?? "" } - func getDescriptionText() -> String? { + var descriptionText: String { return descriptionTextView.text } diff --git a/HomeCafeRecipes/HomeCafeRecipes/Presentation/UploadRecipe/AddRecipeViewController.swift b/HomeCafeRecipes/HomeCafeRecipes/Presentation/UploadRecipe/AddRecipeViewController.swift index c5fe316..30f41cb 100644 --- a/HomeCafeRecipes/HomeCafeRecipes/Presentation/UploadRecipe/AddRecipeViewController.swift +++ b/HomeCafeRecipes/HomeCafeRecipes/Presentation/UploadRecipe/AddRecipeViewController.swift @@ -145,8 +145,8 @@ extension AddRecipeViewController: AddRecipeViewDelegate { } func didTapSubmitButton() { - let title = contentView.getTitleText() ?? "" - let description = contentView.getDescriptionText() ?? "" + let title = contentView.titleText + let description = contentView.descriptionText addRecipeInteractor.updateTitle(title) addRecipeInteractor.updateDescription(description) saveRecipeToServer()