Skip to content

Instantly share code, notes, and snippets.

View KelvinJin's full-sized avatar
🎯
Focusing

Jin Wang KelvinJin

🎯
Focusing
  • Uthoft
  • Melbourne
View GitHub Profile

###Note Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

[UPDATE : Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.]

[UPDATE 2:The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead]

##[UPDATE 3: For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached]

@KelvinJin
KelvinJin / AttributedHTMLFont.swift
Created October 18, 2017 04:31 — forked from chrislonge/AttributedHTMLFont.swift
Attributed HTML With Custom Font Parsing (Playground)
import UIKit
import XCPlayground
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
let containerView = UIView(frame: CGRect(x: 0.0, y: 0.0, width: 375.0, height: 667.0))
containerView.backgroundColor = UIColor.whiteColor()
XCPlaygroundPage.currentPage.liveView = containerView
var aboutTextView = UITextView(frame: CGRect(x: 12.0, y: 20.0, width: containerView.frame.size.width - 12.0, height: 200.0))
aboutTextView.textAlignment = .Left