전체 글42 고잉 프린세스 2024. 9. 13. 안드로이드에서 로딩 화면을 구현하는 두 가지 방법(ProgressDialog) 1. 원형 대기 화면 activity_main.xml MainActivity.java package com.example.a05_09; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import android.app.DatePickerDialog; import android.app.ProgressDialog; import android.app.TimePickerDialog; import android.content.DialogInterface; import android.os.Bundle; import android.os.Handler; import android.os.Looper; im.. 2022. 5. 9. 안드로이드에서 날짜 선택과 시간 선택 하기 activity_main.xml MainActivity.java package com.example.a05_09; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import android.app.DatePickerDialog; import android.app.TimePickerDialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.w.. 2022. 5. 9. 안드로이드에서 Alert - 팝업 창 띄우기 activity_main.xml MainActivity.java package com.example.a05_09; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import android.content.DialogInterface; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import android.widget.PopupMenu; import android.widget.Toast; public class MainActivity extends AppCompatActivity { @Ove.. 2022. 5. 9. iOS - 문법 (고차함수, 일급 객체, 클로저 등) 고차 함수 수학 및 컴퓨터 과학 에서 고차 함수 는 다음 중 하나 이상을 수행 하는 함수 입니다. 하나 이상의 함수를 인수로 취합니다(즉, 프로시저 자체가 프로시저인 프로 시저 의 매개 변수 인 프로시저 매개변수 ). 결과로 함수를 반환합니다. 다른 모든 함수는 1차 함수 입니다. 수학에서 고차 함수는 연산자 또는 함수 라고도 합니다 . 미적분학 의 미분 연산자 는 함수를 파생 함수에 매핑하기 때문에 일반적인 예 입니다. 고차 함수는 수학 전체에서 "functor"라는 단어의 다른 사용과 혼동되어서는 안 됩니다 . Functor(동음이의) 를 참조하십시오 . 형식화되지 않은 람다 미적분학 에서 모든 함수는 고차입니다. 대부분의 함수형 프로그래밍 언어가 파생 되는 형식화된 람다 미적분학 에서 하나의 함수를.. 2022. 4. 21. iOS문법 - 배열 배열 2.var number : [Int] = [] 3.//number[0]=1 //crash, 방을 만든 후 사용하라! 4.number.append(1) 5.print(number) 6.number[0]=10 7.print(number) first와 last 프로퍼티 let num = [1, 2, 3, 4] let num1 = [Int]() print(num.first, num.last)//Optional(1) Optional(4) print(num1.first, num1.last)//nil nil if let f = num.first, let l = num.last { print(f,l) //1 4 } 첨자(subscript)로 항목 접근 var num = [1, 2, 3, 4] print(num[0.. 2022. 4. 21. iOS문법 - Generic과 배열 Generic https://en.wikipedia.org/wiki/Generic_programming https://docs.swift.org/swift-book/LanguageGuide/Generics.html Generics are one of the most powerful features of Swift, and much of the Swift standard library is built with generic code. var a : [Int] = [1,2,3,4] var b : Array = [1,2,3,4] https://developer.apple.com/documentation/swift/array n Array n Generic Structure n @frozen struct Arr.. 2022. 4. 21. iOS문법 - 옵셔널 체이닝(Optional chaining) 옵셔널 체이닝(Optional chaining)의 개요 Optional chaining is a process for querying and calling properties, methods, and subscripts on an optional that might currently be nil. If the optional contains a value, the property, method, or subscript call succeeds; if the optional is nil, the property, method, or subscript call returns nil. 옵셔널 변수(메서드, subscript)가 값이 있으면 호출이 성공하고, 아니면 nil반환 Multiple queries ca.. 2022. 4. 21. iOS문법 - 구조체 구조체 : Memberwise Initializer 자동 생성 struct Resolution { //구조체 정의 var width : Int //프로퍼티 초기값이 없어요!! var height : Int } //init()메서드 없어요, 그런데! let myComputer = Resolution(width:1920,height:1080) //Memberwise Initializer print(myComputer.width) 클래스 내에 구조체 struct Resolution { var width = 1024 var height = 768 } class VideoMode { var resolution = Resolution() var frameRate = 0.0 } let myVideo = VideoMo.. 2022. 4. 21. 이전 1 2 3 4 5 다음