728x90
반응형

안현배의 예술수업
안현배 작가: 예술사학자, 사회학 및 역사의 관계 속에서 살피는 예술수업

  • 인상파의 승리와 다양성의 탄생. 19세기 새로운 예술의 시대
  • 오르세 미술관 인상파와 예술사
  • 혁신의 요구, 변화의 시작 - 마네의 무한도전

에두라르 마네(1832년 1월 23일 ~ 1883년 4월 30일)
프랑스의 인상주의 화가
19세기 현대적인 삶의 모습에 접근하려 했던 화가들 중 하나
시대적 화풍이 사실주의에서 인상파로 전환되는 데 중추적 역할
낭만주의(Romanticism): 19세기 전반(1820~1830), 합리주의에 반대, 개인의 낭만/관심사를 중요시함, 귀족적 취향이 고려되지 않음
사실주의(Realism): 19C 이전, 구스타브 쿠르베, 도미에, 구체적인 현실에 대한 묘사, 당시 서민의 삶 속에서 작품의 주제를 찾음
인상주의: 프랑스 중심의 근대 예술운동, 빛에 따른 색의 변화라는 새로운 시각적 현실의 묘사에 관심

Le Déjeuner sur l'herbe, 1863
풀밭위의 점심 식사


Olympia, 1863
올랭피아


La naissance de vénus - Alexendre Cabanel(산드로 보티첼리)
비너스의 탄생


  • 모더니즘의 시작이 왜 마네 부터일까?
  • 인상주의와 모더니즘

모더니즘: 전통적인 기반에서 급진적으로 벗어나려는 20세기 서구 문학, 예술상의 경향
산업혁명과 역사: 사회와 환경의 변화, 그리고 새로운 세대의 시작

  • 해돋이의 인상 클로드 모네
  • 투쟁과 설득, 관점의 변화
  • 스테판 말라르메
  • 우리는 시대와 상관 없이 상징의 발달을 추적하고 싶다. 그것이 순전히 꿈이더라도,
  • 우리는 개성을 위하여, 그리고 행동의 중앙에 있기 위하여,
  • 광장과 거리의 장식을 쫓아다니기보다는 관념의 투쟁을 보완하고 싶다.
  • 우리 예술의 근본적 목적은 객관을 주관화하는 것이 아니라 주관을 객관화 시키기 위한 것이다.
  • 화상과 비평, 예술가
  • 르느와르 물랭 들 라 걀레뜨
  • Daughters of Catulle Mendes, 1888
  • 다양한 시도와 창의성, 예술의 길 / 상징주의
  • 테오도르 샤세리오 터키탕
  • 상징주의의 등장과 다양성에 대한 고민, Le reve
  • 페르낭 크누프 애무
  • Ecole de platon 1898, 260 x 605 cm
  • 제임스 앙소르 가면들
  • 레르미트 추곡수매
  • "우리는 지나간 시대를 어떤 방법으로 이해할 수 있을까?"


끌로드 모네(Claude Monet, 1840~1926)
에두아르 마네(Edouard Manet, 1832~1883)
공통점: 인상주의 개척, 전통적인 미술 거부
차이점: 모네는 검은색을 사용하지 않음(그림자 표현: 파란색과 보라색)

728x90
728x90
728x90
반응형
목차
1. 시퀀스 활용
  1) pop()
  2) count()
  3) split()
  4) join()
2. Tuple(튜플)
3. Dictionary(사전형)
  1) range()
  2) for-range(a, b)
  3) for-range(a)
4. while
  1) 변수 수정
  2) break문

[Review] (4주차) 반복문

2022.08.08 - [Development/Python] - [Python] 04 반복문 - week.04

 

[Python] 04 반복문 - week.04

목차 1. 반복문 2. for-sequence문 3. for-range()문 1) range() 2) for-range(a, b) 3) for-range(a) 4. while 1) 변수 수정 2) break문 [Review] (3주차) 리스트 2022.07.28 - [Development/Python] - [Python]..

sarahee.tistory.com


1. 시퀀스 활용

Point I
list.pop(i) : 인덱스 i의 원소를 제거 후 반환

lst = [1, 2, 3, 4, 5]
box = lst.pop(0) # lst에서 1을 제거 후 반환, 이 경우에는 변수 box에 대입
print(lst) 
# [2, 3, 4, 5]

print(box)
# 1 

Point II
seq.count(d) : 시퀀스 내부의 자료 d의 개수를 반환

carrot = "Hi Rabbit!"
print(carrot.count("i"))

## 실행 결과 ##
2

Point III
str.split(c) : 문자열 c를 기준으로 문자열 str을 쪼개서 리스트를 반환

ours = "나,너,우리"
print(ours.split(","))
# ['나', '너', '우리']

Point IV
str.join(list) : str을 기준으로 list를 합쳐서 문자열을 반환

coffee = ['a', 'm', 'e', 'r', 'i', 'c', 'a', 'n', 'o']
print("".join(coffee)) # 빈 문자열("")을 기준으로 합치기
# americano

