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
| // | |
| // JSONMapper.swift | |
| // PitukuWM | |
| // | |
| // Created by Azam Mukhtar on 12/12/23. | |
| // | |
| import Foundation | |
| import OSLog |
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 OSLog | |
| import SwiftUI | |
| final class HTTPClient: ObservableObject { | |
| private let logger = Logger(subsystem: "com.HTTPClient", category: "HTTPClient") | |
| private let session: URLSession |
This file has been truncated, but you can view the full file.
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
| PhaseScriptExecution Multiplatform\ Build /Users/jawasoft/Library/Developer/Xcode/DerivedData/FDManager-evdaaakoxjwwlberzguzentcxrnd/Build/Intermediates.noindex/ArchiveIntermediates/Framework/IntermediateBuildFilesPath/JawaForm.build/Release-iphoneos/Framework.build/Script-80BD5CE01A6F887400478D2A.sh (in target 'Framework' from project 'JawaForm') | |
| cd /Users/jawasoft/Documents/Work/FDManager/JawaForm | |
| export ACTION\=install | |
| export AD_HOC_CODE_SIGNING_ALLOWED\=NO | |
| export ALLOW_TARGET_PLATFORM_SPECIALIZATION\=NO | |
| export ALTERNATE_GROUP\=staff | |
| export ALTERNATE_MODE\=u+w,go-w,a+rX | |
| export ALTERNATE_OWNER\=jawasoft | |
| export ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES\=YES | |
| export ALWAYS_SEARCH_USER_PATHS\=NO |
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 XCTest | |
| @testable import Catastrophic | |
| class CatViewModelTests: XCTestCase { | |
| func test_load_viewModelGetAllData() { | |
| let cats = [anyCat(id: 123), anyCat(id: 34), anyCat(id: 34)] | |
| let sut = makeSUT(with: cats) | |
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
| extension ItemWebsiteTableViewCell: UITextFieldDelegate { | |
| func textField(_ textField: UITextField, | |
| shouldChangeCharactersIn range: NSRange, | |
| replacementString string: String) -> Bool { | |
| if !textField.text.isFilled, | |
| !string.hasPrefix("https://"), | |
| !string.hasPrefix("http://") | |
| { |
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
| // | |
| // MLKitTextRecognizerTests.swift | |
| // SimpleMathCamTests | |
| // | |
| // Created by Azam Mukhtar on 10/03/23. | |
| // | |
| import XCTest | |
| @testable import SimpleMathCam |
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
| /* | |
| I Just, realize we cannot use the content ID for embed video id | |
| https://rumble.com/v2c4m5a-pre-fight-press-conference-power-slap-1-finale.html <- the ID {v2c4m5a} | |
| We cannot simply make the embed URL with that ID because the Embed video URL is using different ID, | |
| here is the embed Video URL for that html content : https://rumble.com/embed/v29j6ea <- the embed ID {v29j6ea} | |
| See there is different id there. | |
| So we need to request/download the page/web with URL session in order to get the embed id from the HTML response. |
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 UIKit | |
| struct Feed { | |
| let id: String | |
| } | |
| protocol FeedLoader { | |
| func getFeedData(completion: (Swift.Result<Feed, Error>) -> Void) | |
| } |
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
| // Pembuatan URL dipindah menjadi parameter. | |
| func getGhibliMovieList(url: URL, completion: @escaping (Swift.Result<[RemoteMovie], Error>) -> Void) { | |
| // Membuat URLSession | |
| URLSession.shared.dataTask(with: url) { [weak self] (data, response, error) in | |
| guard self != nil else { return } | |
| DispatchQueue.main.sync { // Dispatch ke Main Thread | |
| if let data = data, | |
| let response = response as? HTTPURLResponse, | |
| response.statusCode == 200 { // Handling response status code | |
| do { |
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
| class URLSessionHTTPClient { | |
| private let session: URLSession | |
| public init(session: URLSession) { | |
| self.session = session | |
| } | |
| public func get(from url: URL, completion: @escaping (Swift.Result<(Data, HTTPURLResponse), Error>) -> Void) { | |
| session.dataTask(with: url) { data, response, error in | |
| completion(Result { |
NewerOlder