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
func appendToPath(path: CGMutablePath) | |
{ | |
let textPath = CGPathCreateMutable() | |
let attributedString = NSAttributedString(string: string) | |
let line = CTLineCreateWithAttributedString(attributedString) | |
// direct cast to typed array fails for some reason | |
let runs = (CTLineGetGlyphRuns(line) as [AnyObject]) as! [CTRun] |
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
Please help complete and sort this list. These are the icons visible in the WWDC 2012 Banner. Roughly sorted by size. | |
http://www.cocoanetics.com/files/WWDC2012_Banner.png | |
alternate, high res pictures of the Banner: | |
http://cdn.macrumors.com/article-new/2012/06/photo.jpg | |
Path - http://itunes.apple.com/us/app/path/id403639508?mt=8 | |
Star Walk - http://itunes.apple.com/app/star-walk-guide-dastronomie/id295430577?mt=8 | |
Instagram - http://itunes.apple.com/us/app/instagram/id389801252?mt=8 |
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
@objc protocol Refreshable | |
{ | |
/// The refresh control | |
var refreshControl: UIRefreshControl? { get set } | |
/// The table view | |
var tableView: UITableView! { get set } | |
/// the function to call when the user pulls down to refresh | |
@objc func handleRefresh(_ sender: Any); |
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 Foundation | |
import Combine | |
import ProoficsSDK | |
import SwiftUI | |
class BundleViewModel: ObservableObject | |
{ | |
@Published var title: String = "" | |
@Published var subtitle: String? |
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 SwiftUI | |
struct Modifier: Identifiable | |
{ | |
let id = UUID() | |
@State var title: String | |
} | |
struct FastnotesSettings: View |
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 SwiftUI | |
struct Platform: OptionSet | |
{ | |
let rawValue: Int | |
static let iOS = Platform(rawValue: 1<<0) | |
static let tvOS = Platform(rawValue: 1<<1) | |
static let watchOS = Platform(rawValue: 1<<2) | |
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 SwiftUI | |
struct RegularEventCell: View { | |
let color: Color | |
let title: String | |
let description: String? | |
var body: some View { |
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
- (void)addShadowWithColor:(UIColor *)color alpha:(CGFloat)alpha radius:(CGFloat)radius offset:(CGSize)offset | |
{ | |
self.layer.shadowOpacity = alpha; | |
self.layer.shadowRadius = radius; | |
self.layer.shadowOffset = offset; | |
if (color) | |
{ | |
self.layer.shadowColor = [color CGColor]; | |
} |
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
+ (CAKeyframeAnimation *)jumpAnimation | |
{ | |
// these three values are subject to experimentation | |
CGFloat initialMomentum = 150.0f; // positive is upwards, per sec | |
CGFloat gravityConstant = 250.0f; // downwards pull per sec | |
CGFloat dampeningFactorPerBounce = 0.6; // percent of rebound | |
// internal values for the calculation | |
CGFloat momentum = initialMomentum; // momentum starts with initial value | |
CGFloat positionOffset = 0; // we begin at the original position |
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
- (void)drawTextInRect:(CGRect)rect | |
{ | |
[super drawTextInRect:rect]; | |
CGContextRef ctx = UIGraphicsGetCurrentContext(); | |
NSString *fontName = self.font.fontName; | |
CGFloat fontSize = self.font.pointSize; | |
CTFontRef font = CTFontCreateWithName((__bridge CFStringRef)fontName, fontSize, NULL); |