2. Tuple(튜플)

Point I
여러 자료를 담을 수 있으면서, 변하지 않는 자료형

Point II
() - 소괄호로 묶어 표현

tup = (1, 2, 3, 4, 5)

Point III
원소가 하나라면 반드시 원소 뒤에 ,을 적어주어야함

tup_one = (1,)

Point IV
시퀀스 자료형의 성질을 지님

cute = ('c', 'a', 't')
print(cute[1])  #인덱싱
#'a'

print(cute[1:]) #슬라이싱
#('a', 't')

print('e' in cute) #in연산자
#False

print(len(cute)) #len연산자
#3

print(cute + ('e', 'g', 'o', 'r', 'y')) #연결연산
#('c', 'a', 't', 'e', 'g', 'o', 'r', 'y')

print(cute * 3) #반복연산
#('c', 'a', 't', 'c', 'a', 't', 'c', 'a', 't')

Point V
자료를 추가, 삭제, 변경할 수 없음

hero = ("ant", "man")
hero.append("wasp") #Error
hero.remove("man") #Error
hero[0] = "iron" #Error

3. Dictionary(사전형)

Point I
짝꿍(Key → Value)이 있는 자료형

Point II
{} - 중괄호로 묶어서 표현

hp = {"gildong" : "010-1234-5678"}

Point III
key를 알면 value를 알 수 있음

dic = {"apple":"사과", "banana":"바나나"}
print(dic["apple"])
# 사과

Point IV
del 키워드로 Dictionary의 원소 삭제
리스트의 원소를 삭제하는 것도 가능

dic = {"apple":"사과", "banana":"바나나"}
del dic["apple"]
print(dic)
# {"banana":"바나나"}

Point V
Key는 변할 수 없는 자료형이여야 함

dic = {[1, 3, 5]:"odd"} #Error
dic = {(2, 4, 6):"even"} 

[Next] (6주차) 함수와 메서드

2022.11.08 - [Development/Python] - [Python] 02 함수와 메서드 - week.06

 

[Python] 02 함수와 메서드 - week.06

