This file contains hidden or 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
override func numberOfSectionsInTableView(tableView: UITableView) -> Int | |
{ | |
if let sections = fetchedResultsController.sections | |
{ | |
return sections.count | |
} | |
return 0 | |
} | |
This file contains hidden or 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
Entitlements | |
============ | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>application-identifier</key> | |
<string>F6F792KC99.com.productlayer.prodly</string> | |
<key>aps-environment</key> |
This file contains hidden or 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
// Variant 1: looks inelegant | |
override internal func drawRect(rect: CGRect) | |
{ | |
let context = UIGraphicsGetCurrentContext() | |
let size = bounds.size | |
if let gradient = gradient | |
{ | |
let options = CGGradientDrawingOptions(kCGGradientDrawsAfterEndLocation) |
This file contains hidden or 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 Darwin | |
let π = CGFloat(M_PI) | |
let _2π = CGFloat(2.0 * π) | |
extension CGFloat | |
{ | |
func angleDeltaForShortestRotation(#toAngle: CGFloat) -> CGFloat | |
{ | |
return remainder(toAngle - self + _2π, _2π) |
This file contains hidden or 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
// | |
// UIBezierPath+Ring.swift | |
// WheelBase | |
// | |
// Created by Oliver Drobnik on 13.07.15. | |
// Copyright (c) 2015 Cocoanetics. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
This file contains hidden or 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 Darwin | |
@IBDesignable | |
class DTWheelChart: UIView { | |
@IBInspectable var days: Int = 28 | |
var shapeLayers : [CAShapeLayer]! | |
This file contains hidden or 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
PBRequester failed with Error Error Domain=NSURLErrorDomain Code=-1200 | |
"An SSL error has occurred and a secure connection to the server cannot be made." UserInfo=0x13fb6deb0 {_kCFStreamErrorCodeKey=-9824, | |
NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, | |
NSUnderlyingError=0x13c5bb6f0 "An SSL error has occurred and a secure connection to the server cannot be made.", | |
NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., | |
NSErrorFailingURLKey=https://gsp10-ssl.apple.com/use, NSErrorFailingURLStringKey=https://gsp10-ssl.apple.com/use, | |
_kCFStreamErrorDomainKey=3} |
This file contains hidden or 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
Bug in iOS 7, apparently fixed in iOS 8 | |
on 64bit iOS devices: | |
NSDecimalNumber *number = [NSDecimalNumber decimalNumberWithMantissa:10665181101155388760u exponent:0 isNegative:NO]; | |
(lldb) po number | |
10665181101155388760 | |
(lldb) po number.unsignedLongLongValue |
This file contains hidden or 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
var dict = [ | |
kABPersonAddressCityKey: "Vienna", | |
kABPersonAddressZIPKey: "1110", | |
kABPersonAddressStreetKey: "Rinnböckstrasse 48/17", | |
kABPersonAddressCountryKey: "Austria" | |
] | |
Error on line 1: "Type of expression is ambiguous without more context" | |
Error on line 2: "'_' is not convertible to 'StringLiteralConvertible' |
This file contains hidden or 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
- (void)drawRect:(CGRect)rect | |
{ | |
[super drawRect:rect]; | |
CGRect lastLineFragmentRect = CGRectZero; | |
CGFloat lastBaselineOrigin = 0; | |
CGFloat lineY = 0; | |
CGFloat lineHeight = 0; | |