ios,swift2024. 4. 30. 10:09

[iOS] tabbar item click 막는방법

 

tabBar.items![2].isEnabled = false

Posted by thdeodls85
ios,swift2023. 6. 22. 14:05
ios,swift2023. 6. 8. 11:09

[ios]ios firebase cannot find storage 해결방법

 

Storage class가 cannot find 나온다..

 

pod update 시켯더니..

 

예전에는 

 

import Firebase 만 해줘도 됐었다..

 

import FirebaseStorage 해주면 된다.. 

Posted by thdeodls85
ios,swift2023. 5. 26. 11:09
ios,swift2023. 5. 22. 12:49

[iOS] URLSession multipart/form-data swagger 이미지 보내기

 

s3 라이브러리로 이미지를 보냈었는데, region 설정이 제대로 안되는 이슈가 발생했다..

 

예를 들어 northeast-2 로 configuration 설정을 햇는데, southeast-2 로 간다던지? 

 

그래서 방향을 바꿔 클라이언트 -> 서버 -> s3로 보내기로 했다..

 

URLSesstion 이용해서 swegger 설정한데로 보내려면 어떻게 해야 할까??

 

key -> file 이라고 설정했고

 

// 이미지 data
let data : Data = self.image.jpegData(compressionQuality: 1.0)!
        
        let url : String = "~~~~~"
        
        let urlObj = URL(string: url)
        var request = URLRequest(url: urlObj!)
        
        // header -> Content-Type , UUID -> boundaray key 
        let boundary = "Boundary_\(UUID().uuidString)"
        request.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")
        
        var httpBody = Data()
        
        // 이미지 파일 이름 
        let name = "name"
        
        let filePathKey = "file"
        
        // 중요 -> 시작과 끝 설정
        let boundaryPrefix = "--\(boundary)\r\n"
        let boundaryPrefixEnd = "--\(boundary)--\r\n"
        
        // 시작
        httpBody.append(boundaryPrefix.data(using: .utf8)!)
        
        // filePathKey -> swagger key , name -> file name
        httpBody.append("Content-Disposition: form-data;  name=\"\(filePathKey)\"; filename=\"\(name)\"\r\n".data(using: .utf8)!)
        httpBody.append("Content-Type: image/jpeg\r\n\r\n".data(using: .utf8)!)
        
        // image data
        httpBody.append(data)
        httpBody.append("\r\n".data(using: .utf8)!)
       
       	// 끝
        httpBody.append(boundaryPrefixEnd.data(using: .utf8)!)
                        
        request.httpBody = httpBody
        request.httpMethod = "POST"
        
        let task = URLSession.shared.dataTask(with: request) { (data, response, error) in
            guard let response = response as? HTTPURLResponse ,response.statusCode >= 200,response.statusCode <= 299 else
            {
                print("-> testS3APi -> end -> fail")
                return
            }
            
            print("-> testS3APi -> end -> success")
        }
        
        task.resume()
Posted by thdeodls85
ios,swift2023. 5. 19. 11:06

[iOS]Firebase/Messaging pod install ut they required a higher minimum deployment target 이슈해결방법

 

build setting -> Deployment target -> 10이상 맞춰줘야 된다고 해서 해줬는데도 안되다..

 

그러면 pod안에 보면 

 

 platform :ios, '10.0'

여기까지 10으로 맞춰줘야 가능하다.

 

 

[참조] https://velog.io/@dody_/RN-에러노트-pod-install-오류-CocoaPods-could-not-find-compatible-versions-for-pod-

 

[RN 에러노트🔥] pod install 오류 (CocoaPods could not find compatible versions for pod ...)

pod install을 하면, 아래와 같은 오류가 자주 보이기 시작했다.CocoaPods could not find compatible versions for pod 오류인데의존성과 관련된 오류 같다.각 모듈 별로 상황에 맞는 오류 해결법을 찾기 시작했다

velog.io

 

Posted by thdeodls85
ios,swift2023. 5. 18. 19:56

[ios]pod init 이후에, xcworkspace 생기지 않는 이슈 해결방법

 

pod init 하면 pod 파일이 생긴다..

 

pod 에서 라이브러리 하나 등록하고 pod install , pod update 할려고 한다..

 

그런데 

 

Unable to determine the platform for the target

 

이슈가 나온다..

 

처음에 생긴게

 

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'TestPod' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
  # Pods for TestPod

pod 'Firebase/Messaging'

  target 'TestPodTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'TestPodUITests' do
    # Pods for testing
  end

end

# platform :ios, '9.0' -> # 지우면 된다...

 

[참조] https://stackoverflow.com/questions/52040910/please-specify-a-platform-for-this-target-in-your-podfile

 

Please specify a platform for this target in your Podfile?

I want to config Firebase Firestore. I followed all the steps, but at the last step, I got the error link below I mention. After Executing this pod install command below error I got [!] Automatica...

stackoverflow.com

 

Posted by thdeodls85
ios,swift2023. 5. 2. 18:25

[Xcode]Cannot find type 'AnimationView' in scope 해결방법

 

pod update 했더니.... 예전 Lottie animationview 가 업그레이드 ...

 

LottieAnimationView 로 변경하면 된다..

 

[참조] https://github.com/airbnb/lottie-ios/issues/1891

 

Lottie 4.0.1 issue under iOS 16.2 in SwiftUI · Issue #1891 · airbnb/lottie-ios

Which Version of Lottie are you using? Lottie 4.0.1 Expected Behavior On my previous Lottie version 3.4.1, everything was fine. But now with 4.0.1 my code no longer compiles. I am using SwiftUI und...

github.com

 

Posted by thdeodls85