diff --git a/Coins.xcodeproj/project.pbxproj b/Coins.xcodeproj/project.pbxproj index 6096ad7..f37d304 100644 --- a/Coins.xcodeproj/project.pbxproj +++ b/Coins.xcodeproj/project.pbxproj @@ -31,6 +31,12 @@ 5DD4667E27450C8700D1B730 /* HistoricalCoinRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DD4667D27450C8700D1B730 /* HistoricalCoinRequest.swift */; }; 5DD466822745338800D1B730 /* Period.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DD466812745338800D1B730 /* Period.swift */; }; 5DD466852745BF6F00D1B730 /* Charts in Frameworks */ = {isa = PBXBuildFile; productRef = 5DD466842745BF6F00D1B730 /* Charts */; }; + 5DD466992745C75800D1B730 /* GraphikRegularItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5DD4668F2745C73D00D1B730 /* GraphikRegularItalic.otf */; }; + 5DD4669A2745C75800D1B730 /* GraphikSemiboldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5DD4668A2745C73D00D1B730 /* GraphikSemiboldItalic.otf */; }; + 5DD4669F2745C75800D1B730 /* GraphikSemibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5DD4668C2745C73D00D1B730 /* GraphikSemibold.otf */; }; + 5DD466AA2745C75800D1B730 /* GraphikRegular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5DD466902745C73E00D1B730 /* GraphikRegular.otf */; }; + 5DD466AD2745C91F00D1B730 /* GraphikMediumItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5DD466AB2745C91F00D1B730 /* GraphikMediumItalic.otf */; }; + 5DD466AE2745C91F00D1B730 /* GraphikMedium.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5DD466AC2745C91F00D1B730 /* GraphikMedium.otf */; }; 5DF277012743841F003C434B /* CoinsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DF277002743841F003C434B /* CoinsViewModel.swift */; }; 5DF27703274384CF003C434B /* CoinViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DF27702274384CF003C434B /* CoinViewModel.swift */; }; 5DF27707274385D0003C434B /* CoinCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DF27706274385D0003C434B /* CoinCell.swift */; }; @@ -63,6 +69,12 @@ 5DD4667B274509F400D1B730 /* HistoricalCoin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoricalCoin.swift; sourceTree = ""; }; 5DD4667D27450C8700D1B730 /* HistoricalCoinRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoricalCoinRequest.swift; sourceTree = ""; }; 5DD466812745338800D1B730 /* Period.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Period.swift; sourceTree = ""; }; + 5DD4668A2745C73D00D1B730 /* GraphikSemiboldItalic.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = GraphikSemiboldItalic.otf; sourceTree = ""; }; + 5DD4668C2745C73D00D1B730 /* GraphikSemibold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = GraphikSemibold.otf; sourceTree = ""; }; + 5DD4668F2745C73D00D1B730 /* GraphikRegularItalic.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = GraphikRegularItalic.otf; sourceTree = ""; }; + 5DD466902745C73E00D1B730 /* GraphikRegular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = GraphikRegular.otf; sourceTree = ""; }; + 5DD466AB2745C91F00D1B730 /* GraphikMediumItalic.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = GraphikMediumItalic.otf; sourceTree = ""; }; + 5DD466AC2745C91F00D1B730 /* GraphikMedium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = GraphikMedium.otf; sourceTree = ""; }; 5DF277002743841F003C434B /* CoinsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoinsViewModel.swift; sourceTree = ""; }; 5DF27702274384CF003C434B /* CoinViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoinViewModel.swift; sourceTree = ""; }; 5DF27706274385D0003C434B /* CoinCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoinCell.swift; sourceTree = ""; }; @@ -197,6 +209,7 @@ 5DBF02632742352B00FE6C1D /* Resoureces */ = { isa = PBXGroup; children = ( + 5DD466862745C72800D1B730 /* fonts */, 5DBF021A2741FA9E00FE6C1D /* Assets.xcassets */, ); path = Resoureces; @@ -211,6 +224,19 @@ path = Applcation; sourceTree = ""; }; + 5DD466862745C72800D1B730 /* fonts */ = { + isa = PBXGroup; + children = ( + 5DD466AC2745C91F00D1B730 /* GraphikMedium.otf */, + 5DD466AB2745C91F00D1B730 /* GraphikMediumItalic.otf */, + 5DD466902745C73E00D1B730 /* GraphikRegular.otf */, + 5DD4668F2745C73D00D1B730 /* GraphikRegularItalic.otf */, + 5DD4668C2745C73D00D1B730 /* GraphikSemibold.otf */, + 5DD4668A2745C73D00D1B730 /* GraphikSemiboldItalic.otf */, + ); + path = fonts; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -278,8 +304,14 @@ buildActionMask = 2147483647; files = ( 5DBF021E2741FA9E00FE6C1D /* LaunchScreen.storyboard in Resources */, + 5DD466992745C75800D1B730 /* GraphikRegularItalic.otf in Resources */, + 5DD466AE2745C91F00D1B730 /* GraphikMedium.otf in Resources */, 5DBF021B2741FA9E00FE6C1D /* Assets.xcassets in Resources */, + 5DD466AD2745C91F00D1B730 /* GraphikMediumItalic.otf in Resources */, 5DBF02192741FA9B00FE6C1D /* Main.storyboard in Resources */, + 5DD4669A2745C75800D1B730 /* GraphikSemiboldItalic.otf in Resources */, + 5DD466AA2745C75800D1B730 /* GraphikRegular.otf in Resources */, + 5DD4669F2745C75800D1B730 /* GraphikSemibold.otf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Coins/Models/Article.swift b/Coins/Models/Article.swift index 0aeda0e..d754d08 100644 --- a/Coins/Models/Article.swift +++ b/Coins/Models/Article.swift @@ -20,14 +20,12 @@ struct ArticleResponse: Decodable { struct Article: Decodable { let title: String - let description: String let url: String let date: TimeInterval let imageURL: String enum CodingKeys: String, CodingKey { case title - case description = "body" case url case date = "published_on" case imageURL = "imageurl" diff --git a/Coins/Models/Coin.swift b/Coins/Models/Coin.swift index d908df5..5d4d811 100644 --- a/Coins/Models/Coin.swift +++ b/Coins/Models/Coin.swift @@ -18,7 +18,6 @@ struct CoinResponse: Decodable { struct Coin: Decodable { let name: String let price: Double - let change24Hour: Double let changePercent24Hour: Double @@ -33,7 +32,6 @@ struct Coin: Decodable { enum CodingKeys: String, CodingKey { case name = "FROMSYMBOL" case price = "PRICE" - case change24Hour = "CHANGE24HOUR" case changePercent24Hour = "CHANGEPCT24HOUR" } @@ -43,7 +41,6 @@ struct Coin: Decodable { let coinContainer = try rawContainer.nestedContainer(keyedBy: CodingKeys.self, forKey: .usd) name = try coinContainer.decode(String.self, forKey: .name) price = try coinContainer.decode(Double.self, forKey: .price) - change24Hour = try coinContainer.decode(Double.self, forKey: .change24Hour) changePercent24Hour = try coinContainer.decode(Double.self, forKey: .changePercent24Hour) } diff --git a/Coins/Resoureces/fonts/GraphikMedium.otf b/Coins/Resoureces/fonts/GraphikMedium.otf new file mode 100644 index 0000000..e03a100 Binary files /dev/null and b/Coins/Resoureces/fonts/GraphikMedium.otf differ diff --git a/Coins/Resoureces/fonts/GraphikMediumItalic.otf b/Coins/Resoureces/fonts/GraphikMediumItalic.otf new file mode 100644 index 0000000..508509b Binary files /dev/null and b/Coins/Resoureces/fonts/GraphikMediumItalic.otf differ diff --git a/Coins/Resoureces/fonts/GraphikRegular.otf b/Coins/Resoureces/fonts/GraphikRegular.otf new file mode 100644 index 0000000..8100438 Binary files /dev/null and b/Coins/Resoureces/fonts/GraphikRegular.otf differ diff --git a/Coins/Resoureces/fonts/GraphikRegularItalic.otf b/Coins/Resoureces/fonts/GraphikRegularItalic.otf new file mode 100644 index 0000000..8cefe1c Binary files /dev/null and b/Coins/Resoureces/fonts/GraphikRegularItalic.otf differ diff --git a/Coins/Resoureces/fonts/GraphikSemibold.otf b/Coins/Resoureces/fonts/GraphikSemibold.otf new file mode 100644 index 0000000..45cf6bc Binary files /dev/null and b/Coins/Resoureces/fonts/GraphikSemibold.otf differ diff --git a/Coins/Resoureces/fonts/GraphikSemiboldItalic.otf b/Coins/Resoureces/fonts/GraphikSemiboldItalic.otf new file mode 100644 index 0000000..f88d99d Binary files /dev/null and b/Coins/Resoureces/fonts/GraphikSemiboldItalic.otf differ diff --git a/Coins/Storyboards/Base.lproj/Main.storyboard b/Coins/Storyboards/Base.lproj/Main.storyboard index 965a3de..3f4f26d 100644 --- a/Coins/Storyboards/Base.lproj/Main.storyboard +++ b/Coins/Storyboards/Base.lproj/Main.storyboard @@ -8,6 +8,14 @@ + + + Graphik-Medium + + + Graphik-Regular + + @@ -21,41 +29,37 @@ - - + + - + - - + + - + - + - - - - - + + + + - @@ -101,7 +104,7 @@ - + @@ -111,48 +114,42 @@ - + - - + + - + - - + + - - @@ -211,34 +207,34 @@ - + - - + + - + - + @@ -253,6 +249,7 @@ + @@ -335,5 +332,8 @@ + + + diff --git a/Coins/Supporting Files/Info.plist b/Coins/Supporting Files/Info.plist index dd3c9af..74a2a89 100644 --- a/Coins/Supporting Files/Info.plist +++ b/Coins/Supporting Files/Info.plist @@ -2,6 +2,15 @@ + UIAppFonts + + GraphikSemiboldItalic.otf + GraphikSemibold.otf + GraphikRegular.otf + GraphikRegularItalic.otf + GraphikMedium.otf + GraphikMediumItalic.otf + UIApplicationSceneManifest UIApplicationSupportsMultipleScenes diff --git a/Coins/View Controllers/Table View Cells/ArticleCell.swift b/Coins/View Controllers/Table View Cells/ArticleCell.swift index bf7a99b..e5382f3 100644 --- a/Coins/View Controllers/Table View Cells/ArticleCell.swift +++ b/Coins/View Controllers/Table View Cells/ArticleCell.swift @@ -11,13 +11,11 @@ import Kingfisher final class ArticleCell: UITableViewCell { @IBOutlet weak var titleLabel: UILabel! - @IBOutlet weak var descriptionLabel: UILabel! @IBOutlet weak var dateLabel: UILabel! @IBOutlet weak var thumbnailImageView: UIImageView! func configure(with viewModel: ArticleViewModel) { titleLabel.text = viewModel.title - descriptionLabel.text = viewModel.description dateLabel.text = viewModel.date thumbnailImageView.kf.indicatorType = .activity thumbnailImageView.kf.setImage(with: viewModel.thumbnailUrl) diff --git a/Coins/View Controllers/Table View Cells/CoinCell.swift b/Coins/View Controllers/Table View Cells/CoinCell.swift index b7bd0b9..c00d45e 100644 --- a/Coins/View Controllers/Table View Cells/CoinCell.swift +++ b/Coins/View Controllers/Table View Cells/CoinCell.swift @@ -7,17 +7,15 @@ import UIKit -class CoinCell: UITableViewCell { +final class CoinCell: UITableViewCell { @IBOutlet weak var nameLabel: UILabel! @IBOutlet weak var priceLabel: UILabel! - @IBOutlet weak var changePriceLabel: UILabel! @IBOutlet weak var changePercentLabel: UILabel! func configure(with viewModel: CoinViewModel) { nameLabel.text = viewModel.name priceLabel.text = viewModel.price - changePriceLabel.text = viewModel.changePrice changePercentLabel.text = viewModel.changePercent } diff --git a/Coins/View Models/ArticleViewModel.swift b/Coins/View Models/ArticleViewModel.swift index 00dbed5..be160a4 100644 --- a/Coins/View Models/ArticleViewModel.swift +++ b/Coins/View Models/ArticleViewModel.swift @@ -23,10 +23,6 @@ extension ArticleViewModel { article.title } - var description: String { - article.description - } - var date: String { let formatter = DateFormatter() formatter.dateStyle = .medium diff --git a/Coins/View Models/CoinViewModel.swift b/Coins/View Models/CoinViewModel.swift index e2e547c..42ee2a3 100644 --- a/Coins/View Models/CoinViewModel.swift +++ b/Coins/View Models/CoinViewModel.swift @@ -30,13 +30,6 @@ extension CoinViewModel { return formatter.string(from: price)! } - var changePrice: String { - let price = coin.change24Hour as NSNumber - let formatter = NumberFormatter() - formatter.numberStyle = .currency - return formatter.string(from: price)! - } - var changePercent: String { let percent = coin.changePercent24Hour as NSNumber let formatter = NumberFormatter()