๐ iOS (78) ์ธ๋ค์ผํ ๋ฆฌ์คํธํ [Swift] ๊ณ ์ฐจํจ์ - map, filter, reduce ๊ณ ์ฐจํจ์? ํ๋ ์ด์์ ํจ์(ํด๋ก์ )๋ฅผ ์ธ์ ๋ก ๋ฐ๊ฑฐ๋, ํจ์(ํด๋ก์ )๋ฅผ ๋ฐํ ํ๋ ํจ์๋ก ๋ฐ๋ณต๋ฌธ์ ์ฌ์ฉํ์ฌ ๊ตฌํ์ ํ ์ ์์ง๋ง ์์๋ฅผ ์ฌ์ฉํ๋ฉด ๋์ด์ ๋ฉ๋ชจ๋ฆฌ ์์์ธก์์ ๋ ํจ์จ์ ์ผ๋ก ์ฌ์ฉํ ์ ์๋ค. ๋ํ, ๋ฐ๋ณต๋ฌธ์ผ๋ก ๊ตฌํํ๊ฒ ๋๋ฉด ๊ฐ๋ ์ฑ์ด ๋จ์ด์ง๊ณ ๋ณต์กํด์ง๊ธฐ ๋๋ฌธ์, ๊ฐ๋ ์ฑ์ ์ฌ๋ฆฌ๊ณ ํธ๋ฆฌ์ฑ์ ๋์ด๊ธฐ ์ํด์ ์ฌ์ฉ. ๊ทธ ์ค, ๋ฐฐ์ด ๋ค๋ฃฐ๋ ๊ฐ์ฅ ์ค์ํ ์ธ ๊ฐ์ง map, filter, reduce์ ๋ํด ์์๋ณด์ ๐ฅ map : ๊ธฐ์กด ๋ฐ์ดํฐ ๋ณํํ์ฌ ์๋ก์ด ์ปจํ ์ด๋๋ฅผ ๋ง๋ค ๋ ์ฌ์ฉ ์ปฌ๋ ์ ํ์ ์ ์ํ(for๋ฌธ ์ฌ์ฉ)ํ ํ์ ์์ด ๊ฐ๋จํ๊ฒ ๊ตฌํ ๊ฐ๋ฅ! // Declaration func map(transform: (T) -> U) -> Array [๊ฐ๋จ ์ฌ์ฉ์์ ] ๋ฐฐ์ด ์์ ๋ฐ์ดํฐ ํ๋ณํํ๊ธฐ var strin.. [Swift] ์ต์ ๋(Optional) ? ์ต์ ๋ ๋ฐ์ธ๋ฉํ๊ธฐ + String ๋น๊ฐ, ์ต์ ๋ ๊ตฌ๋ถ ๐ก ์ค์ํํธ์ ํน๋ณํ ๊ธฐ๋ฅ ๊ฐ์ด๋ฐ ํ๋์ธ ์ต์ ๋(Optional)์ ๋ํด ์์๋ณด์! [Contents] ์ต์ ๋ ์ด๋? ์ต์ ๋ ์ถ์ถ ๊ฐ์ ์ถ์ถ(Forced unwrapping) ์ต์ ๋ ๋ฐ์ธ๋ฉ(Optional Binding) 2.1. ์ต์ ๋ ๋ฐ์ธ๋ฉ ์ค์ฒฉ 2.2. nil ๊ฒฐํฉ ์ฐ์ฐ์ ์์์ ์ถ์ถ ์ต์ ๋(Implicitly Unwrapped Optional) ์ต์ ๋ ์ฒด์ด๋(Optional Chaining) String ๋น๊ฐ, ์ต์ ๋ ๊ตฌ๋ถ ๐ ์ต์ ๋(Optional) ์ด๋? ์ผ์ข ์ ์์ ์ฅ์น๋ก ๋ณ์ ์์ ๊ฐ์ด ์์ ์๋, ์์ ์๋(nil) ์๋ค๋ ๊ฒ์ ์ต์ ๋ ๋ณ์ ์ ์ธ ? ํค์๋ ์ฌ์ฉํ์ฌ ํํํ๋ค. ์ฆ, nil์ด ๋ ์๋ ์๋ ์ธ์คํด์ค๋ ๋ฐ๋์ ์ต์ ๋ ํ์ ์ผ๋ก ์ ์ธํด์ผ ํ๋ค. ์ฆ, ์ต์ ๋๋ก ์ ์ธ๋ ๋ณ์์๋ง! n.. [Error, Xcode] File not found /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a ๋ฌธ์ ํด๊ฒฐํ๊ธฐ [ERROR] Xcode Version 14.3 ์ผ๋ก ์ ๋ฐ์ดํธ ํ๊ณ ๋ฐ์ํ ์๋ฌ Could not build the precompiled application for the device. Error (Xcode): File not found /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation) [ โญ๏ธ ํด๊ฒฐ ๋ฐฉ๋ฒ1. - ์ฝ์ฝ์ํ ์ค์น๋์ด ์๋๊ฒฝ์ฐ] ์๋ ์ฝ๋ podfile ๋ด ์ถ๊ฐ ํ pod update ์คํ pos.. [X-code] system image ์ฌ์ฉํ๊ธฐ Xcode์์ ์ ๊ณตํ๋ ๊ธฐ๋ณธ ์์ด์ฝ ์ฌ์ฉํ๊ธฐ! ์๋์ ๊ฐ์ด ์ด๋ฏธ์ง ๋ทฐ์์ ๊ธฐ๋ณธ System ์ด๋ฏธ์ง๋ฅผ ์ฌ์ฉํ ๋, ์ด๋ค ์ด๋ฏธ์ง๋ค์ด ์๋์ง ํ์ธํ๋ ๋ฐฉ๋ฒ์ ๋๋ค. ๐ ๐ SF Symbols ์ฑ ๋ค์ดํ๊ธฐ https://developer.apple.com/sf-symbols/ SF Symbols - Apple Developer With nearly 4,500 symbols, SF Symbols is a library of iconography designed to integrate seamlessly with San Francisco, the system font for Apple platforms. developer.apple.com ์คํํ๋ฉด ์๋์ ๊ฐ์ด ์ด๋ฏธ์ง ๋ณ๋ก ์ด๋ฆ ํ์ธ ๊ฐ๋ฅ!! ๐ image view.. [X-code] ์๋ฎฌ๋ ์ดํฐ ์ผ๋ จ๋ฒํธ ๋ฆฌ์คํธ ์ ๊ฑฐ, ์์ฐ๋ ๋๋ฐ์ด์ค ์ญ์ ํ๊ธฐ ์๋ฎฌ๋ ์ดํฐ๋ฅผ ์ฌ๋ฌ๊ฐ ๋ฐ์์ ๋ฐ์ํ๋ ๋ฌธ์ ;; ์ค๋ณต์ธ ๊ฒฝ์ฐ ๊ฐ์ ๋๋ฐ์ด์ค๋ฅผ ์ผ๋ จ๋ฒํธ๋ก ๊ตฌ๋ณํ๊ธฐ ์ํด ์๋์ ๊ฐ์ด ๋ณด์ฌ์ค๋ค. ํ๋์ฉ๋ง ๋จ๊ธฐ๊ธฐ ์ํด์๋ ์ค๋ณต๋ ๋๋ฐ์ด์ค ์ญ์ ํ์! [ํด๊ฒฐ๋ฒ1. ํ์ธ๋์์ ํด๋น ์ผ๋ จ๋ฒํธ ๋๋ฐ์ด์ค ๋ ํฌ ์ญ์ ] ๊ฒฝ๋ก : ~/Library/Developer/CoreSimulator/Devices/[UDID] [ํด๊ฒฐ๋ฒ2. Xcode ์์ Simulators ์ญ์ ] Menu > Window > Devices > Simulators > Delete [Error, Xcode] ์์นด์ด๋ธ์ ๋ฐ์ํ๋ Error upon app archive: Found an unexpected Mach-O header code: 0x72613c21 ํด๊ฒฐํ๊ธฐ [์๋ฌ๋ด์ฉ] Appstore Connect์ ์ฌ๋ฆฌ๋ ๋์ค, ์๋์ ๊ฐ์ ์๋ฌ ๋ฉ์์ง๊ฐ ๋ฐ์ : Error upon app archive: Found an unexpected Mach-O header code: 0x72613c21 [ํด๊ฒฐ๋ฒ] Stackoverflow์์ ํด๋น ์ฆ์์ ์ฐพ์๋ณด๋, Dynamic / Statuc ์ ๋ฐ๋ผ ์ค์ ์ ๋ฌ๋ฆฌํด์ผํ๋ ๋ถ๋ถ์ด ์๋ ๊ฒ์ ๋ฐ๊ฒฌํ๋ค. Dynamic Framework๋ Embeded Framework์ ์ฐ๊ฒฐ์ด ๋์ด ์์ด์ผ ๋๊ณ , Static Framework์ ๊ฒฝ์ฐ Embeded Framework์ ์ฐ๊ฒฐ์ด ๋์ด ์์ผ๋ฉด ์๋๊ณ , Link Binary With Libraries์ ์ฐ๊ฒฐ์ด ๋์ด ์์ด์ผ ํ๋ค. TARGET > Embeded Frameworks ์์ Sta.. [iOS]LaunchScreen ์ค์ ํ๊ธฐ + ์ด๋ฏธ์ง ์๋จ๋ ์๋ฌ ํด๊ฒฐํ๊ธฐ ๋ฐ์น์คํฌ๋ฆฐ์ ์ฌ์ฉ๋๋ ์ด๋ฏธ์ง๋ asset ํด๋์์ ๋ชป๋ถ๋ฌ์ค๋ ํน์ดํ์ ๋ฐ๊ฒฌ ;; ๋จผ์ , LaunchScreen ์ค์ ํ๊ธฐ 1. info.plist ์ค์ 2. Targets์ App Icons and Launch Images์ Launch Screen File๋ช ์ด LaunchScreen์ธ์ง ํ์ธ. LaunchScreen ์ ์ฌ์ฉํ ์ด๋ฏธ์ง ์ธํ ์ฃผ์: LaunchScreen.storyboard์์ ์ฌ์ฉํ๋ UIImageView์ image๋ assets.xcassetsํ์ผ์์ ์ฌ์ฉํ๋ฉด ์ด๋ฏธ์ง๊ฐ ์๋์ค๋ ํ์ ๋ฐ์, "๋ฐ๋ก assetsํ์ผ ๋ฐ"์ ์ด๋ฏธ์ง ํ์ผ ์์ฑ ํ ์ฌ์ฉ Assets.xcassets ๋ฐ์ ํ์ผ ์ถ๊ฐ ๋๋๊ทธ์ค๋๋กญ + Copy items if needed ์ฒดํฌํ์ฌ ์ถ๊ฐํ ์ด๋ฏธ์ง๋ฅผ ์ฌ์ฉํด์ผํจ!!!!! [Error, Xcode] symbols for architecture armv7 ๐ฟ ์๋ฌ๋ด์ฉ file is universal (armv7 arm64) but does not contain the x86_64 architecture ๐ฟ ๋น๋ ์ค๋ฅ ์์ธ Xcode12์์ ARM๊ธฐ๋ฐ ๋งฅ(์ ํ์ค๋ฆฌ์ฝ)์ ์ง์ํจ์ ๋ฐ๋ผ ์์ดํฐ ์๋ฎฌ๋ ์ดํฐ์ ARM์ฉ ์ํคํ ์ณ arm64๊ฐ ์ถ๊ฐ๋ผ ๋ฐ์ ๐ฟ ํด๊ฒฐ๋ฐฉ๋ฒ Build Setting > Architectures > EXCLUDED_ARCHS์ arm64๋ฅผ ์ถ๊ฐ Build Setting > User-Defined > VALID_ARCHS ์ ๊ฑฐ ๐ iOS ๊ธฐ๊ธฐ ๋ณ Architecture iOS ๊ธฐ๊ธฐ๋ณ๋ก ๋ค์ํ Architecture๊ฐ ์๋ค. ํ์ฌ๊น์ง ๋์จ armv64, armv7, armv6, i386, x86_64 ๋ฅผ ๊ธฐ๊ธฐ๋ณ๋ก ์ ๋ฆฌํด๋ณธ๋ค. armv64 (์์ดํฐ.. ์ด์ 1 2 3 4 5 6 ยทยทยท 10 ๋ค์