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
# read document if you don't understand something :) | |
# https://github.com/yonaskolb/XcodeGen/blob/master/Docs/ProjectSpec.md | |
name: mazu | |
options: | |
minimumXcodeGenVersion: 2.10 | |
usesTabs: false | |
indentWidth: 4 | |
tabWidth: 4 | |
groupSortPosition: top |
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
/* | |
See LICENSE folder for this sample’s licensing information. | |
Abstract: | |
Contains ImageContentExtension's NotificationViewController. | |
*/ | |
import UIKit | |
import UserNotifications | |
import UserNotificationsUI |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
#define DEBUG_TRACE_LEVEL 4 | |
#ifdef DEBUG | |
#if (DEBUG_TRACE_LEVEL == 0) | |
#define HOLog(log,...) NSLog((@"[File %s] [Function %s] [Line %d]\n" log), __FILE__,__PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) | |
#elif (DEBUG_TRACE_LEVEL == 1) | |
#define HOLog(log,...) NSLog((@"\n[Function %s] [Line %d]\n" log), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) | |
#elif (DEBUG_TRACE_LEVEL == 2) | |
#define HOLog(log,...) NSLog((@"%s\n" log), __PRETTY_FUNCTION__, ##__VA_ARGS__) | |
#else |
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
http://devstreaming.apple.com/videos/wwdc/2013/710xfx3xn8197k4i9s2rvyb/710/710-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/202xdx2x47ezp1wein/202/202-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/200xdx2x35e1pxiinm/200/200-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/413xdx5x97itb5ek4yex3r7/413/413-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/612xax4xx65z1ervy5np1qb/612/612-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/221xex4xxohbllf4hblyngt/221/221-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/220xbx4xipaxfd1tggxuoib/220/220-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/711xcx4x8yuutk8sady6t9f/711/711-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/404xbx2xvp1eaaqonr8zokm/404/404-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/505xbx4xrgmhwby4oiwkrpp/505/505-HD.mov?dl=1 |
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
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { | |
if([[userInfo objectForKey:@"aps"] objectForKey:@"alert"]!=NULL){ | |
NSString *alertbody = [[userInfo objectForKey:@"aps"] objectForKey:@"alert"]; | |
application.applicationIconBadgeNumber = application.applicationIconBadgeNumber+1; | |
} | |
} |
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
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{ | |
NSString *token = [NSString stringWithFormat:@"%@", [deviceToken description]]; | |
token = [token stringByReplacingOccurrencesOfString:@"<" withString:@""];//去左箭號 | |
token = [token stringByReplacingOccurrencesOfString:@">" withString:@""];//去右鍵號 | |
token = [token stringByReplacingOccurrencesOfString:@" " withString:@""];//去空白 | |
//把拿到的deviceToken去頭去尾後 拿去註冊push | |
[self registerPushServer:self.phone_id :token ]; | |
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
//跟APNS說我要用推播 | |
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: | |
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; |
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
NSString* urlStr = @"https://maps.google.com.tw/maps?q=加油站"; | |
NSURL *url = [NSURL URLWithString:[urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; | |
NSURLRequest *request = [NSURLRequest requestWithURL:url]; | |
[self.gasWebView loadRequest:request]; |
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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
// Override point for customization after application launch. | |
// Converting RGBA color for use with UIColor | |
UIColor *colorFromRgba = [UIColor colorWithRed:23/255.0f green:45/255.0f blue:145/255.0f alpha:1]; | |
NSLog(@"converted rgba color is: %@", colorFromRgba); | |
[self.window makeKeyAndVisible]; | |