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
View random.swift
import Darwin
extension Int {
static func random() -> Int {
return Int(arc4random_uniform(UInt32(Int.max)))
}
static func random(range: Range<Int>) -> Int {
return Int(arc4random_uniform(UInt32(range.endIndex - range.startIndex))) + range.startIndex
}
View UIDeviceHardware.h
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
+ (NSString *)platform;
You can’t perform that action at this time.