Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
591 changes: 591 additions & 0 deletions InstagramClone/InstagramClone.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>InstagramClone.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions InstagramClone/InstagramClone/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "InstagramLogo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions InstagramClone/InstagramClone/InstagramCloneApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// InstagramCloneApp.swift
// InstagramClone
//
// Created by 이상엽 on 5/24/24.
//

import SwiftUI

@main
struct InstagramCloneApp: App {
var body: some Scene {
WindowGroup {
LoginView()
}
}
}
112 changes: 112 additions & 0 deletions InstagramClone/InstagramClone/LoginView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
//
// ContentView.swift
// InstagramClone
//
// Created by 이상엽 on 5/24/24.
//

import SwiftUI

struct LoginView: View {
@State private var searchText = ""
var body: some View {
VStack {
HStack{
Button(action: {
}) {
Image(systemName: "chevron.left")
.resizable()
.aspectRatio(contentMode: .fit)
.foregroundColor(.black)
.frame(width: 25, height: 25)
//.padding(.top, 40)
//.offset(x: 0, y: -100)
}
Spacer()
}
Spacer()
Image("InstagramLogo")
.imageScale(.large)
.foregroundStyle(.tint)
.padding(.bottom, 40)
TextField("ID", text: $searchText)
.padding()
.cornerRadius(10)
.background(Color(red: 0.98, green: 0.98, blue: 0.98))
.overlay(
RoundedRectangle(cornerRadius: 10) // 둥근 모서리 사각형
.stroke(Color.gray, lineWidth: 0.3) // 테두리 색상과 두께 지정
)

TextField("Password", text: $searchText)
.padding() // 텍스트필드 내부의 텍스트와 경계 사이의 패딩을 추가
.background(Color(red: 0.98, green: 0.98, blue: 0.98)) // 배경색 지정
.cornerRadius(10) // 둥근 모서리 적용
.overlay(
RoundedRectangle(cornerRadius: 10) // 둥근 모서리 사각형
.stroke(Color.gray, lineWidth: 0.3) // 테두리 색상과 두께 지정
)

HStack{
Spacer()
Text("Forgot password?")
.foregroundColor(Color.blue)
.font(.system(size: 16))
}.padding()


Button(action: {
print("Button tapped")
}) {
Text("log in")
.frame(width: 326, height: 20)
.font(.system(size: 19)) // 폰트 크기
.fontWeight(.bold)
.padding()
.background(Color(red: 0.06, green: 0.55, blue: 1.00))
.foregroundColor(.white)
.cornerRadius(8)
.padding(.bottom, 50) // 하단 여백 추가

}


HStack{
RoundedRectangle(cornerRadius:15)
.fill(Color(red: 0.944, green: 0.949, blue: 0.953))
.frame(width: 150, height: 3)
Spacer()
Text("OR")
.foregroundColor(Color.gray)

Spacer()
RoundedRectangle(cornerRadius:15)
.fill(Color(red: 0.944, green: 0.949, blue: 0.953))
.frame(width: 150, height: 3)
}
HStack(spacing: 0){
Spacer()
Text("Don't have an acount?")
.font(.system(size: 16))
Button(action: {
print("Button tapped")
}) {
Text("Sign Up. ")
.font(.system(size: 16)) // 폰트 크기
.padding()
.background(Color(.white))
.foregroundColor(.blue)
.cornerRadius(8)
}
Spacer()
}.padding(.top, 30)
Spacer()

}
.padding()
}
}

#Preview {
LoginView()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
91 changes: 91 additions & 0 deletions InstagramClone/InstagramClone/SearchView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import SwiftUI

struct SearchView: View {
let rows = [
GridItem(.fixed(100))
]
let columns = [
GridItem(.fixed(120)),
GridItem(.fixed(120)),
GridItem(.fixed(120))
]
let buttonName = ["TV", "Shop", "Style", "Sports" ,"Auto", "Hello"]
@State private var searchText = ""

let items = (0..<30).map { "Item \($0)" }

var filteredItems: [String] {
if searchText.isEmpty {
return items
} else {
return items.filter { $0.contains(searchText) }
}
}

var body: some View {

VStack(spacing: 10){
HStack {
ZStack(alignment: .leading) {

TextField("Search", text: $searchText)
.padding(.leading, 30) // 이미지와 텍스트 간의 간격 조절
.padding(7)
.background(Color(.systemGray6))
.cornerRadius(10)
HStack {
Image(systemName: "magnifyingglass")
.foregroundColor(.black)
Spacer()
}
}
.background(Color(.systemGray6))
.cornerRadius(10)

Image(systemName: "camera.metering.partial")
.resizable()
.aspectRatio(contentMode: .fit)
.foregroundColor(.gray)
.frame(width: 30, height: 30)
.padding(.leading, 8) // 텍스트 필드와 이미지 간의 간격 조절
}//HStack
.padding(.horizontal)

ScrollView(.horizontal, showsIndicators: false) {
LazyHGrid(rows: rows, spacing: 10) {
ForEach(buttonName, id: \.self) { buttonNames in
Text(buttonNames)
.cornerRadius(15)
.frame(width: 100, height: 40)
.overlay(
RoundedRectangle(cornerRadius: 12)
.stroke(Color.gray, lineWidth: 1)
.frame(width: 100, height: 40)
)
}
}
.padding(.horizontal)
.frame(height: 60)
}

ScrollView {
LazyVGrid(columns: columns, spacing: 1) {
ForEach(0..<30) { index in
Rectangle()
.fill(Color.blue)
.frame(width: 127, height: 127)
.overlay(Text("\(index)").foregroundColor(.white))
}
}

}
Spacer()
} //VStack
}
}

struct SearchView_Previews: PreviewProvider {
static var previews: some View {
SearchView()
}
}
36 changes: 36 additions & 0 deletions InstagramClone/InstagramCloneTests/InstagramCloneTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// InstagramCloneTests.swift
// InstagramCloneTests
//
// Created by 이상엽 on 5/24/24.
//

import XCTest
@testable import InstagramClone

final class InstagramCloneTests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
// Any test you write for XCTest can be annotated as throws and async.
// Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
// Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
}

func testPerformanceExample() throws {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}

}
41 changes: 41 additions & 0 deletions InstagramClone/InstagramCloneUITests/InstagramCloneUITests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// InstagramCloneUITests.swift
// InstagramCloneUITests
//
// Created by 이상엽 on 5/24/24.
//

import XCTest

final class InstagramCloneUITests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.

// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false

// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()

// Use XCTAssert and related functions to verify your tests produce the correct results.
}

func testLaunchPerformance() throws {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
}
}
Loading