목차 1. 함수 1) 내장 함수 ① max(), min() ② sum(), len() ③ def 2) 매개변수 3) 전역변수 4) 지역변수 2. 메서드 [Review] (5주차) 기초 자료형2 2022.09.05 - [Development/Python] - [Python] 01 기초 자료형 II - week.05 [Pyt

sarahee.tistory.com

 

728x90
728x90

'Development > Python' 카테고리의 다른 글

[Python] 03 모듈과 패키지 - week.07  (0) 2023.01.21
[Python] 02 함수와 메서드 - week.06  (0) 2022.11.08
[Python] 04 반복문 - week.04  (0) 2022.08.08
[Python] 03 리스트 - week.03  (0) 2022.07.28
[Python] 02 조건문 - week.02  (0) 2022.07.22
728x90
반응형

UNIT 68. Benefits of the FTA

 

Min-Soo: Emma, have you seen my new smart phone?

 

Emma: No, I haven't. Let me see it... . It looks very nice.

 

Min-Soo: It's a Samsung Galaxy with 4G LTE speed.

 

Emma: I'm not sure what that means, but it sounds impressive.

 

Min-Soo: Yeah, and it has an Android 4.4 KitKat operating system.

Android KitKat: 구글이 개발한 안드로이드 계열의 안드로이드 버전

Emma: You're losing me.

 

Min-Soo: With a Qualcomm Snapdragon 805 2.7GHz quad-core processor.

Qualcomm Snapdragon: 퀄컴에서 개발한 스마트폰, 태블릿, 스마트북 등을 위한 모바일 SoC

Emma: You're way over my head now!

 

Min-Soo: Oh, and Bluetooth 4.0 technology with a 5.7" Super AMOLED HD touch screen.

 

Emma: I should call you "Mr. High Tech," and I have to admit: Korea makes the best smart phones.

 


Exported products going to other countries.

 

Imported products coming to Korea.


The United States and the Republic of Korea signed the United States-Korea Free Trade Agreement (KOORUS FTA) on June 30, 2007.

 

However, it took years of discussions before the agreement was approved by both legislatures and came into effect on March 15, 2012.

 

Over the years of discussion, numerous opponents in both Korea and the U.S. railed against the agreement, stating that it would have adverse effects on agriculture, automobiles, and other industries.

 

Of course, supporters claimed that the agreement would be beneficial to both countries.

 

 

The FTA has now been in effect for more than three years, so one may ask:

 

who has benefited the most from the agreement?

 

According to the Wall Street Journal, the clear winner has been Korea.

 

While bilateral trade between the two countries rose dramatically, the South Korean trade surplus with the U.S. only widened during this period.

 

The following statistics show Korea's trade surplus with the U.S. during the relevant years:

 

2011, 13.1 billion; 2012, 16.6 billion; 2013, 20.7 billion; 2014, 25.1 billion.

 

Also, during this period, Korea's exports to the U.S. grew faster than their exports to the rest of the world.

 

Korean opponents of the FTA had claimed that it would devastate the agricultural sector in Korea due to massive imports of American agriculture and livestock products.

 

These claims were proven to be groundless as Korea's imports of U.S. agriculture and livestock products dropped 20% while Korea's exports of the same type of product increased 20%.

 


What do you think?

(1) Why does Korea's trade surplus with the U.S. keep increasing?

 

 

(2) Should Korea sign more free trade agreements with other countries?

 

 

(3) What are your favorite made-in-Korea products?

 

 

(4) What American products do you like the most?

 

 

(5) What American products do you like the least?

 

 

728x90
728x90
728x90
반응형
목차
1. 과기정통부 2023년도 정부 예산(안) 확정 (220831)
2. 오늘부터 스마트폰 이심(eSIM) 이용이 가능합니다! (220831)
3. 추석 명절, 택배와 금융거래 사칭 문자사기 주의! (220831)
4. 과기정통부, 소속·산하기관 대상 민간 보안전문가(화이트 해커)를 활용한 사이버 모의 침투훈련 실시 (220902)
5. 2022년 상반기 악성코드 은닉사이트 탐지 동향 보고서 (220830)
6. TTPs #8: Operation GWISIN - 맞춤형 랜섬웨어 공격 전략 분석 (220902)

1. 과기정통부 2023년도 정부 예산(안) 확정 (220831)

(출처: 과학기술정보통신부, 보도자료, 정책기획관 기획재정담당관 재정팀 이주헌 팀장(044-202-4430), 장일해 서기관(044-202-4431))

과기정통부, 기술패권경쟁 시대 초격차 전략기술 확보와 국가 디지털 혁신에 집중

2023년 과기정통부 예산안, 금년 추경 대비 2.3% 증액된 18.8조 규모

  • 미래 혁신기술 선점
  • 인재양성 및 기초연구 지원
  • 디지털 혁신 전면화
  • 모두가 행복한 기술 확산에 중점 투자

2023년 정부연구개발(R&D) 예산안, '22 대비 3.0% 증액된 30.7조원 편성

  • 초격차 전략기술
  • 미래 기술
  • 디지털 전환
  • 탄소중립
  • 인력양성 등 국가전략기술 및 미래 성장잠재력 확충에 중점 투자


2. 오늘부터 스마트폰 이심(eSIM) 이용이 가능합니다! (220831)

(출처: 과학기술정보통신부, 보도자료, 통신정책관 통신이용제도과 이정순 과장(044-202-6650), 김성희 사무관(044-202-6651))

9월 1일부터 이통3사(SKT, KT, LGU+) 및 알뜰폰사에서 스마트폰 이심(eSIM)을 이용하여 서비스 가입이 가능

* 이심(eSIM): 유심(USIM)과 동일한 역할을 하며, 칩을 스마트폰에 삽입하여 이용하는 유심(USIM)과 달리 단말에 내장된 칩에 가입자 정보를 다운로드 받아 이용하는 형태의 가입자 식별 모듈(SIM)

  • 이심(eSIM)이 내장된 스마트폰은 유심(USIM)과 이심(eSIM)을 이용하여 하나의 스마트폰으로 두 개의 전화번호를 개통하는 것도 가능(듀얼심)
  • 두 개의 전화번호를 개통하는 경우 통신사를 달리하여 가입하는 것도 가능
  • 선택약정 요금할인도 각각의 개통 건에 적용 가능

3. 추석 명절, 택배와 금융거래 사칭 문자사기 주의! (220831)

(출처: 과학기술정보통신부, 보도자료, 정보보호네트워크정책관 사이버침해대응과 설재진 과장(044-202-6460), 김승열 사무관(044-202-6461))

택배 배송과 금융 지원 안내 등을 사칭한 문자결제사기(스미싱*), 지인 명절인사 등으로 위장한 메신저 피싱 증가로 인한 이용자의 피해 주의 당부

* 스미싱: 문자메시지(SMS)와 피싱(Phishing)의 합성어, 악성 앱 주소가 포함된 휴대폰 문자메시지를 전송하여 이용자 유도 및 금융·개인정보 탈취


4. 과기정통부, 소속·산하기관 대상 민간 보안전문가(화이트 해커)를 활용한 사이버 모의 침투훈련 실시 (220902)

(출처: 과학기술정보통신부, 보도자료, 정책기획관 정보보호담당관 김태영 과장(044-202-4480), 박순재 사무관(044-202-4483))

  • 과학기술정보통신부는 최근 전 세계적인 사이버 공격 증가 추세에 따라 소속·산하기관의 위기대응 역량제고를 위해 '2022년 과기정통부 사이버 모의침투 대응훈련' 실시
  • 민간 보안 전문기업·전문 연구기관 간의 협력

5. 2022년 상반기 악성코드 은닉사이트 탐지 동향 보고서 (220830)

(출처: 한국인터넷진흥원 KISA 인터넷보호나라 & KrCERT, 자료실 > 보고서, 탐지대응팀)

한국인터넷진흥원 사이버침해대응본부는 악성코드 은닉사이트 탐지 시스템(MCF, Malicious Code Finder)을 통해 국내 전체 홈페이지를 대상으로 악성코드 은닉 여부를 점검하고 있음

* 악성코드 은닉사이트: 악성코드 자체 또는 악성코드를 유포하는 주소(URL)를 숨기고 있는 홈페이지

  • 악성코드 경유지 주요 업종 '제조, 건강/의학, 교육/학원'
  • IoT 악성코드(Mozi) 관련 유포지 탐지 지속
  • 이모텟(Emotet) 악성코드 관련 유포지 탐지
  • 정보유출 악성코드 지속 유포
  • 폴리나(Folina) 취약점을 이용한 악성코드 유포 탐지
  • 가상화폐 채굴 악성코드 탐지

* 이모텟(Emotet) 악성코드: 금융정보 탈취를 위한 악성코드, 2014년에 최초 탐지

* 폴리나(Folina) 취약점: Microsoft Office에 존재하는 제로데이 취약점을 악용하여 Word에서 URL 프로토콜을 사용해 마이크로소프트 지원진단도구(MSDT)를 호출할 때 원격 코드가 실행되는 취약점


6. TTPs#8: Operation GWISIN - 맞춤형 랜섬웨어 공격 전략 분석 [Ver.KOR] (220902)

(출처: 한국인터넷진흥원 KISA 인터넷보호나라 & KrCERT, 자료실 > 보고서, https://thorcert.notion.site/TTPs-8-Operation-GWISIN-c3483353d20241b3a313fa4a8726302a)

  • 사이버보안에서 유명한 고통의 피라미드(The Pyramid of Pain)
  • 방어자가 TTP(Tactic, Technique, Procedure)와 같은 공격자의 전략과 전술, 그리고 그 과정을 이해하고 방어 체계를 운영하는 것이 가장 효과적임을 표현

<자료> 한국인터넷진흥원

 

 

728x90
728x90
728x90
반응형
목차
1. 인공지능 기술 활용을 위한 안드로이드 악성코드(악성앱) 특징정보(220816)
2. 차세대 네트워크(6G) 산업 기술개발사업 공청회 개최 (220824)
3. 자동차 사이버보안 표준 및 보안 기술 동향 (220824)
4. 과학기술&ICT 정책·기술 동향 (220819)

1. 인공지능 기술 활용을 위한 안드로이드 악성코드(악성앱) 특징정보 (220816)

(출처: 한국인터넷진흥원 KISA 인터넷보호나라 & KrCERT, 자료실 > 보고서, 종합분석팀(jjw@kisa.or.kr))

인공지능 기술 활용을 위한 "안드로이드 악성코드(악성앱) 특징정보" (6개 카테고리의 43가지 특징정보)

  • 메타데이터(Metadata) : 기본적인 애플리케이션 정보
  • 정적정보(Static Info) : 함수, API, 서비스 정보, 문자열 등 코드 내에서 확인 가능한 정보
  • 동적정보(Dynamic Info) : 파일 접근/삭제 등 악성앱 실행 시 동작하는 주요 행위 정보
  • 네트워크(Network) : 악성앱 실행 시 접속 시도 및 파일/메모리 내 포함된 URL/IP 정보
  • ATT&CK Matrix : 악성앱을 전략, 전술별(TTPs) 행위를 기술단위 별로 추출한 정보
  • 기타 정보(ETC) : 악성앱의 Bytecode, 분류 정보 등 기타 정보


2. 차세대 네트워크(6G) 산업 기술개발사업 공청회 개최 (220824)

(출처: 과학기술정보통신부, 보도자료, 정보보호네트워크정책관 네트워크정책과 심규열 팀장(044-202-6415), 도하림 사무관(044-202-6426))

  • 우리나라는 작년부터 차세대 네트워크(6G) 원천기술개발을 추진 중
  • 하지만 경쟁국 대비 작은 투자 규모로 세계 주도권 경쟁에 뒤처질 우려가 있는 만큼 투자를 확대해야 함
  • 차세대 네트워크(6G)는 미래 정보기술 산업의 을 새롭게 바꿀 수 있는 디지털 시대 핵심 기반이자 국제 경쟁 향방을 가를 필수전략기술인 만큼, 관심 필요

3. 자동차 사이버보안 표준 및 보안 기술 동향 (220824)

(출처: 정보통신기획평가원, 주간기술동향 2060호, MDS 인텔리전스 고의석 매니저(031-627-3053, nkm@mdsit.co.kr))

  • 기존 자동차의 가장 큰 이슈인 안전(Safety)
  • 정보보안전문가가 자동차에 탑재된 ECU(Electronic Control Unit)의 취약점을 이용하여 해킹에 성공한 사례
  • 완성차 제조업체는 CSMS(Cyber Security Management System) 인증과 각 차종에 대한 형식승인을 받아야 함(두 가지 표준 준수)

<자료> ISO, &ldquo;Information technology - Security techniques - Information security management systems Overview and vocabulary,&rdquo; ISO/IEC 27000, 2018, p.19, &lsquo;ISMS family of standards relationships&rsquo; 재구성(정보통신기획평가원)
<자료> ISO, &ldquo;Information technology Security techniques information security management systems Requirements,&rdquo; ISO/IEC 27001, 2013, p.28, A.10 재구성(정보통신기획평가원)

ISO 27001 대응을 위한 공급망에 대한 보안 기술

암호 키 관리 시스템

  • 개발 및 양산 시스템과 물리적으로 분리된 안전한 공간에 보관해야 함
  • 암호 키에 대한 표준 프로토콜인 KMIP(Key Management Interoperability Protocol)을 준수해서 전달해야 함

사설 인증 시스템

  • 자동차 공급망 전 과정에 상호 인증을 통해 보안을 제공하는 시스템
  • 사설 인증 시스템과 암호 키 관리 시스템을 결합하면, 자동차 공급망 전 과정에 안전한 암호 키 및 기밀 데이터 공유가 가능

분리 기법

  • 주요 정보 접근 인원 및 시스템을 최소화하여 보안을 제공하는 기법
  • 방화벽과 같은 망 분리나 비밀 취급 인가 등급에 따른 정보 접근 등의 방법을 통해 분리 기법 적용이 가능
  • 자동차 생산 환경: 암호 키를 기준으로 분리(개발용 암호 키, 양산용 암호 키)

4. 과학기술&ICT 정책·기술 동향 (220819)

(출처: 글로벌 과학기술정책정보 서비스 S&T GPS, 과학기술&ICT 정책·기술 동향 220호)

  • OECD, 우주 경제를 측정하는 방안의 과제와 해결책 제시, 우주 경제에 대한 평가를 개선하기 위한 정책 제언을 담은 안내서 발표('22.7)
  • 일본, 블록체인 기반 환경을 전담할 '웹3.0 정책추진실' 출범

 

 

728x90
728x90
728x90
반응형

[Review] (9주차) 실습

2022.08.26 - [Development/Swift] - [Swift] iOS 앱 개발(Xcode) Byte Degree - week.09

 

[Swift] iOS 앱 개발(Xcode) Byte Degree - week.09

[Review] (8주차) 실습 2022.08.26 - [Development/Swift] - [Swift] iOS 앱 개발(Xcode) Byte Degree - week.08 [Swift] iOS 앱 개발(Xcode) Byte Degree - week.08 [Review] (7주차) 실습 2022.08.25 - [Develop..

sarahee.tistory.com


2-5번째 내비게이션 탭 연동하기

첫번째로, 네번째 탭 연결

Main 탭의 Custom Class - Class, Identify - Storyboard ID 설정(CharViewController → FrameworkListViewController)

Inherit Module From Target 체크

 

기존 코드

//
//  MainTabBarController.swift
//  CarrotHomeTab
//
//  Created by sehee on 2022/08/24.
//

import UIKit

// 1. 탭이 눌릴 때마다, 그에 맞는 네비게이션 바를 구성하고자 함
// - 탭이 눌리는 것을 감지
// - 감지 후에, 그 탭에 맞게 네비게이션 바 구성 업데이트 필요


// 3. 앱이 시작할 때, 네비게이션바 아이템 설정을 완료하고 싶음
// - 네비게이션 바를

class MainTabBarController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        delegate = self
    }
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        updateNavigaitionItem(vc: self.selectedViewController!)
        //self.selectedIndex
        //self.selectedViewController
    }
    
    private func updateNavigaitionItem(vc: UIViewController) {
        switch vc {
        case is HomeViewController:
            let titleConfig = CustomBarItemConfiguration(
                title: "정자동",
                handler: { })
            
            let titleItem = UIBarButtonItem.generate(with: titleConfig)
            
            let searchConfig = CustomBarItemConfiguration(
                image: UIImage(systemName: "magnifyingglass"),
                handler: { print("--> search tapped") })
            
            let searchItem = UIBarButtonItem.generate(with: searchConfig, width: 30)
            
            let feedConfig = CustomBarItemConfiguration(
                image: UIImage(systemName: "bell"),
                handler: { print("--> feed tapped") })
            let feedItem = UIBarButtonItem.generate(with: feedConfig, width: 30)
            
            //let titleItem = UIBarButtonItem(title: "정자동", style: .plain, target: nil, action: nil)
            //let feedItem = UIBarButtonItem(barButtonSystemItem: .bookmarks, target: nil, action: nil)
            navigationItem.leftBarButtonItem = titleItem
            navigationItem.rightBarButtonItems = [feedItem, searchItem]
            navigationItem.backButtonDisplayMode = .minimal
            
        case is MyTownViewController:
            let titleConfig = CustomBarItemConfiguration(
                title: "정자동",
                handler: { })
            
            let titleItem = UIBarButtonItem.generate(with: titleConfig)
            
            let feedConfig = CustomBarItemConfiguration(
                image: UIImage(systemName: "bell"),
                handler: { print("--> feed tapped") })
            let feedItem = UIBarButtonItem.generate(with: feedConfig, width: 30)
            
            navigationItem.leftBarButtonItem = titleItem
            navigationItem.rightBarButtonItems = [feedItem]
            navigationItem.backButtonDisplayMode = .minimal
            
        case is ChatViewController:
            let titleConfig = CustomBarItemConfiguration(
                title: "채팅",
                handler: { })
            
            let titleItem = UIBarButtonItem.generate(with: titleConfig)
            
            let feedConfig = CustomBarItemConfiguration(
                image: UIImage(systemName: "bell"),
                handler: { print("--> feed tapped") })
            let feedItem = UIBarButtonItem.generate(with: feedConfig, width: 30)
            
            navigationItem.leftBarButtonItem = titleItem
            navigationItem.rightBarButtonItems = [feedItem]
            navigationItem.backButtonDisplayMode = .minimal
            
        case is MyProfileViewController:
            let titleConfig = CustomBarItemConfiguration(
                title: "나의 당근",
                handler: { })
            
            let titleItem = UIBarButtonItem.generate(with: titleConfig)
            
            let settingConfig = CustomBarItemConfiguration(
                image: UIImage(systemName: "magnifyingglass"),
                handler: { print("--> setting tapped") })
            
            let settingItem = UIBarButtonItem.generate(with: settingConfig, width: 30)
            
            navigationItem.leftBarButtonItem = titleItem
            navigationItem.rightBarButtonItems = [settingItem]
            navigationItem.backButtonDisplayMode = .minimal
            
        default:
            let titleConfig = CustomBarItemConfiguration(
                title: "정자동",
                handler: { })
            
            let titleItem = UIBarButtonItem.generate(with: titleConfig)
            
            //let titleItem = UIBarButtonItem(title: "정자동", style: .plain, target: nil, action: nil)
            //let feedItem = UIBarButtonItem(barButtonSystemItem: .bookmarks, target: nil, action: nil)
            navigationItem.leftBarButtonItem = titleItem
            navigationItem.rightBarButtonItems = []
            navigationItem.backButtonDisplayMode = .minimal
        }
    }
}

// 2. 각 탭에 맞게 네비게이션바 아이템 구성하기
// - 홈: 타이틀, 피드, 서치
// - 동네활동: 타이틀, 피드
// - 내 근처: 타이틀
// - 채팅: 타이틀, 피드
// - 나의 당근: 타이틀, 설정

extension MainTabBarController: UITabBarControllerDelegate {
    func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
        print("--> 어떤 vc가 선택:\(viewController)")
        
        updateNavigaitionItem(vc: viewController)
    }
}

