Skip to content
Snippets Groups Projects
Commit 8e0e5b7c authored by Emircan Duman's avatar Emircan Duman
Browse files

#3 New feature clicking on cell link to ArticleView(), feed_provider_name added

parent a0cf8c3a
No related branches found
No related tags found
No related merge requests found
...@@ -13,11 +13,12 @@ import SwiftUI ...@@ -13,11 +13,12 @@ import SwiftUI
struct ArticleList: View { struct ArticleList: View {
var body: some View { var body: some View {
List { List {
ForEach(model.article_data){ article in ForEach(model.article_data){ article in
ArticleListRow(article: article, image: Image("824cf0bb-20a4-4655-a50e-0e6ff7520d0f")) ArticleListRow(article: article, image: Image("824cf0bb-20a4-4655-a50e-0e6ff7520d0f"))
}
} }
}
.frame(alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
} }
} }
......
...@@ -12,44 +12,49 @@ import SwiftUI ...@@ -12,44 +12,49 @@ import SwiftUI
*/ */
struct ArticleListRow: View { struct ArticleListRow: View {
var article: ArticleData var article: ArticleData
var image: Image var image: Image
var body: some View { var body: some View {
NavigationLink(destination: ArticleView()){
HStack { HStack {
image
.resizable() VStack{
.frame(width: 130, height: 115) Text(article.title)
.font(.custom("article_titel", size: 19))
VStack{ HStack{
Text(article.title) Text("feed_provider_name")
.font(.custom("article_titel", size: 19)) .font(.custom("parent_feed_provider_name", size: 10))
Text(article.date_to_string()) Text(article.date_to_string())
.font(.custom("article_pub_date", size: 12)) .font(.custom("article_pub_date", size: 10))
}
Text(article.description) Text(article.description)
.font(.subheadline) .font(.subheadline)
}
Spacer()
//Image(article.image)
image
.resizable()
.frame(width: 130, height: 115)
} }
//article.image .frame(alignment: .center)
Spacer()
} }
.frame(width: 370, height: 120, alignment: .center)
} }
}
struct ArticleListRow_Previews: PreviewProvider {
struct ArticleListRow_Previews: PreviewProvider { static var previews: some View {
static var previews: some View {
let img0 = Image("824cf0bb-20a4-4655-a50e-0e6ff7520d0f")
let img0 = Image("824cf0bb-20a4-4655-a50e-0e6ff7520d0f") let img1 = Image("c9f82579-efeb-4ed5-bf07-e10edafc3a4d")
let img1 = Image("c9f82579-efeb-4ed5-bf07-e10edafc3a4d")
Group{
Group{ ArticleListRow(article: model.article_data[0],image: img0)
ArticleListRow(article: model.article_data[0],image: img0) ArticleListRow(article: model.article_data[1],image: img1)
ArticleListRow(article: model.article_data[1],image: img1) }
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment