목록ios (580)
투케이2K
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [소스 코드] import Foundation class S_Preference { //MARK: [클래스 기본 설명] /* 1. UserDefaults 사용해 모바일 데이터 저장 클래스 2. UserDefaults : Key-Value 형태를 저장 3. UserDefaults : 앱이 종료되어도 값이 저장되지만, 앱이 삭제되면 저장된 데이터가 사라짐 4. UserDefaults : Int, Double, Float, String, Bool, Data 등 데이터 타입을 저장 실시 5. 참고 : 앱이 삭제되어도 데이터가 유지되길 원한다면 Core Data 혹은 KeyChain, NSKeyedArchiever등을 이용한 파일 형태로 ..
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [손님 : 접속하는 쪽] [주인 : 접속을 받아서 데이터 처리하는 쪽 : 프로젝트 설정 부분] [주인 : 소스코드 : SceneDelegate] import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { // 전역 변수 선언 [스키마 데이터를 전송할 컨트롤러] var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { print("") print("=======..
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [방법 설명 : LSApplicationQueriesSchemes] [소스 코드] // [외부 앱 실행 실시] /* 1. https://www.apple.com/kr/ 사이트에 접속해서 특정 앱 주소를 확인합니다 2. 크롬 앱 id 확인 : https://apps.apple.com/kr/app/google-chrome/id535886823 [id535886823 부분을 사용해서 외부앱을 실행합니다] 3. 크롬 스키마 확인 : googlechrome:// 4. 로직 : 외부앱 설치되었을 경우 >> 외부앱 실행 (스키마) / 외부앱이 설치되지 않은 경우 앱 스토어 이동 (앱 id) 5. 호출 예시 : goOutApp(_scheme..
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [소스 코드] // [외부 링크 페이지 이동 실시] // SFSafariViewController 사용 시 필요 : import SafariServices func intentWebSiteLink(_url : String){ // [http 주소를 포함한지 확인] if _url.hasPrefix("http") == true || _url.hasPrefix("https") == true { print("") print("===============================") print("[intentWebSiteLink : 웹사이트 이동 실시]") print("url : ", _url) print("===============..
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [방법 설명] [소스 코드] func requestGet() { // [URL 지정 및 파라미터 값 지정 실시] var urlComponents = URLComponents(string: "https://jsonplaceholder.typicode.com/posts?") let paramQuery_1 = URLQueryItem(name: "userId", value: "1") let paramQuery_2 = URLQueryItem(name: "id", value: "1") urlComponents?.queryItems?.append(paramQuery_1) // 파라미터 지정 urlComponents?.queryItems?...
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [방법 설명] [소스 코드] import UIKit import AVFoundation import Photos import CoreLocation import CoreBluetooth // [CLLocationManagerDelegate 추가 필요] class MainController: UIViewController, CBPeripheralManagerDelegate { // [MainController : 버튼 UI 객체 정의 실시] @IBOutlet weak var intentBtn: UIButton! override func viewDidLoad() { super.viewDidLoad() // Do any additi..
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [방법 설명] [소스 코드] import UIKit import AVFoundation import Photos import CoreLocation import CoreBluetooth // [CLLocationManagerDelegate 추가 필요] class MainController: UIViewController , CLLocationManagerDelegate { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. print("") print("============================..
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [방법 설명] [소스 코드] import UIKit import AVFoundation import Photos import CoreLocation import CoreBluetooth class MainController: UIViewController { /* MARK: - [블루투스 목록 스캔 및 블루투스 연결 수행] 1. 필요 권한 요청 [info] : - Privacy - Bluetooth Always Usage Description - Privacy - Bluetooth Peripheral Usage Description 2. 필요 import : - import CoreBluetooth - import UIKit ..
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [방법 설명] [소스 코드] import UIKit import AVFoundation import Photos class MainController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. print("") print("===============================") print("[MainController > viewDidLoad() : 뷰 로드 실시]") print("===============================") print..
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [소스 코드] import UIKit import Network class ViewController: UIViewController { @IBOutlet weak var displayText: UILabel! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. // [네트워크 연결 상태 활성 여부 체크 메소드 호출] checkNetworkStart() } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) print..
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [소스 코드] /* [요약 설명] 1. Timer.scheduledTimer : 실시간 반복 작업을 수행할 수 있습니다 2. timeInterval : 반복 주기 시간 설정 3. target: self : 현재 클래스 4. selector : 반복 작업 수행 함수 5. userInfo : 타이머 속 함수에 값 전달 6. repeats : 반복 여부 설정 */ // [전역 변수 선언 실시] var intCount = 1 // [테스트 메인 함수 정의 실시] func testMain(){ print("") print("===============================") print("[Program Start]") print(..
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [소스 코드 : AppDelegate] // // AppDelegate.swift // testUI // // Created by lotecs on 2021/10/16. // import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { print("") print("==========================..
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [해결 방법]
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [소스 코드] // [alert 팝업창 호출 메소드 정의 실시 : 이벤트 호출 시] // 호출 방법 : showAlert(tittle: "title", content: "content", okBtb: "확인", noBtn: "취소") func showAlert(tittle:String, content:String, okBtb:String, noBtn:String) { // [UIAlertController 객체 정의 실시] let alert = UIAlertController(title: tittle, message: content, preferredStyle: UIAlertController.Style.alert) // [인풋으..
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [방법 설명] [소스 코드 : Main] // // MainController.swift // testUI // // Created by lotecs on 2021/10/16. // import UIKit class MainController: UIViewController { // [MainController : 버튼 UI 객체 정의 실시] @IBOutlet weak var intentBtn: UIButton! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. print(..
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [방법 설명] [소스 코드] func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. // [스레드 시간을 발생시켜 로딩화면 지연 실시 - 3초] Thread.sleep(forTimeInterval: 3.0) return true }
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [방법 설명]
[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [구조 설명]
/* =========================== */ [ 설 명 ] 1. ios 앱 스토어 앱 id 를 확인할 수 있습니다 2. aos 구글 플레이스토어 앱 패키지명을 확인할 수 있습니다 /* =========================== */ /* =========================== */ [방법 설명] 1. ios 앱 스토어 공식 사이트 접속 https://www.apple.com/app-store/ >> 찾으려는 앱 을 검색 >> id 값을 확인합니다 App Store The App Store gives people around the world a safe and trusted place to discover apps that meet our high stand..
/* =========================== */ [ 개발 환경 설정 ] 개발 툴 : Edit++ 개발 언어 : javascript /* =========================== */ /* =========================== */ [자바스크립트 소스 코드] [안드로이드 소스 코드] //TODO [새로운 URL이 webview에 로드되려 할 경우 컨트롤을 대신할 기회를 줌] @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { Log.d("---","---"); Log.w("//===========//","======================================..