(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#import <Contacts/Contacts.h> | |
@implementation ContactsScan | |
- (void) contactScan | |
{ | |
if ([CNContactStore class]) { | |
//ios9 or later | |
CNEntityType entityType = CNEntityTypeContacts; | |
if( [CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusNotDetermined) |
UIFont: family Thonburi | |
UIFont: font Thonburi-Bold | |
UIFont: font Thonburi | |
UIFont: font Thonburi-Light | |
UIFont: family Khmer Sangam MN | |
UIFont: font KhmerSangamMN | |
UIFont: family Snell Roundhand | |
UIFont: font SnellRoundhand-Black | |
UIFont: font SnellRoundhand-Bold | |
UIFont: font SnellRoundhand |
// | |
// ImagePickerPresenter.swift | |
// | |
// | |
// Created by Bohdan Savych on 5/25/17. | |
// Copyright © 2017 perpetio. All rights reserved. | |
// | |
import UIKit |
// | |
// WorldSide.swift | |
// | |
// | |
// Created by Bohdan Savych on 5/16/17. | |
// Copyright © 2017 Bohdan Savych. All rights reserved. | |
// | |
import UIKit |
static func getAspectFillMultiplier(originalSize: CGSize, desirableSize: CGSize) -> CGFloat { | |
let heightDiff = desirableSize.height - originalSize.height | |
let widthDiff = desirableSize.width - originalSize.width | |
var multiplier: CGFloat! | |
if abs(heightDiff) > abs(widthDiff) { | |
multiplier = 1 + heightDiff / originalSize.height | |
} else { | |
multiplier = 1 + widthDiff / originalSize.width | |
} |
func addShadow(color: UIColor, fillColor: UIColor, radius: CGFloat = 3, opacity: Float = 0.5, offset: CGSize, cornerRadius: CGFloat = 0) { | |
let shadowLayer = CAShapeLayer() | |
shadowLayer.path = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).cgPath | |
shadowLayer.shadowColor = color.cgColor | |
shadowLayer.shadowPath = shadowLayer.path | |
shadowLayer.shadowOffset = offset | |
shadowLayer.shadowOpacity = opacity | |
shadowLayer.shadowRadius = radius | |
shadowLayer.masksToBounds = false | |
shadowLayer.fillColor = fillColor.cgColor |
//MARK: From https://mikeash.com/pyblog/friday-qa-2015-11-20-covariance-and-contravariance.html | |
import UIKit | |
//MARK: TYPE VARIANCE LESSON | |
//First we explore supertypes and subtypes | |
class Thing {} | |
class Vehicle: Thing {} |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// | |
// DateFormatterHelper.swift | |
// Rolique | |
// | |
// Created by Bohdan Savych on 8/18/17. | |
// Copyright © 2017 Rolique. All rights reserved. | |
// | |
import UIKit |
import UIKit | |
import RxSwift | |
import RxCocoa | |
let requiredUserNameLength = 5 | |
let requiredPasswordLength = 5 | |
let limitUserNameLength = 20 | |
class ValidationViewController: UIViewController { |