Skip to content

Instantly share code, notes, and snippets.


Hu Junfeng hujunfeng

Block or report user

Report or block hujunfeng

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
hujunfeng /
Last active Nov 4, 2019
UDID, identifierForVendor and advertisingIdentifier FAQ

What's the difference between UUID, GUID and UDID?

  • UUID (Universally Unique Identifier): A sequence of 128 bits that can guarantee uniqueness across space and time, defined by [RFC 4122][rfc4122].

  • GUID (Globally Unique Identifier): Microsoft's implementation of the UUID specification; often used interchangeably with UUID.

  • UDID _(Unique Device Identifier)): A sequence of 40 hexadecimal characters that uniquely identify an iOS device (the device's Social Security Number, if you will). This value can be retrieved through iTunes, or found using UIDevice -uniqueIdentifier. Derived from hardware details like MAC address.

Is UDID deprecated?

hujunfeng / Root.plist
Last active Oct 19, 2019
Add version in Settings.bundle for iOS apps
View Root.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
hujunfeng / wwdc2019_sessions.txt
Created Jun 24, 2019
The list of WWDC 2019 sessions
View wwdc2019_sessions.txt
101 Keynote
103 Platforms State of the Union
104 Apple Design Awards
202 Using Core Data With CloudKit
203 Introducing Desktop-class Browsing on iPad
204 Introducing SwiftUI: Building Your First App
205 Introducing iPad Apps for Mac
206 Introducing SF Symbols
207 Introducing SiriKit Media Intents
208 Creating Independent Watch Apps
hujunfeng /
Last active Mar 20, 2019
About iOS 7 Status Bar Style

UIStatusBarStyle in iOS 7

  • The status bar in iOS 7 is transparent, the view behind it shows through.

  • The style of the status bar refers to the appearances of its content. In iOS 7, the status bar content is either dark (UIStatusBarStyleDefault) or light (UIStatusBarStyleLightContent). Both UIStatusBarStyleBlackTranslucent and UIStatusBarStyleBlackOpaque are deprecated in iOS 7.0. Use UIStatusBarStyleLightContent instead.

How to change UIStatusBarStyle

  • If below the status bar is a navigation bar, the status bar style will be adjusted to match the navigation bar style (UINavigationBar.barStyle):
hujunfeng / Hardware.swift
Last active Jan 9, 2019
A Swift struct to read the model names for iOS devices.
View Hardware.swift
import Darwin
/// A struct for reading device model names for iOS devices.
public struct Hardware {
public let machine: String
public init() {
machine = Hardware.getSystemInformation("hw.machine")
View wwdc2018_sessions_list.txt
101 WWDC 2018 Keynote
102 Platforms State of the Union
103 Apple Design Awards
201 Creating Apps for a Global Audience
202 What's New in Cocoa Touch
203 I Have This Idea For An App...
204 Automatic Strong Passwords and Security Code AutoFill
205 Advances in Research and Care Frameworks
206 What's New in watchOS
207 Strategies for Securing Web Content
View wwdc2017_sessions_list.txt
101 - WWDC 2017 Keynote
102 - Platforms State of the Union
201 - What's New in Cocoa Touch
202 - Advances in TVMLKit
203 - Introducing Drag and Drop
204 - Updating Your App for iOS 11
205 - What's New in watchOS
206 - Introducing Password AutoFill for Apps
207 - What's New in Cocoa
208 - Natural Language Processing and your Apps
View Reset local branch with remote banch (or force pull).fish
# Reset branch with remote branch (or force pull)
$ git fetch origin master
$ git reset --hard FETCH_HEAD
$ git clean -df
# Altering `master` to whatever branch you want to be following.
hujunfeng / Optional+SafeValue.swift
Last active Jul 8, 2016
A `safeValue` method for Optional type. It returns an empty value if the wrapped type of the Optional type has one, for example String and Array.
View Optional+SafeValue.swift
/// A type that supports an "empty value"
protocol EmptyValuable {
/// Returns the empty value of `Self`
static var emptyValue: Self { get }
extension String: EmptyValuable {
static var emptyValue: String {
return ""
hujunfeng / wwdc16_sessions_list
Last active Jun 20, 2016
WWDC16 Sessions List
View wwdc16_sessions_list
101 - Keynote
102 - Platforms State of the Union
103 - Apple Design Awards
201 - Internationalization Best Practices
202 - What's New in Accessibility
203 - What's New in Cocoa
204 - iMessage Apps and Stickers, Part 1
205 - What's New in Cocoa Touch
206 - What's New in tvOS
207 - What's New in Foundation for Swift
You can’t perform that action at this time.