This file contains hidden or 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
extension String | |
{ | |
var length: Int { | |
get { | |
return count(self) | |
} | |
} | |
func contains(s: String) -> Bool | |
{ |
This file contains hidden or 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 | |
extension String | |
{ | |
var length: Int { | |
get { | |
return self.characters.count | |
} | |
} | |
This file contains hidden or 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
class PushNotificationManager { | |
class var isPushNotificationEnable: Bool { | |
let osVersion = UIDevice.currentDevice().systemVersion | |
if osVersion < "8.0" { | |
let types = UIApplication.sharedApplication().enabledRemoteNotificationTypes() | |
if types == UIRemoteNotificationType.None { | |
// push notification disabled | |
return false | |
}else{ | |
// push notification enable |
This file contains hidden or 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 | |
extension NSObject { | |
var isPublicClass: Bool { | |
return self.dynamicType.isPublicClass | |
} | |
class var isPublicClass: Bool { | |
return _PUBLIC_IOS_CLASSES.contains(NSStringFromClass(self)) | |
} |