#Notes on Golang
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
source 'https://github.com/CocoaPods/Specs.git' | |
# optionally complete and uncomment if compilation issues arise | |
# project '<path to project relative to this Podfile>/<name of project without extension>' | |
# workspace 'MyPubNubProject' | |
target 'application-target-name' do | |
# Should only use this with projects | |
# that must have a minimum deployment | |
# target of iOS 7 |
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
source 'https://github.com/CocoaPods/Specs.git' | |
# optionally complete and uncomment if compilation issues arise | |
# project '<path to project relative to this Podfile>/<name of project without extension>' | |
# workspace 'MyPubNubProject' | |
use_frameworks! | |
target 'application-target-name' do | |
# Can only support iOS 8 or higher with frameworks, |
- NSOperation in Swift
- Another example
- I like this post
- With UICollectionView
- NSFetchedResultsController tip
This is a collection of notes from the Text Programming Guide for iOS
Handling keyboard notifications in a scrollview:
// Call this method somewhere in your view controller setup code.
- (void)registerForKeyboardNotifications
{
[[NSNotificationCenter defaultCenter] addObserver:self
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
// Inspired by http://stackoverflow.com/questions/25724527/swift-test-class-type-in-switch-statement | |
for thing in things { | |
switch thing { | |
case 0 as Int: | |
println("zero as an Int") | |
case 0 as Double: | |
println("zero as a Double") | |
case let someInt as Int: | |
println("an integer value of \(someInt)") |
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
// Make sure to include this at the top of AppDelegate.m | |
@import UserNotifications; | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
// Override point for customization after application launch. | |
// Check Notification Settings on launch | |
[[UNUserNotificationCenter currentNotificationCenter] getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) { | |
switch (settings.authorizationStatus) { | |
// This means we have not yet asked for notification permissions | |
case UNAuthorizationStatusNotDetermined: |
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 UIKit | |
import PubNub | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var client: PubNub? | |
var window: UIWindow? | |
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { |