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
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
buildNumber=$(($buildNumber + 1)) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}" |
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
class func loadMessage() { | |
let managerQuery = UserModel.query()! | |
let userRole = PFRole(withoutDataWithObjectId: "lEGrVrXO0a") // 角色:球場管理 | |
managerQuery.whereKey("userRole", equalTo: userRole) | |
let caddy = UserModel.current()! | |
let courseID = caddy.course! | |
managerQuery.whereKey("course", equalTo: courseID) | |
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
let queue = DispatchQueue(label: "labelName", qos: .userInteractive, attributes: .concurrent) |
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
NSArray *a = @[@"First",@"Second",@"Third"]; | |
NSMutableArray *a2 = [[NSMutableArray alloc]initWithObjects:@"First",@"Second",@"Third",nil]; | |
[a2 addObject:@"Fourth"]; |
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)password:(NSString *)string { | |
if ([self checkFormat:string withPattern:@"^([a-zA-Z]+\\d+|\\d+[a-zA-Z]+)[a-zA-Z0-9]*$" matchingOptions:NSRegularExpressionCaseInsensitive]) { | |
if (string.length >= 6 && string.length <= 12) { | |
for (NSInteger l = 0 ; l < string.length - 2 ; l++ ) { | |
NSString *subString = [string substringWithRange:NSMakeRange(l, 3)]; | |
// 檢查數字 | |
for (NSInteger i = 0 ; i <= 9 ; i++ ) { | |
if ([subString isEqualToString:[NSString stringWithFormat:@"%ld%ld%ld", i, i, i]]) { // 不可連續三個重複的數字 |
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
#import "CCardTableViewCell.h" | |
@implementation CCardTableViewCell | |
- (UIView *)card | |
{ | |
if (!_card) { | |
_card = [[UIView alloc] init]; | |
} | |
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
else if (indexPath.section == 1) { | |
ZeroTableViewCell *cell2 = [tableView dequeueReusableCellWithIdentifier:@"Cell2" forIndexPath:indexPath]; | |
cell2.text.text = setting[indexPath.section][indexPath.row]; | |
cell2.detailText.text = zero[[userPreferences integerForKey:@"計時器歸零"]]; | |
cell2.detailTextLabel.font = [UIFont systemFontOfSize:10]; | |
cell2.accessoryType = UITableViewCellAccessoryDisclosureIndicator; | |
return cell2; |
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
if (fetchDataArray.count >= 2 || (fetchDataArray.count == 1 && self.sleepData.wakeUpTime > 0) ) { | |
} else { | |
[self dontHaveEnoughDataAlert]; | |
footerText = nil; | |
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationAutomatic]; | |
} | |
- (void)dontHaveEnoughDataAlert |
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 *path = [[NSBundle mainBundle] pathForResource:@"SleepTypeExplanation" | |
ofType:@"rtf"]; | |
NSString *fileContent = [NSString stringWithContentsOfFile:path | |
encoding:NSUTF32StringEncoding | |
error:&error]; |
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
if ([MFMailComposeViewController canSendMail]) | |
{ | |
NSString *emailTitle = @""; | |
NSString *messageBody = @""; | |
NSArray *toRecipents = [NSArray arrayWithObject:@"[email protected]"]; | |
MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init]; | |
mailViewController.mailComposeDelegate = self; | |
[mailViewController setSubject:emailTitle]; | |
[mailViewController setMessageBody:messageBody isHTML:YES]; |
NewerOlder