변경사항

1) default display mode 및 FrameworkListViewController

2) 하단 extension의 print문은 주석 처리

        case is FrameworkListViewController:
            navigationItem.largeTitleDisplayMode = .always
            navigationItem.title = "애플"
            navigationItem.leftBarButtonItem = nil
            navigationItem.rightBarButtonItems = nil
            navigationItem.backButtonDisplayMode = .minimal
            
        default:
            navigationItem.largeTitleDisplayMode = .always
            navigationItem.title = nil
            navigationItem.leftBarButtonItem = nil
            navigationItem.rightBarButtonItems = nil
            navigationItem.backButtonDisplayMode = .minimal
        }

Cannot find type 'FrameworkListViewController' in scope

참고: 9주차 > Part8. 실전 프로젝트_Ch02. 당근 홈탭 리스트 따라해보기(Carrot Home) (1) > 07. 프로젝트 당근 홈탭 리스트 따라하기 (홈 구성하기) 07 (07:40~08:45)

Editor > Refactor to Storyboard... 클릭하여 AppleFramework.storyboard 생성 등

해결되지 않음

 

폴더를 복사 붙여넣기할 때, Create groups, Copy items if needed 체크 

다음과 같이 채팅 부분의 아이콘이 사라지며, 다음과 같은 소스 오류 코드 생성

Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

