This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if uiImages.count > 1 { | |
| let swiftUIView = FullImageViewer(images: uiImages) | |
| // Wrap it in a UIHostingController | |
| let hostingController = UIHostingController(rootView: swiftUIView) | |
| // Present it | |
| hostingController.modalPresentationStyle = .fullScreen | |
| self.present(hostingController, animated: true, completion: nil) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##Escaping | |
| ------------- | |
| func getSumOf(array: [Int], handler: @escaping (Int) -> Void) { | |
| // Step 2: Move work to async queue | |
| DispatchQueue.global().async { | |
| var sum: Int = 0 | |
| for value in array { | |
| sum += value | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ###How to Delete All Cloned Simulators (Fastest Method) | |
| xcrun simctl delete unavailable | |
| ### Delete all simulator clones | |
| Delete all simulator clones | |
| ###Delete Clones from Xcode UI: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ###Clean Architecture | |
| Flow: View → ViewModel → UseCase → Repository (protocol) → RepositoryImpl → API → DTO | |
| Features | |
| └── News | |
| ├── Presentation | |
| │ ├── Views | |
| │ │ ├── NewsView.swift | |
| │ │ └── NewsListView.swift |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1) | |
| ###WithOut SSL Pinning | |
| extension NetworkManager: URLSessionDelegate { | |
| public func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { | |
| let urlCredential = URLCredential(trust: challenge.protectionSpace.serverTrust!) | |
| completionHandler(.useCredential, urlCredential) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Amazon git | |
| 1) | |
| Create New Repo for project Cd path | |
| Git remote -v (check have any old paths) | |
| rm -rf .git (if have any old paths remove) | |
| Git remote -v (check have any old paths) | |
| Git init . | |
| Git remote add origin SSHkey ( SSHKey will get from aws when click on create button and enter project name then get ssh keys and https keys) | |
| Git checkout -b dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import Combine | |
| enum HttpMethod:String { | |
| case get = "GET" | |
| case post = "POST" | |
| case put = "PUT" | |
| case delete = "DELETE" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| enum HttpMethod:String { | |
| case get = "GET" | |
| case post = "POST" | |
| case put = "PUT" | |
| case delete = "DELETE" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum APIEndPoint { | |
| static let baseURL = "" | |
| case news | |
| var url:String { | |
| switch self { | |
| case .news: return "\(APIEndPoint.baseURL)+news" | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| struct APIClient { | |
| func fetchQuestions() async throws -> [QuestionsItemData] { | |
| var components = URLComponents(string: "https://api.stackexchange.com/2.3/questions")! | |
| components.queryItems = [ | |
| .init(name: "order", value: "desc"), | |
| .init(name: "sort", value: "votes"), |
NewerOlder