Skip to content

Commit 73ba611

Browse files
author
Mithun
committed
Scrolling your Content
1 parent 4d7995b commit 73ba611

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

DesignCode.xcodeproj/project.pbxproj

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
AB1D3B1C22D9CDEF00D0AEA6 /* HomeList.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB1D3B1B22D9CDEF00D0AEA6 /* HomeList.swift */; };
1011
AB62172722D870540039BC73 /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB62172622D870540039BC73 /* Home.swift */; };
1112
ABE07CBF22D74F5700D209BE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABE07CBE22D74F5700D209BE /* AppDelegate.swift */; };
1213
ABE07CC122D74F5700D209BE /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABE07CC022D74F5700D209BE /* SceneDelegate.swift */; };
@@ -17,6 +18,7 @@
1718
/* End PBXBuildFile section */
1819

1920
/* Begin PBXFileReference section */
21+
AB1D3B1B22D9CDEF00D0AEA6 /* HomeList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeList.swift; sourceTree = "<group>"; };
2022
AB62172622D870540039BC73 /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = "<group>"; };
2123
ABE07CBB22D74F5700D209BE /* DesignCode.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DesignCode.app; sourceTree = BUILT_PRODUCTS_DIR; };
2224
ABE07CBE22D74F5700D209BE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -62,6 +64,7 @@
6264
ABE07CC022D74F5700D209BE /* SceneDelegate.swift */,
6365
ABE07CC222D74F5700D209BE /* ContentView.swift */,
6466
AB62172622D870540039BC73 /* Home.swift */,
67+
AB1D3B1B22D9CDEF00D0AEA6 /* HomeList.swift */,
6568
ABE07CC422D74F5900D209BE /* Assets.xcassets */,
6669
ABE07CC922D74F5900D209BE /* LaunchScreen.storyboard */,
6770
ABE07CCC22D74F5900D209BE /* Info.plist */,
@@ -150,6 +153,7 @@
150153
buildActionMask = 2147483647;
151154
files = (
152155
ABE07CBF22D74F5700D209BE /* AppDelegate.swift in Sources */,
156+
AB1D3B1C22D9CDEF00D0AEA6 /* HomeList.swift in Sources */,
153157
ABE07CC122D74F5700D209BE /* SceneDelegate.swift in Sources */,
154158
AB62172722D870540039BC73 /* Home.swift in Sources */,
155159
ABE07CC322D74F5700D209BE /* ContentView.swift in Sources */,

DesignCode/HomeList.swift

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
//
2+
// HomeList.swift
3+
// DesignCode
4+
//
5+
// Created by Mithun x on 7/13/19.
6+
// Copyright © 2019 Mithun. All rights reserved.
7+
//
8+
9+
import SwiftUI
10+
11+
struct HomeList: View {
12+
var body: some View {
13+
ScrollView(.horizontal, showsIndicators: false) {
14+
HStack {
15+
ForEach(/*@START_MENU_TOKEN@*/0 ..< 5/*@END_MENU_TOKEN@*/) { _ in
16+
CourseView()
17+
}
18+
}
19+
Spacer()
20+
}
21+
}
22+
}
23+
24+
#if DEBUG
25+
struct HomeList_Previews: PreviewProvider {
26+
static var previews: some View {
27+
HomeList()
28+
}
29+
}
30+
#endif
31+
32+
struct CourseView: View {
33+
var body: some View {
34+
return VStack(alignment: .leading) {
35+
Text("Build an app with SwiftUI")
36+
.font(/*@START_MENU_TOKEN@*/ .title/*@END_MENU_TOKEN@*/)
37+
.fontWeight(/*@START_MENU_TOKEN@*/ .bold/*@END_MENU_TOKEN@*/)
38+
.color(.white)
39+
.padding(20)
40+
.lineLimit(4)
41+
.frame(width: 150)
42+
43+
Spacer()
44+
45+
Image("Illustration1")
46+
}
47+
.background(Color("background3"))
48+
.cornerRadius(30)
49+
.frame(width: 246, height: 360)
50+
.shadow(color: Color("backgroundShadow3"), radius: 20, x: 0, y: 20)
51+
}
52+
}

0 commit comments

Comments
 (0)