Skip to content

Commit

Permalink
Week 2 - Images
Browse files Browse the repository at this point in the history
  • Loading branch information
Karan Bhasin committed Jul 11, 2020
1 parent d84a3c7 commit 09d2792
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 1 deletion.
4 changes: 4 additions & 0 deletions SwiftUI_Starter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
77029AF424AA7282007896AD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 77029AF324AA7282007896AD /* Assets.xcassets */; };
77029AF724AA7282007896AD /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 77029AF624AA7282007896AD /* Preview Assets.xcassets */; };
77029AFA24AA7282007896AD /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 77029AF824AA7282007896AD /* LaunchScreen.storyboard */; };
7729D99A24B9C0A500FB8EFF /* LearnImagesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7729D99924B9C0A500FB8EFF /* LearnImagesView.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -24,6 +25,7 @@
77029AF624AA7282007896AD /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
77029AF924AA7282007896AD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
77029AFB24AA7282007896AD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7729D99924B9C0A500FB8EFF /* LearnImagesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LearnImagesView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -59,6 +61,7 @@
77029AED24AA727F007896AD /* AppDelegate.swift */,
77029AEF24AA727F007896AD /* SceneDelegate.swift */,
77029AF124AA727F007896AD /* ContentView.swift */,
7729D99924B9C0A500FB8EFF /* LearnImagesView.swift */,
77029AF324AA7282007896AD /* Assets.xcassets */,
77029AF824AA7282007896AD /* LaunchScreen.storyboard */,
77029AFB24AA7282007896AD /* Info.plist */,
Expand Down Expand Up @@ -149,6 +152,7 @@
77029AEE24AA727F007896AD /* AppDelegate.swift in Sources */,
77029AF024AA727F007896AD /* SceneDelegate.swift in Sources */,
77029AF224AA727F007896AD /* ContentView.swift in Sources */,
7729D99A24B9C0A500FB8EFF /* LearnImagesView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Binary file not shown.
15 changes: 15 additions & 0 deletions SwiftUI_Starter/Assets.xcassets/apple.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "apple.jpeg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions SwiftUI_Starter/Assets.xcassets/med.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "national-cancer-institute-2fyeLhUeYpg-unsplash.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
27 changes: 27 additions & 0 deletions SwiftUI_Starter/LearnImagesView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// LearnImagesView.swift
// SwiftUI_Starter
//
// Created by Karan Bhasin on 11/07/20.
// Copyright © 2020 Karan Bhaisn. All rights reserved.
//

import SwiftUI

struct LearnImagesView: View {
var body: some View {
Image("med")
.resizable()
.scaledToFill()
.frame(width: 200, height: 700, alignment: .center)
.clipShape(Circle())
.aspectRatio(contentMode: .fit)
.clipped()
}
}

struct LearnImagesView_Previews: PreviewProvider {
static var previews: some View {
LearnImagesView()
}
}
3 changes: 2 additions & 1 deletion SwiftUI_Starter/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).

// Create the SwiftUI view that provides the window contents.
let contentView = ContentView()
// let contentView = ContentView()
let contentView = LearnImagesView()

// Use a UIHostingController as window root view controller.
if let windowScene = scene as? UIWindowScene {
Expand Down

0 comments on commit 09d2792

Please sign in to comment.