##XXAppDelegate.m, XXSomeView.m, some other object, etc##
...
[[XXSomeSingletonController sharedInstance] doThatThing];
...
##XXSomeSingletonControllerObserver.h##
@protocol XXSomeSingletonControllerObserver
##XXAppDelegate.m, XXSomeView.m, some other object, etc##
...
[[XXSomeSingletonController sharedInstance] doThatThing];
...
##XXSomeSingletonControllerObserver.h##
@protocol XXSomeSingletonControllerObserver
#!/bin/env ruby | |
deviceTypes = { | |
"iPhone 4s" => "com.apple.CoreSimulator.SimDeviceType.iPhone-4s", | |
"iPhone 5" => "com.apple.CoreSimulator.SimDeviceType.iPhone-5", | |
"iPhone 5s" => "com.apple.CoreSimulator.SimDeviceType.iPhone-5s", | |
"iPhone 6 Plus" => "com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus", | |
"iPhone 6" => "com.apple.CoreSimulator.SimDeviceType.iPhone-6", | |
"iPad 2" => "com.apple.CoreSimulator.SimDeviceType.iPad-2", | |
"iPad Retina" => "com.apple.CoreSimulator.SimDeviceType.iPad-Retina", |
- (void)openMenu:(CCMenuItem *)item; | |
{ | |
// UI KITTTTTTTTTT | |
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"DMMainMenu_iPhone" bundle:nil]; | |
UIViewController *menu = [storyboard instantiateViewControllerWithIdentifier:@"DMMainMenuNavigationController"]; | |
menu.modalPresentationStyle = UIModalPresentationFullScreen; | |
menu.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; | |
if (menu) { | |
[[CCDirector sharedDirector] presentViewController:menu animated:YES completion:^{ | |
[[CCDirector sharedDirector] pause]; |
<figure class="image"> | |
{% capture image_src %}{% if include.file %}/content/{{ page.path | remove_first:'_posts/' | split:'.' | first }}/{{ include.file }}{% else %}{{ include.url }}{% endif %}{% endcapture %} | |
<a href="{{ image_src }}"> | |
<img src="{{ image_src }}" alt="{{ include.description }}" /> | |
</a> | |
{% if include.description %} | |
<figcaption>{{ include.description }}</figcaption> | |
{% endif %} | |
</figure> |
[{ | |
"key": "P", | |
"action": "togglePreview:", | |
"modifiers": ["cmd", "ctrl"] | |
}, { | |
"key": "I", | |
"action": "toggleInfo:", | |
"modifiers": ["cmd", "shift"] | |
}, { | |
"key": "T", |
The base URL for this API is https://lambdaanimalspotter.herokuapp.com/api
Endpoint: /users/signup
import UIKit | |
class OnboardingManager { | |
private let userDefaults: UserDefaults | |
init(userDefaults: UserDefaults = .standard) { | |
self.userDefaults = userDefaults | |
} | |
func presentOnboardingControllerIfNeeded(in viewController: UIViewController) { |
import Foundation | |
protocol NetworkLoader { | |
func loadData(using request: URLRequest, with completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) | |
} | |
extension URLSession: NetworkLoader { | |
/// Asyncronously load data using a URL Request | |
/// - Parameters: | |
/// - request: an unwrapped URLRequest |