thanks 4 putting source for a noob to learn a little
-
DocSets-for-iOS and paid 4 it too https://github.com/omz/DocSets-for-iOS/
-
Real Time Congress
mr Marathi | |
bs Bosnian | |
ee_TG Ewe (Togo) | |
ms Malay | |
kam_KE Kamba (Kenya) | |
mt Maltese | |
ha Hausa | |
es_HN Spanish (Honduras) | |
ml_IN Malayalam (India) | |
ro_MD Romanian (Moldova) |
thanks 4 putting source for a noob to learn a little
DocSets-for-iOS and paid 4 it too https://github.com/omz/DocSets-for-iOS/
Real Time Congress
post_install do | installer | | |
print "Updating #{installer.sandbox.target_support_files_root}/Pods/Pods-environment.h\n" | |
open("#{installer.sandbox.target_support_files_root}/Pods/Pods-environment.h","a") do |file| | |
file.puts <<EOF | |
// Disable logs | |
#ifndef DEBUG | |
#define NSLog(...) | |
#endif | |
EOF | |
end |
In this article, I'm going to explore a way that we can create views that implement custom Core Animation property animations in a natural way.
As we know, layers in iOS come in two flavours: Backing layers and hosted layers. The only difference between them is that the view acts as the layer delegate for its backing layer, but not for any hosted sublayers.
In order to implement the UIView
transactional animation blocks, UIView
disables all animations by default and then re-enables them individually as required. It does this using the actionForLayer:forKey:
method.
Somewhat strangely, UIView
doesn't enable animations for every property that CALayer
does by default. A notable example is the layer.contents
property, which is animatable by default for a hosted layer, but cannot be animated using a UIView
animation block.
- (UIInterfaceOrientation)orientationByTransforming:(CGAffineTransform)transform fromOrientation:(UIInterfaceOrientation)c | |
{ | |
CGFloat angle = atan2f(transform.b, transform.a); | |
NSInteger multiplier = (NSInteger)roundf(angle / M_PI_2); | |
UIInterfaceOrientation orientation = self.interfaceOrientation; | |
if (multiplier < 0) { | |
// clockwise rotation | |
while (multiplier++ < 0) { | |
switch (orientation) { |
- (UIInterfaceOrientation)relativeInterfaceOrientationFromRotationAngle:(CGFloat)angle { | |
NSArray * conversionMatrix = @[ @(UIInterfaceOrientationPortrait), | |
@(UIInterfaceOrientationLandscapeRight), | |
@(UIInterfaceOrientationPortraitUpsideDown), | |
@(UIInterfaceOrientationMaskLandscapeLeft)]; | |
NSInteger oldIndex = [conversionMatrix indexOfObject:@(self.interfaceOrientation)]; | |
if (oldIndex == NSNotFound) | |
return UIInterfaceOrientationUnknown; | |
NSInteger newIndex = (oldIndex - (NSInteger)roundf(angle / M_PI_2)) % 4; |
Here's my own list of the interesting stuff announced during this year's WWDC, collected from the keynotes, various Apple docs, blog posts and tweets.
If you're planning to watch the videos, I really recommend this Mac app that helps you download and watch them: https://github.com/insidegui/WWDC.
http://www.apple.com/osx/elcapitan-preview/
import CoreData | |
protocol Fetchable | |
{ | |
typealias FetchableType: NSManagedObject | |
static func entityName() -> String | |
static func objectsInContext(context: NSManagedObjectContext, predicate: NSPredicate?, sortedBy: String?, ascending: Bool) throws -> [FetchableType] | |
static func singleObjectInContext(context: NSManagedObjectContext, predicate: NSPredicate?, sortedBy: String?, ascending: Bool) throws -> FetchableType? | |
static func objectCountInContext(context: NSManagedObjectContext, predicate: NSPredicate?) -> Int |