Simple visual illustrations of how CGRectDivideWithPadding works.
+-------+---------+------------>
e | | |
d | slice | padding | remainder…
g | | |
e | | |
| // Defines a yet undocumented method to add a warning if super isn't called. | |
| #ifndef NS_REQUIRES_SUPER | |
| #if __has_attribute(objc_requires_super) | |
| #define NS_REQUIRES_SUPER __attribute((objc_requires_super)) | |
| #else | |
| #define NS_REQUIRES_SUPER | |
| #endif | |
| #endif |
| // Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
| // Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // Licensed under MIT (http://opensource.org/licenses/MIT) | |
| // | |
| // You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
| // PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> |
| // 1. | |
| // “Safe” but retain cycle. | |
| [self setCompletionBlock:^{ | |
| NSLog(@"1: %@", self->_foo); | |
| }]; | |
| // 2. | |
| // Unsafe. Could dereference nil. | |
| __weak BCThing *weakSelf = self; |
| /* CGSPrivate.h -- Header file for undocumented CoreGraphics stuff. */ | |
| /* This file is a relicensed portion of DesktopManager and was originally released under | |
| * the terms of the GNU General Public Licence. Original licence text follows the new terms. | |
| * The contents of this file has been re-released by the original author under the following terms: | |
| * | |
| * Copyright (C) 2003, 2004, 2013 Richard J Wareham <richwareham@users.sourceforge.net> | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
| * software and associated documentation files (the "Software"), to deal in the Software |
| @interface RACSocketReader : NSObject | |
| // Sends a RACSignal whenever there's new data ready to be read. Each signal | |
| // will send an NSData upon subscription. | |
| // | |
| // If you only want the NSData objects as fast as possible, simply -concat | |
| // this signal to get a eager signal of NSData values. | |
| @property (nonatomic, strong, readonly) RACSignal *signalOfDataSignals; | |
| - (id)initWithSocketDescriptor:(int)fildes; |
| Copyright (c) 2013 Jamz Tang <[email protected]> | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is furnished | |
| to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in all |
| // Property Nonatomic Strong | |
| // Platform: All | |
| // Completion Scopes: ClassInterfaceMethods | |
| @property (nonatomic, strong) <# class_name #> *<# variable_name #>; |
| // | |
| // FGOManagedObjectContextStack.h | |
| // | |
| // Created by Indragie Karunaratne on 2012-12-23. | |
| // Copyright (c) 2012 Indragie Karunaratne. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> | |
| @interface FGOManagedObjectContextStack : NSObject |
Simple visual illustrations of how CGRectDivideWithPadding works.
+-------+---------+------------>
e | | |
d | slice | padding | remainder…
g | | |
e | | |
| self.startButton.rac_command = [RACCommand command]; | |
| self.stopButton.rac_command = [RACCommand command]; | |
| __unsafe_unretained id weakSelf = self; | |
| id<RACSignal> tick = [[[[self.startButton.rac_command | |
| map:^(id _) { | |
| RTAFirstView *strongSelf = weakSelf; | |
| // Map each start button click to a new signal that fires every second | |
| // and stops when the stop button is clicked. | |
| return [[RACSignal interval:1] takeUntil:strongSelf.stopButton.rac_command]; |