Skip to content

Instantly share code, notes, and snippets.

View richimf's full-sized avatar
:octocat:
Coding...

Ricardo Montesinos richimf

:octocat:
Coding...
View GitHub Profile
@richimf
richimf / Load_ViewController_from_AppDelegate.swift
Last active August 13, 2020 15:06
Using Storyboard programmatically as main storyboard
/**
AppDelegate.swift
In Project settings set the "Main Interface" text field to empty.
With the Interface Builder implementation,
the app launches the initial view controller of the storyboard set in the target’s Main Interface.
To do something similar in code, you need to take a different approach.
Open AppDelegate.swift and replace the code inside application(_:didFinishLaunchingWithOptions:) with the following:”
@richimf
richimf / propWrapper.swift
Created August 2, 2020 23:28
Property Wrapper
@propertyWrapper struct WhiteSpacesTrimmed {
var projectedValue: String
var wrappedValue: String {
didSet {
self.projectedValue = wrappedValue
wrappedValue = wrappedValue.trimmingCharacters(in: .whitespaces)
}
}
@richimf
richimf / NavigationStack_AppDelegate_SceneDelegate.swift
Created August 13, 2020 15:16
Add navigation Stack programatically Swift
// APPDELEGATE:
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
window?.makeKeyAndVisible()
@richimf
richimf / Github_action.yml
Last active January 29, 2021 18:25
Pull Request format regex
# '^(?:\[IMPROVEMENT\]|\[FEATURE\]|\[BUGFIX\])\[([A-Z])+\-(\d+)\]\s(\w){1,}(\w|\s|\-){1,}$'
# Github action for Jira ticket verification
name: JIRA Validation
on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']
jobs: