전체 글

잡다한지식/iOS프로그래밍기초

iOS 학습과정(6주차) - Swift 문법

Method Methods — The Swift Programming Language (Swift 5.5) 인스턴스(instance) 메서드 - 인스턴스 메서드는 인스턴스에서 동작 var 인스턴스명 : 클래스명 = 클래스명() // ": 클래스명" 은 생략 가능 클래스(class or type) 메서드 - 타입 메서드 또는 클래스 메서드는 클래스 레벨에서 동작 - 타입 메서드는 인스턴스 메서드와 동일한 방법으로 선언하지만 class 나 static 키워드를 앞에 붙여서 선언 - class키워드로 만든 클래스 메서드는 자식 클래스에서 override가능 클래스명.클래스메서드() Initialization Initialization — The Swift Programming Language (Swift 5...

잡다한지식/iOS프로그래밍기초

iOS 학습과정(5주차) - Swift 문법

1급 객체(first class object) 1급 시민(first class citizen) Swift는 함수를 데이터 타입처럼 처리할 수 있음 => 함수를 상수 또는 변수에 할당하는 것이 가능 ex) func inchesToFeet (inches: Float) -> Float { return inches * 0.0833333 } func outputConversion(converterFunc: (Float) -> Float, value: Float) { //함수를 매개변수로 사용 let result = converterFunc(value) //주의 : 매개변수명(inches:) 안씀 print("Result = \(result)") } let toFeet = inchesToFeet //함수를변수에 저..

잡다한지식/iOS프로그래밍기초

iOS 학습과정(4주차) - Swift 문법

if문 - 스위프트에서는 if 문 다음의 실행 코드가 한 줄이라도 중괄호({})를 필수적으로 사용해야 한다. guard문(조건식이 거짓이면 실행) - guard문은 표현식이 거짓(false)으로 판단될 경우에 수행될 else 절을 반드시 포함해야 함 - else 절에 속한 코드는 현재의 코드 흐름을 빠져 나갈 수 있는 구문(return, break, continue, throw 구문)을 반드시 포함해야 함 - guard문은 기본적으로 특정 조건에 맞지 않을 경우에 현재의 함수나 반복문에서 빠져 나갈 수 있도록 하는 ‘조기 출구(early exit)’ 전략을 제공 - 함수 내부에 있다면 보통 return을 써서 해당 함수를 조기에 빠져나오는 조기 출구 용도로 사용 guard else { // 표현식이 거짓..

잡다한지식/iOS프로그래밍기초

iOS 학습과정(3주차) - Swift 문법

옵셔널(optional) Option type 위키 : https://en.wikipedia.org/wiki/Option_type Option type - Wikipedia For families of option contracts in finance, see Option style. In programming languages (especially functional programming languages) and type theory, an option type or maybe type is a polymorphic type that represents encapsulation of an optional value; e. en.wikipedia.org Nullable type 위키 : https://..

잡다한지식/iOS프로그래밍기초

iOS 학습과정(2주차) - 자료형

Swift 자료 링크 https://docs.swift.org/swift-book/GuidedTour/GuidedTour.html https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html The Basics — The Swift Programming Language (Swift 5.5) The Basics Swift is a new programming language for iOS, macOS, watchOS, and tvOS app development. Nonetheless, many parts of Swift will be familiar from your experience of developing in C and Objective-C. S..

잡다한지식/iOS프로그래밍기초

iOS 학습과정(1주차)

1주차 for x in 1...10{ print("\(x)번쨰 반복 201812052김성환") }

잡다한지식/복학전 대학 공부

전역후 자바 공부시작

2021-03-29 (월) // 1일차 jdk 설치 Eclipse 설치 Hello World!!출력부터 반복및 조건문 응용까지 오늘의가장 기억남는 부분 Integer.parseInt(String);//문자열 정수로 변형 Integer.toString(Int);//정수 문자열로 변형 2021-03-30 (화) // 2일차 입력과 예외처리 맛보기 오늘의가장 기억남는 부분 import java.util.Scanner;//Scanner 사용에 필요 import java.util.InputMismatchExeption;//입력에러 처리에 필요 Scanner sc=new Scanner(System.in) try{ a=sc.nextInt(); }catch(InputMismatchException e) {//예외 처리..

감자씨앗
코딩과 게임