본문 바로가기

전체 글

(13)
<Swift> 아이폰 기기별 SafeArea 기기별로 테스트를 하다가 1point, 2point씩 어긋나는게 너무 눈에 걸려서 이참에 한번에 정리하려고 한다. .ignoresSafeArea(.all) .ignoresSafeArea(.container, edges: .bottom) 이런식으로 Safe Area를 ignore 하는데 기기별로 영역이 다르다. 아이폰 12, 13, 14만 다룰 예정이다. (사실 이것만 커버하기 때문에...) 좌우는 고려하지 않고, 상단과 하단만 고려한다. 아이폰 12 - iPhone 12 mini - iPhone 12 - iPhone 12 Pro - iPhone 12 Pro Max 아이폰 13 - iPhone 13 mini - iPhone 13 - iPhone 13 Pro - iPhone 13 Pro Max 아이폰 14 ..
<Flutter> Command PhaseScriptExecution failed with a nonzero exit code 오류 해결 Xcode 버전을 14.3으로 업데이트하고 앱을 배포하려고 아카이빙을 하다 계속해서 Command PhaseScriptExecution failed with a nonzero exit code 이 오류가 나와서 실패를 하는데 자세히 보니 그 아래에 다음과 같은 메시지가 있어 열어봤는데 IntermediateBuildFilesPath/UninstalledProducts/iphoneos/FMDB.framework" failed: No such file or directory (2) while archiving flutter app 이러한 문구를 확인할 수 있었다. 수정 방법은 다음과 같다. Runner가 아닌 Pods에서 Targets Support Files -> Pods-Runner -> Pods-Run..
<Flutter> Flutter와 Unity 연결하는 방법 Flutter와 Unity를 연결하는 방법은 알고나면 생각보다 간단하다. 다만 생각보다 수정해야 하는 부분이 많다... 우선 이 패키지를 사용한다 https://pub.dev/packages/flutter_unity_widget flutter_unity_widget | Flutter Package Flutter Unity 3D widget for embedding Unity game scenes in flutter. This library now supports Unity as a Library. pub.dev flutter pub add flutter_unity_widget 그 다음, 다음 링크에서 https://github.com/juicycleff/flutter-unity-view-widget/tr..
<Flutter> Flutter 상에서 3D 이미지 띄우기 Flutter에서 3D 이미지를 띄우는 방법을 찾고 찾다 방법을 찾아 기록한다. 먼저 .obj 파일만을 지원하고, .fbx 파일은 지원을 하지 않는다... .fbx 파일도 지원을 하면 좋겠지만 ㅠ 방법은 https://pub.dev/packages/flutter_cube에 있었다. import 'package:flutter_cube/flutter_cube.dart'; ... ... @override Widget build(BuildContext context) { return Scaffold( body: Center( child: Cube( onSceneCreated: (Scene scene) { scene.world.add(Object(fileName: 'assets/cube/cube.obj')); }..
<유용한 프로그램> Ngrok 이번에 Flutter를 사용하다 백엔드를 건드릴 일이 있었는데 Ngrok을 사용해 굉장히 편했다. Ngrok이란 Public에서 Local에 접속할 수 있게 도와주는 터널링 프로그램이다. 맥 기준 사용법은 다음과 같다. 먼저 brew를 사용해 ngrok을 설치한다. brew install --cask ngrok (만약 설치가 되었는데도 파일 권한을 변경해야 한다면) ngrok이 설치되어 있는 디렉토리로 이동한 다음 chmod -R 755 ngrok 만약 설치가 잘 되었다면 Flask 기준으로 ngrok을 사용하고 싶다면, from flask_ngrok import run_with_ngrok app = Flask(__name__) 아래에 run_with_ngrok(app) 를 사용한 다음 실행하면 다음과 ..
<Flutter> iOS 에뮬레이터 CocoaPods's specs repository is too out-of-date to satisfy dependencies 에러 아이폰으로 디버깅을 돌리다 갑자기 CocoaPod's specs repository is too out-of-date to satisfy dependencies 라는 에러가 출력되어 스택오버플로우에 검색을 하다 해결 방법을 알게 되었다. Specs repository 로컬 복사본을 수동으로 삭제하고 새 버전의 Specs repository를 다시 복제를 해야한다. 먼저 프로젝트 내의 /ios 파일로 이동한다. cd /ios 그 다음 Podfile.lock 파일을 지워줘야 한다. rm Podfile.lock (선택) /ios 파일에서 cd ..로 변경하고 flutter pub get을 입력한다. cd .. flutter pub get 다시 /ios 파일로 이동해 pod install을 입력하면 된다. po..
<Flutter> 플러터 상에서 url 연결하는 방법 카카오톡 플러스 친구나 웹페이지를 url로 받아서 버튼을 눌러 url을 실행시키는 방법이다. 먼저 http://pub.dev에서 url_launcher을 검색해서 사용하면 된다. Dart packages Pub is the package manager for the Dart programming language, containing reusable libraries & packages for Flutter, AngularDart, and general Dart programs. pub.dev VS Code Terminal에 flutter pub add url_launcher를 입력하면 자동으로 최신 버전으로 변경해준다. URL를 불러오기 위해 새로운 _launchURL이라는 함수를 하나 만들었다. 이 함..
<Flutter> Dot indicator 사용 Indicator로 무엇을 사용할까 고민을 하다 dots_indicator을 보게 되었는데 너무 맘에 들었다. dots_indicator는 http://pub.dev에 dots_indicator를 검색하면 된다. .yaml 파일의 dependency에 dots_indicator: ^2.0.0를 추가하면 바로 사용 가능하다. (현재 2.0.0이 최신이지만 나중에 업데이트가 되면 바꾸면 된다) 먼저 아래에서 나오는 pageLength는 표시할 도트의 합계이고 currentIndexPage는 Highlight된 점들이다. 가장 기본적인 형식이지만 심플하다. 이를 사용하기 위한 코드는 다음과 같다. new DotsIndicator( dotsCount: pageLength, position: currentInde..