→ 해당 View를 스토리보드 Connection Inpsector에서 ViewController에 연결해주지 않아서 발생

 

다섯번째 탭도 동일하게 설정

 

 

728x90
728x90
728x90
반응형

[Review] (8주차) 실습

2022.08.26 - [Development/Swift] - [Swift] iOS 앱 개발(Xcode) Byte Degree - week.08

 

[Swift] iOS 앱 개발(Xcode) Byte Degree - week.08

[Review] (7주차) 실습 2022.08.25 - [Development/Swift] - [Swift] iOS 앱 개발(Xcode) Byte Degree - week.07 [Swift] iOS 앱 개발(Xcode) Byte Degree - week.07 [Review] (6주차) 실습 2022.07.22 - [Develop..

sarahee.tistory.com


지금까지 구현한 내용

1) 각 탭 구성

2) 탭 별 다른 내비게이션 아이템 설정

3) Home의 Search, Feed, List 등 모두 구성

4) 서버로부터 받은 내용으로 List 구현

앞으로 구현할 내용

Detail view 구성


DetailViewModel.swift 및 ItemInfoDetails.swift 생성

 

HomeViewController에서 viewModel 설정

vc.viewModel = DetailViewModel(network: NetworkService(configuration: .default), itemInfo: item)
collectionView.delegate = self

