Skip to content

Instantly share code, notes, and snippets.

View icanswiftabit's full-sized avatar
⌨️

Błażej Wdowikowski icanswiftabit

⌨️
View GitHub Profile
@icanswiftabit
icanswiftabit / iOS 6 buffer 1486
Created December 23, 2013 12:42
iOS 6 buffer 1486
2013-12-23 13:17:11:511 TravelApp[631:907] GCDAsyncUdpSocket: initWithDelegate:delegateQueue:
2013-12-23 13:17:11:511 TravelApp[631:907] GCDAsyncUdpSocket: initWithDelegate:delegateQueue:socketQueue:
2013-12-23 13:17:11:514 TravelApp[631:907] GCDAsyncUdpSocket: createSocket4:socket6:error:
2013-12-23 13:17:11:515 TravelApp[631:907] GCDAsyncUdpSocket: Creating IPv4 socket
2013-12-23 13:17:11:515 TravelApp[631:907] GCDAsyncUdpSocket: Creating IPv6 socket
2013-12-23 13:17:11:516 TravelApp[631:907] GCDAsyncUdpSocket: setupSendAndReceiveSourcesForSocket4
2013-12-23 13:17:11:516 TravelApp[631:907] GCDAsyncUdpSocket: setupSendAndReceiveSourcesForSocket6
2013-12-23 13:17:11:517 TravelApp[631:907] GCDAsyncUdpSocket: Binding socket to port(4444) interface((null))
2013-12-23 13:17:11:518 TravelApp[631:907] GCDAsyncUdpSocket: dispatch_source_cancel(send6Source)
2013-12-23 13:17:11:518 TravelApp[631:907] GCDAsyncUdpSocket: dispatch_source_cancel(receive6Source)
@icanswiftabit
icanswiftabit / iOS 7 buffer 47
Created December 23, 2013 12:43
iOS 7 buffer 47
2013-12-23 13:23:40:936 TravelApp[699:60b] GCDAsyncUdpSocket: initWithDelegate:delegateQueue:
2013-12-23 13:23:40:937 TravelApp[699:60b] GCDAsyncUdpSocket: initWithDelegate:delegateQueue:socketQueue:
2013-12-23 13:23:40:938 TravelApp[699:60b] GCDAsyncUdpSocket: createSocket4:socket6:error:
2013-12-23 13:23:40:939 TravelApp[699:60b] GCDAsyncUdpSocket: Creating IPv4 socket
2013-12-23 13:23:40:939 TravelApp[699:60b] GCDAsyncUdpSocket: Creating IPv6 socket
2013-12-23 13:23:40:940 TravelApp[699:60b] GCDAsyncUdpSocket: setupSendAndReceiveSourcesForSocket4
2013-12-23 13:23:40:940 TravelApp[699:60b] GCDAsyncUdpSocket: setupSendAndReceiveSourcesForSocket6
2013-12-23 13:23:40:941 TravelApp[699:60b] GCDAsyncUdpSocket: Binding socket to port(4444) interface((null))
2013-12-23 13:23:40:941 TravelApp[699:60b] GCDAsyncUdpSocket: dispatch_source_cancel(send6Source)
2013-12-23 13:23:40:941 TravelApp[699:60b] GCDAsyncUdpSocket: dispatch_source_cancel(receive6Source)
@icanswiftabit
icanswiftabit / iOS 6 buffer 47
Created December 23, 2013 12:47
iOS 6 buffer 47
This file has been truncated, but you can view the full file.
2013-12-23 13:26:38:330 TravelApp[752:907] GCDAsyncUdpSocket: initWithDelegate:delegateQueue:
2013-12-23 13:26:38:330 TravelApp[752:907] GCDAsyncUdpSocket: initWithDelegate:delegateQueue:socketQueue:
2013-12-23 13:26:38:333 TravelApp[752:907] GCDAsyncUdpSocket: createSocket4:socket6:error:
2013-12-23 13:26:38:334 TravelApp[752:907] GCDAsyncUdpSocket: Creating IPv4 socket
2013-12-23 13:26:38:334 TravelApp[752:907] GCDAsyncUdpSocket: Creating IPv6 socket
2013-12-23 13:26:38:335 TravelApp[752:907] GCDAsyncUdpSocket: setupSendAndReceiveSourcesForSocket4
2013-12-23 13:26:38:336 TravelApp[752:907] GCDAsyncUdpSocket: setupSendAndReceiveSourcesForSocket6
2013-12-23 13:26:38:336 TravelApp[752:907] GCDAsyncUdpSocket: Binding socket to port(4444) interface((null))
2013-12-23 13:26:38:337 TravelApp[752:907] GCDAsyncUdpSocket: dispatch_source_cancel(send6Source)
2013-12-23 13:26:38:338 TravelApp[752:907] GCDAsyncUdpSocket: dispatch_source_cancel(receive6Source)
@icanswiftabit
icanswiftabit / gist:8292245
Created January 6, 2014 23:53
second Argument type
typedef void (afterPlayingFunc)(void* clientData);
Boolean startPlaying(MediaSource& source,
afterPlayingFunc* afterFunc,
void* afterClientData);
@icanswiftabit
icanswiftabit / gist:dc3044768dd0971f8de4
Last active August 29, 2015 14:25
Solution for correct tint color in UISearchBar
searchBar.backgroundImage = UIImage()
searchBar.tintAdjustmentMode = UIViewTintAdjustmentMode.Normal
searchBar.barTintColor = Utils.tintColor() //Your desired tint color
@icanswiftabit
icanswiftabit / Equatable.swift
Last active June 29, 2016 05:39
Implementation of Equatable protocol
class Category: Object,Equatable {
dynamic var id:String = ""
dynamic var name:String = ""
override static func primaryKey() -> String? {
return "id"
}
func config(id:String,name:String){
self.id = id
  1. Create new class extending UITableViewCell with xib
  2. In ViewController register nib for this class

Example

DirectionViewCell.swift

class DirectionViewCell: UITableViewCell{

@IBOutlet var stopNameLabel: UILabel!

@icanswiftabit
icanswiftabit / Custom UIView from xib.md
Last active June 27, 2016 14:52
How to create and use reusable UIView.
  1. After creating CustomView.Swift & CustomView.xib in CustomView.xib as Class in File's Owner position set CustomView
  2. Then add func commonInit to init(frame:) and init(aCoder:) and you're ready to go.

CustomView.Swift

class CustomView : UIView {
    @IBOutlet weak private var contentView:UIView!
    // other outlets

override init(frame: CGRect) { // for using CustomView in code

@icanswiftabit
icanswiftabit / 0_reuse_code.js
Created June 29, 2016 05:37
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
1. Go to `/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources`
2. Open `IDETextKeyBindingSet.plist` in text editor or `sudo open`
3a. Text editor variant:
At end add dict
<key>Custom</key>
<dict>
<key>Duplicate Current Line</key>
<string>selectParagraph:, copy:, moveToEndOfLine:, insertParagraphSeparator:, pasteAndPreserveFormatting:, deleteBackward:, moveToBeginningOfText:</string>
<key>Delete Current Line</key>
<string>deleteParagraph:</string>