Mercurial > public > simoleon
diff Simoleon/Helpers/FavouriteButton.swift @ 47:75c1a05176f6
Refactor code
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Mon, 26 Jul 2021 20:08:20 +0100 |
parents | d25b02d439d4 |
children | 7a6a7c677851 |
line wrap: on
line diff
--- a/Simoleon/Helpers/FavouriteButton.swift Mon Jul 26 18:25:03 2021 +0100 +++ b/Simoleon/Helpers/FavouriteButton.swift Mon Jul 26 20:08:20 2021 +0100 @@ -29,8 +29,10 @@ } /* - If currency pair is favourite -> button action is to remove from favourites - else -> button action is to add to favourites + If currency pair is favourite: + * Button action is to remove from favourites + else: + * Button action is to add to favourites */ private func favouriteAction(_ favouriteCurrencyPairs: [String]) { if favouriteCurrencyPairs.contains(currencyPair) { @@ -43,8 +45,10 @@ } /* - if currency pair is favourite -> return "star.fill" symbol - else -> return "star" + if currency pair is favourite: + * Return "star.fill" symbol + else: + * Return "star" */ private func generateStar(_ favouriteCurrencyPairs: [String]) -> String { if favouriteCurrencyPairs.contains(currencyPair) { @@ -55,8 +59,8 @@ } /* - 1) Get first favourite core data object that matches the specified currency pair - 2) Delete it + * Get first favourite core data object that matches the specified currency pair + * Delete it */ private func removeFromFavourites() { withAnimation { @@ -73,8 +77,8 @@ } /* - 1) Create a favourite core data object - 2) Save it + * Create a favourite core data object + * Save it */ private func addToFavourites() { withAnimation {