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
In order for this to work, you need to import Evenkit at the top of your file. | |
Then you can add the function setiCalEvent to your file and then you can simply use <code> [self setiCalEvent:true]; </code> or <code> [self setiCalEvent:false]; </code>. You don't need yo save any data inside your app to remove them later on, because the app does a search query. | |
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
extension UIColor { | |
static func randomColor(alpha: CGFloat?) -> UIColor { | |
let red:CGFloat = CGFloat(drand48()) | |
let green:CGFloat = CGFloat(drand48()) | |
let blue:CGFloat = CGFloat(drand48()) | |
return UIColor(red: red, green: green, blue: blue, alpha: alpha ?? 1.0) | |
} | |
} |
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 | |
public extension UIDevice { | |
public enum Model { | |
case iPodTouch5, iPodTouch6, iPhone4, iPhone4s, iPhone5, iPhone5c, iPhone5s, iPhone6, iPhone6Plus, iPhone6s, iPhone6sPlus, iPhoneSE, iPad2, iPad3, iPad4, iPadAir, iPadAir2, iPadMini, iPadMini2, iPadMini3, iPadMini4, iPadPro, AppleTV, Simulator, None | |
} | |
static var model: Model { | |
var systemInfo = utsname() |
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
self.resultSearchController = ({ | |
let controller = UISearchController(searchResultsController: nil) | |
controller.searchResultsUpdater = self | |
controller.dimsBackgroundDuringPresentation = false | |
controller.hidesNavigationBarDuringPresentation = false | |
controller.searchBar.barStyle = .Black | |
controller.searchBar.sizeToFit() | |
self.tableView.tableHeaderView = controller.searchBar | |
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
// | |
// TypingLabel.swift | |
// | |
// Created by Samuel Beek on 09/12/15. | |
// Copyright © 2015 Samuel Beek. All rights reserved. | |
// | |
import UIKit | |
import SwiftyTimer |
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 application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
UINavigationBar.appearance().tintColor = UIColor.whiteColor() | |
UINavigationBar.appearance().barStyle = UIBarStyle.Black | |
// rest of the didFinishLaunch stuff | |
} |
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
// src: http://stackoverflow.com/questions/31651983/swift-how-to-remove-border-from-segmented-control | |
import UIKit | |
extension UISegmentedControl { | |
func removeBorders() { | |
setBackgroundImage(imageWithColor(backgroundColor!), forState: .Normal, barMetrics: .Default) | |
setBackgroundImage(imageWithColor(tintColor!), forState: .Selected, barMetrics: .Default) | |
setDividerImage(imageWithColor(UIColor.clearColor()), forLeftSegmentState: .Normal, rightSegmentState: .Normal, barMetrics: .Default) | |
} |
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
// | |
// DeviceHelpers.swift | |
// | |
// Created by Samuel Beek on 08/10/15. | |
// Copyright © 2015 Samue Beek. All rights reserved. | |
// | |
import UIKit | |
struct Devices { | |
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
struct Uploader { | |
static let baseUrl = "YOUR API URL" | |
static func multipartBody(filePathKey: String, imageDataKey: NSData, boundary: String) -> NSData { | |
let body = NSMutableData(); | |
let filename = "user-profile.jpg" | |
let mimetype = "image/jpg" | |
body.appendString("--\(boundary)\r\n") |