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 | |
func threadNumberForThread() -> String { | |
let array1 = Thread.current.description.components(separatedBy: ">") | |
if array1.count > 1 { | |
let array2 = array1[1].trimmingCharacters(in: CharacterSet(charactersIn: "{}")).components(separatedBy: ",") | |
for pair in array2 { | |
let array3 = pair.components(separatedBy: "=") | |
if array3.count > 1 { | |
if array3[0].contains("number") { |
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
/* | |
UISlider controls can be rotated to a vertical orientation with this setting: | |
layer.transform.rotation.z = 1.570795 (type = String) | |
in IB under User Defined Runtime Attibutes for the UISlider. | |
However, this makes it visually obvious that iOS does not draw the thumb image | |
over the center of the slider track, it is actually offset 1 point up (when horizontal). |
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
/* | |
This modification extends Erica Sadun's ABContactsHelper.m | |
https://github.com/erica/ABContactHelper | |
Feedback and performance suggestions welcome! | |
Edit 1/29/13: refactor to avoid calling ABPersonCopyArrayOfAllLinkedPeople() multiple times for same person. | |
Testing shows 5% performance improvement (811 total records = 249 unlinked + 562 linked), | |
3 run average, looping through code 10 times each run, in simulator. |