This file contains 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 the iOS-specific Fastlane configuration | |
import("../ios/fastlane/ios_fastfile") | |
# Shared lanes for version management and release notes generation | |
lane :get_version_from_tag do |options| | |
# Ensure required environment variables are present | |
ensure_env_vars( | |
env_vars: ['GIT_TAG'] | |
) | |
This file contains 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 wikiquotes | |
print("Hola Santi") | |
edad_santi = 30 | |
edad_fran = 30 | |
edad_santi_texto = "30" | |
edadSanti = 30 | |
asdsadjasjdj = 30 |
This file contains 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
private var AssociatedKey: UInt = 0 | |
private final class AssociatedObjectBox<T> { | |
let value: T | |
init(_ x: T) { | |
value = x | |
} | |
} |
This file contains 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
DEFAULT_SIMULATORS = ['iPhone 5s', 'iPhone 8', 'iPhone X', 'iPhone Xʀ'] | |
PROJECT_PATH = # Project path. | |
SCHEME = ... # (Your scheme) | |
CONFIGURATION = ... # (usually Debug or Release) | |
APP_ID = # Your app id. i.e: com.company.app | |
APP_NAME = # The output name of your app. | |
platform :ios do |
This file contains 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
// Just playing with this pointfreeco sample | |
// https://github.com/pointfreeco/episode-code-samples/blob/main/0114-designing-dependencies-pt5/DesigningDependencies/WeatherClient/Sources/WeatherClient/Mocks.swift | |
extension WeatherClient { | |
static func faked( | |
response: Result<[WeatherResponse.ConsolidatedWeather], Error>, | |
locations: Result<[Location], Error>) -> WeatherClient { | |
return Self( | |
weather: { _ in |
This file contains 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
// Adapted from https://www.avanderlee.com/swift/memory-leaks-unit-tests/ | |
// --------------> Usage <------------------- | |
XCTAssertDeallocation(of: { | |
MyViewController(...) | |
}) | |
// With some setup: | |
XCTAssertDeallocation(of: { () -> MyViewController in | |
let myViewController = MyViewController(...) |
This file contains 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 | |
protocol UserProvider { | |
func logIn(onSuccess: (User) -> (), onFailure: (Error) -> ()) | |
} | |
protocol UserRepositoryProtocol { | |
} |
This file contains 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 | |
let jsonString: String = """ | |
{ "action": {"dynamicKey": [{"active": false}]}, | |
"schedule": "00 09 * * 1,2,3,4,5", | |
"tz": "America.Chicago"} | |
""" | |
let jsonData = jsonString.data(using: .utf8)! | |
struct Action { |
This file contains 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
public protocol PaginationServiceType { | |
associatedtype Element | |
init(elementProvider: (page: Int, numberOfElements: Int) -> SignalProducer<[Element], NoError>) | |
func fetchNextPage(numberOfElements: Int) -> SignalProducer<[Element], NoError> | |
} |
This file contains 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
function* watchTokenExpire() { | |
let action = yield take(UPDATE_TOKEN_EXPIRE); | |
while (true) { | |
if (action.payload.shouldRefresh) { | |
yield fetchNewTokenOrLogout(); | |
} else { | |
const expireInMs = (action.payload.expireIn * 1000) - MIN_TOKEN_LIFESPAN; | |
const raceResult = yield race({ | |
action: take(UPDATE_TOKEN_EXPIRE), | |
timeout: delay(expireInMs), |
NewerOlder