extension HomeViewController: UICollectionViewDelegate {
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        let item = viewModel.items[indexPath.item]
        viewModel.itemTapped.send(item)
    }
}

디자인 라벨 등 구성(완료)

코드 수정 방법

option key를 누르고, 커서 드래그 이후 좌우 방향키 이용하여 사용하지 않는 코드 삭제(혹은 생성 가능)

    // User
    @IBOutlet weak var userThumbnail: UIImageView!
    @IBOutlet weak var userNickName: UILabel!
    @IBOutlet weak var userLocation: UILabel!
    @IBOutlet weak var userTemperature: UILabel!
    
    // Item
    @IBOutlet weak var itemThumbnail: UIImageView!
    @IBOutlet weak var itemInfoTitle: UILabel!
    @IBOutlet weak var itemInfoDescription: UILabel!

KingFisher import하여 image 적용

상세뷰 우측 상단에 아이콘 삽입

DetailViewController의 viewDidLoad 함수에 configureNavigationBar() 추가

    override func viewDidLoad() {
        super.viewDidLoad()
        configureNavigationBar()
        bind()
        viewModel.fetch()
    }

Editor > Edit All in Scope (control + command + E)

가격 라벨 추가

@IBOutlet weak var itemPriceLabel: UILabel!

self.itemPriceLabel.text = "\(self.formatNumber(details.item.price))원"

extension DetailViewController {
    private func formatNumber(_ price: Int) -> String {
        let formatter = NumberFormatter()
        formatter.numberStyle = .decimal
        let result = formatter.string(from: NSNumber(integerLiteral: price)) ?? ""
        return result
    }

중간에 separate line 추가하여 완료

상세 오류 수정 #1

문제: 내용(Item Info Description)이 두 줄밖에 보이지 않는 현상

해결: Label Lines: 2 → 0 설정

상세 오류 수정 #2

문제: Detail View의 스크롤이 되지 않는 현상

Align Top to: Safe Area Equals: 44 삭제 및 Stack View 확인

Horizontal - Trailing/Leading Space to: Superview

Vertical - Bottom/Top Space to: Superview

설정하여 해결, 첫번째 내비게이션 바 완성

 

728x90
728x90
728x90
반응형

[Review] (7주차) 실습

2022.08.25 - [Development/Swift] - [Swift] iOS 앱 개발(Xcode) Byte Degree - week.07

 

[Swift] iOS 앱 개발(Xcode) Byte Degree - week.07

[Review] (6주차) 실습 2022.07.22 - [Development/Swift] - [Swift] iOS 앱 개발(Xcode) Byte Degree - week.06 [Swift] iOS 앱 개발(Xcode) Byte Degree - week.06 [Review] (5주차) 실습 2022.07.16 - [Dev/Swi..

sarahee.tistory.com


오류 시, Main.storyboard 삭제 후 다시 붙여넣기

Home UI 설정하기

Editor > Refactor to Storyboard... - Home

command + N > Swift - HomeViewModel

 

홈의 텍스트 및 버튼 삭제

Home 구성

Cocoa Touch Class 생성(Class: ItemInfoCell, Subclass of: UICollectionViewCell)

//
//  HomeViewController.swift
//  CarrotHomeTab
//
//  Created by sehee on 2022/08/24.
//

import UIKit
import Combine

// - 홈의 뷰 모델 만들기(리스트 가져오고, 아이템 탭 했을 때의 행동 정의)
// - 뷰 모델은 리스트 가져오기

class HomeViewController: UIViewController {

    @IBOutlet weak var collectionView: UICollectionView!
    
    let viewModel: HomeViewModel = HomeViewModel(network: NetworkService(configuration: .default))
    var subscriptions = Set<AnyCancellable>()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        configureCollectionView()
        bind()
        viewModel.fetch()
    }
    
    private func configureCollectionView() {
        
    }
    
    private func bind() {
        viewModel.$items
            .receive(on: RunLoop.main)
            .sink { items in
                //self.applyItems(items)
                print("--> update collection view \(items)")
            }.store(in: &subscriptions)
        
        viewModel.itemTapped
            .sink { item in
                let sb = UIStoryboard(name: "Detail", bundle: nil)
                let vc = sb.instantiateViewController(withIdentifier: "DetailViewController") as! DetailViewController
                //vc.viewModel = DetailViewModel(network: NetworkService(configuration: .default), itemInfo: item)
                self.navigationController?.pushViewController(vc, animated: true)
            }.store(in: &subscriptions)
    }
}

Snapshot 설정하여 내부 페이지 확인

오류 수정 #1

Thread 1: "[<CarrotHomeTab.ItemInfoCell 0x7fd8d7846620> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key descriptionLable."

→ Xcode 내 코드에 연결시킨 button을 찾을 수 없음

뷰 내의 인스펙터가 연결 코드 정보와 상이하여 발생(연결 이후 라벨을 변경한 경우, Lable → Label)

ItemInfoCell 내 연결정보 변경

class ItemInfoCell: UICollectionViewCell {
    
    @IBOutlet weak var thumbnail: UIImageView!
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var descriptionLabel: UILabel!
    @IBOutlet weak var priceLabel: UILabel!
    @IBOutlet weak var numOfChatLabel: UILabel!
    @IBOutlet weak var numOfLikeLabel: UILabel!

그래도 불가...

Referencing Outlets 해당 부분을 x

오류 수정 #2

Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

→ 1번과 동일한 문제

반복하여 연결 코드 삭제 후 재입력

해결

 

// - 좌우 패딩 필요

// - 셀에서, 콤마 표시하게끔 넘버 포매팅

// - 셀에서, 이미지 세팅하기 (+ cornerRadius 설정)

// - 셀에서, 콤마 표시하게끔 넘버 포매팅, formatNumber 변경
	func configure(item: ItemInfo) {
        titleLabel.text = item.title
        descriptionLabel.text = item.location
        priceLabel.text = "\(formatNumber(item.price))원"
        
        numOfChatLabel.text = "\(item.numOfChats)"
        numOfLikeLabel.text = "\(item.numOfLikes)"
    }

    private func formatNumber(_ price: Int) -> String {
        let formatter = NumberFormatter()
        formatter.numberStyle = .decimal
//        formatter.numberStyle = .currencyPlural
//        formatter.locale = Locale(identifier: "ko-KR")
        let result = formatter.string(from: NSNumber(integerLiteral: price)) ?? ""
        return result
    }

 

Kingfisher download

Kingfisher: 원격 저장소,  쉽게 말해서 고유의 URL 주소를 가지고 있는 이미지를 앱 내에서 보여지게 해주는 라이브러리

project에서 CarrotHomeTab 선택, 상단바 Package Dependencies 선택, + 버튼 눌러서 Searching All Sources

혹은 File > Add Packages...

패키지 파일 존재하지 않음, 별도 다운로드 필요

 

File > Swift Packages > Add Package Dependency
Add https://github.com/onevcat/Kingfisher.git
Select "Up to Next Major" with "7.0.0"

 

https://github.com/wwood/kingfisher-download

 

GitHub - wwood/kingfisher-download: Easier download/extract of FASTA/Q read data and metadata from the ENA, NCBI, AWS or GCP.

Easier download/extract of FASTA/Q read data and metadata from the ENA, NCBI, AWS or GCP. - GitHub - wwood/kingfisher-download: Easier download/extract of FASTA/Q read data and metadata from the EN...

github.com

git clone https://github.com/wwood/kingfisher-download
cd kingfisher-download
conda env create -n kingfisher -f kingfisher.yml
conda activate kingfisher
cd bin
export PATH=$PWD:$PATH
kingfisher -h

Swift 내장 패키지 파일이 아니므로 Add Local... 불가

해당 URL 입력하여 download

https://github.com/wwood/kingfisher-download

다시 설치

https://github.com/onevcat/Kingfisher

 

GitHub - onevcat/Kingfisher: A lightweight, pure-Swift library for downloading and caching images from the web.

A lightweight, pure-Swift library for downloading and caching images from the web. - GitHub - onevcat/Kingfisher: A lightweight, pure-Swift library for downloading and caching images from the web.

github.com

Dependency Rule: Up to Next Major Version

import Kingfisher

        thumbnail.kf.setImage(
            with: URL(string: item.thumbnailURL),
            placeholder: UIImage(systemName: "hands.sparkles.fill")
        )

다음과 같이 생성(완료)


Storyboard에서 바로 깨어난 시점에서, 이미지의 모서리를 둥글게 설정

    override func awakeFromNib() {
        super.awakeFromNib()
        thumbnail.layer.cornerRadius = 10
        thumbnail.layer.masksToBounds = true
        thumbnail.tintColor = .systemGray
    }

잘못된 URL(이미지가 있는 서버 URL이 아닌)를 선택했을 때, place holder가 보여야 함

        thumbnail.kf.setImage(
//            with: URL(string: item.thumbnailURL),
            with: URL(string: ""),
            placeholder: UIImage(systemName: "hands.sparkles.fill")
        )

 

 

728x90
728x90

+ Recent posts