Compare View
Commits (2)
Changes
Showing 20 changed files Side-by-side Diff
- LifeLog/LifeLog.xcodeproj/project.pbxproj
- LifeLog/LifeLog/Assets.xcassets/History/arrow_down.imageset/Contents.json
- LifeLog/LifeLog/Assets.xcassets/History/arrow_down.imageset/arrow_down.png
- LifeLog/LifeLog/BaseTableViewController.m
- LifeLog/LifeLog/CreateGroupViewController.h
- LifeLog/LifeLog/CreateGroupViewController.m
- LifeLog/LifeLog/CreateGroupViewController.xib
- LifeLog/LifeLog/GroupDetailViewController.xib
- LifeLog/LifeLog/GroupObject.h
- LifeLog/LifeLog/GroupObject.m
- LifeLog/LifeLog/Localizable.strings
- LifeLog/LifeLog/MyGroupViewController.h
- LifeLog/LifeLog/MyGroupViewController.m
- LifeLog/LifeLog/MyGroupViewController.xib
- LifeLog/LifeLog/SNSViewController.m
- LifeLog/LifeLog/SearchGroupViewController.h
- LifeLog/LifeLog/SearchGroupViewController.m
- LifeLog/LifeLog/SearchGroupViewController.xib
- LifeLog/LifeLog/ServerAPI.h
- LifeLog/LifeLog/ServerAPI.m
LifeLog/LifeLog.xcodeproj/project.pbxproj
| ... | ... | @@ -58,6 +58,10 @@ |
| 58 | 58 | E9373E4A1F35AA180059355A /* HistoryObject.m in Sources */ = {isa = PBXBuildFile; fileRef = E9373E491F35AA180059355A /* HistoryObject.m */; }; |
| 59 | 59 | E9373E4D1F361A230059355A /* HistoryGraphObject.m in Sources */ = {isa = PBXBuildFile; fileRef = E9373E4C1F361A230059355A /* HistoryGraphObject.m */; }; |
| 60 | 60 | E9497FD51F46EC1100E6AF8D /* MemberObject.m in Sources */ = {isa = PBXBuildFile; fileRef = E9497FD41F46EC1100E6AF8D /* MemberObject.m */; }; |
| 61 | + E95F4CED1F475C6A00D27E80 /* CreateGroupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E95F4CEB1F475C6A00D27E80 /* CreateGroupViewController.m */; }; | |
| 62 | + E95F4CEE1F475C6A00D27E80 /* CreateGroupViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E95F4CEC1F475C6A00D27E80 /* CreateGroupViewController.xib */; }; | |
| 63 | + E95F4CF31F48B39200D27E80 /* MyGroupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E95F4CF11F48B39200D27E80 /* MyGroupViewController.m */; }; | |
| 64 | + E95F4CF41F48B39200D27E80 /* MyGroupViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E95F4CF21F48B39200D27E80 /* MyGroupViewController.xib */; }; | |
| 61 | 65 | E9682E2E1F39675A00FE05A2 /* RankingTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E9682E2C1F39675A00FE05A2 /* RankingTableViewCell.m */; }; |
| 62 | 66 | E9682E2F1F39675A00FE05A2 /* RankingTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E9682E2D1F39675A00FE05A2 /* RankingTableViewCell.xib */; }; |
| 63 | 67 | E968550A1F3C444900317CEF /* AutoTransButton.m in Sources */ = {isa = PBXBuildFile; fileRef = E96855091F3C444900317CEF /* AutoTransButton.m */; }; |
| ... | ... | @@ -184,6 +188,12 @@ |
| 184 | 188 | E9373E4C1F361A230059355A /* HistoryGraphObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HistoryGraphObject.m; sourceTree = "<group>"; }; |
| 185 | 189 | E9497FD31F46EC1100E6AF8D /* MemberObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemberObject.h; sourceTree = "<group>"; }; |
| 186 | 190 | E9497FD41F46EC1100E6AF8D /* MemberObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MemberObject.m; sourceTree = "<group>"; }; |
| 191 | + E95F4CEA1F475C6A00D27E80 /* CreateGroupViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CreateGroupViewController.h; sourceTree = "<group>"; }; | |
| 192 | + E95F4CEB1F475C6A00D27E80 /* CreateGroupViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CreateGroupViewController.m; sourceTree = "<group>"; }; | |
| 193 | + E95F4CEC1F475C6A00D27E80 /* CreateGroupViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CreateGroupViewController.xib; sourceTree = "<group>"; }; | |
| 194 | + E95F4CF01F48B39200D27E80 /* MyGroupViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyGroupViewController.h; sourceTree = "<group>"; }; | |
| 195 | + E95F4CF11F48B39200D27E80 /* MyGroupViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyGroupViewController.m; sourceTree = "<group>"; }; | |
| 196 | + E95F4CF21F48B39200D27E80 /* MyGroupViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyGroupViewController.xib; sourceTree = "<group>"; }; | |
| 187 | 197 | E9682E2B1F39675A00FE05A2 /* RankingTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankingTableViewCell.h; sourceTree = "<group>"; }; |
| 188 | 198 | E9682E2C1F39675A00FE05A2 /* RankingTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankingTableViewCell.m; sourceTree = "<group>"; }; |
| 189 | 199 | E9682E2D1F39675A00FE05A2 /* RankingTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RankingTableViewCell.xib; sourceTree = "<group>"; }; |
| ... | ... | @@ -436,6 +446,8 @@ |
| 436 | 446 | 6E84E3AC1F27A954001EB88E /* SNS */ = { |
| 437 | 447 | isa = PBXGroup; |
| 438 | 448 | children = ( |
| 449 | + E95F4CEF1F48B37100D27E80 /* MyGroup */, | |
| 450 | + E95F4CE91F475C4B00D27E80 /* CreateGroup */, | |
| 439 | 451 | E933E6751F4050E6002926F5 /* GroupDetail */, |
| 440 | 452 | E933E6671F3E0479002926F5 /* SeachGroup */, |
| 441 | 453 | 6E84E3BC1F27A9B1001EB88E /* SNSViewController.h */, |
| ... | ... | @@ -581,6 +593,26 @@ |
| 581 | 593 | name = AutoTranslateView; |
| 582 | 594 | sourceTree = "<group>"; |
| 583 | 595 | }; |
| 596 | + E95F4CE91F475C4B00D27E80 /* CreateGroup */ = { | |
| 597 | + isa = PBXGroup; | |
| 598 | + children = ( | |
| 599 | + E95F4CEA1F475C6A00D27E80 /* CreateGroupViewController.h */, | |
| 600 | + E95F4CEB1F475C6A00D27E80 /* CreateGroupViewController.m */, | |
| 601 | + E95F4CEC1F475C6A00D27E80 /* CreateGroupViewController.xib */, | |
| 602 | + ); | |
| 603 | + name = CreateGroup; | |
| 604 | + sourceTree = "<group>"; | |
| 605 | + }; | |
| 606 | + E95F4CEF1F48B37100D27E80 /* MyGroup */ = { | |
| 607 | + isa = PBXGroup; | |
| 608 | + children = ( | |
| 609 | + E95F4CF01F48B39200D27E80 /* MyGroupViewController.h */, | |
| 610 | + E95F4CF11F48B39200D27E80 /* MyGroupViewController.m */, | |
| 611 | + E95F4CF21F48B39200D27E80 /* MyGroupViewController.xib */, | |
| 612 | + ); | |
| 613 | + name = MyGroup; | |
| 614 | + sourceTree = "<group>"; | |
| 615 | + }; | |
| 584 | 616 | E99E13A71F336F0C00C78787 /* CustomView */ = { |
| 585 | 617 | isa = PBXGroup; |
| 586 | 618 | children = ( |
| ... | ... | @@ -714,6 +746,7 @@ |
| 714 | 746 | buildActionMask = 2147483647; |
| 715 | 747 | files = ( |
| 716 | 748 | 9CBDA1001F2F03810055DED1 /* RegisterViewController.xib in Resources */, |
| 749 | + E95F4CEE1F475C6A00D27E80 /* CreateGroupViewController.xib in Resources */, | |
| 717 | 750 | 6E18CED41F2E39DB0029891F /* LoginViewController.xib in Resources */, |
| 718 | 751 | E99E13AD1F336F4500C78787 /* CollectionView.xib in Resources */, |
| 719 | 752 | 6E84E3BB1F27A9A0001EB88E /* RankingViewController.xib in Resources */, |
| ... | ... | @@ -728,6 +761,7 @@ |
| 728 | 761 | 6EF1630A1F29069300DA306C /* Localizable.strings in Resources */, |
| 729 | 762 | 6E84E3B11F27A975001EB88E /* HomeViewController.xib in Resources */, |
| 730 | 763 | 6E84E3B61F27A98B001EB88E /* HistoryViewController.xib in Resources */, |
| 764 | + E95F4CF41F48B39200D27E80 /* MyGroupViewController.xib in Resources */, | |
| 731 | 765 | E933E66C1F3E04A6002926F5 /* SearchGroupViewController.xib in Resources */, |
| 732 | 766 | E96855121F3C5D9A00317CEF /* SNSRecentTopicTableViewCell.xib in Resources */, |
| 733 | 767 | E933E67A1F40513C002926F5 /* GroupDetailViewController.xib in Resources */, |
| ... | ... | @@ -827,6 +861,7 @@ |
| 827 | 861 | 6EDC8BF41F2C68D700765ACC /* CMMotionActivityExtra.m in Sources */, |
| 828 | 862 | E933E6791F40513C002926F5 /* GroupDetailViewController.m in Sources */, |
| 829 | 863 | 6EA4AF311F40BB7A00F52CFE /* StepObject.m in Sources */, |
| 864 | + E95F4CED1F475C6A00D27E80 /* CreateGroupViewController.m in Sources */, | |
| 830 | 865 | 9CBDA0FF1F2F03810055DED1 /* RegisterViewController.m in Sources */, |
| 831 | 866 | E9373E4A1F35AA180059355A /* HistoryObject.m in Sources */, |
| 832 | 867 | 9CA8AEEA1F31BB4600C5FC74 /* ConfirmForgetPassViewController.m in Sources */, |
| ... | ... | @@ -843,6 +878,7 @@ |
| 843 | 878 | 6E84E3761F27A701001EB88E /* main.m in Sources */, |
| 844 | 879 | E933E6701F3E09B6002926F5 /* SearchGroupTableViewCell.m in Sources */, |
| 845 | 880 | 6E84E3B51F27A98B001EB88E /* HistoryViewController.m in Sources */, |
| 881 | + E95F4CF31F48B39200D27E80 /* MyGroupViewController.m in Sources */, | |
| 846 | 882 | E9373E4D1F361A230059355A /* HistoryGraphObject.m in Sources */, |
| 847 | 883 | E933E66B1F3E04A6002926F5 /* SearchGroupViewController.m in Sources */, |
| 848 | 884 | 6E84E3BF1F27A9B1001EB88E /* SNSViewController.m in Sources */, |
LifeLog/LifeLog/Assets.xcassets/History/arrow_down.imageset/Contents.json
| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "idiom" : "universal", | |
| 9 | + "filename" : "arrow_down.png", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "version" : 1, | |
| 19 | + "author" : "xcode" | |
| 20 | + } | |
| 21 | +} | |
| 0 | 22 | \ No newline at end of file |
LifeLog/LifeLog/Assets.xcassets/History/arrow_down.imageset/arrow_down.png
527 Bytes
LifeLog/LifeLog/BaseTableViewController.m
LifeLog/LifeLog/CreateGroupViewController.h
| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | +// | |
| 2 | +// CreateGroupViewController.h | |
| 3 | +// LifeLog | |
| 4 | +// | |
| 5 | +// Created by nvtu on 8/19/17. | |
| 6 | +// Copyright © 2017 PhongNV. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import <UIKit/UIKit.h> | |
| 10 | +#import "BaseViewController.h" | |
| 11 | +#import "AutoTransButton.h" | |
| 12 | +#import "Utilities.h" | |
| 13 | +#import "Entities.h" | |
| 14 | + | |
| 15 | +@interface CreateGroupViewController : BaseViewController<UITextFieldDelegate, UITextViewDelegate> | |
| 16 | + | |
| 17 | +@property (weak, nonatomic) IBOutlet UITextField *textName; | |
| 18 | +@property (weak, nonatomic) IBOutlet UITextField *textGoalWalk; | |
| 19 | +@property (weak, nonatomic) IBOutlet UITextField *textGoalRun; | |
| 20 | +@property (weak, nonatomic) IBOutlet UITextField *textGoalBike; | |
| 21 | + | |
| 22 | +@property (weak, nonatomic) IBOutlet UITextView *textGoal; | |
| 23 | + | |
| 24 | +@property (weak, nonatomic) IBOutlet UISwitch *switchWalk; | |
| 25 | +@property (weak, nonatomic) IBOutlet UISwitch *switchBike; | |
| 26 | +@property (weak, nonatomic) IBOutlet UISwitch *switchRun; | |
| 27 | +@property (weak, nonatomic) IBOutlet UISwitch *switchStep; | |
| 28 | +@property (weak, nonatomic) IBOutlet UISwitch *switchGym; | |
| 29 | +@property (weak, nonatomic) IBOutlet UISwitch *switchBegin; | |
| 30 | + | |
| 31 | +@property (copy) void (^createGroupSuccess)(GroupObject * group); | |
| 32 | + | |
| 33 | +- (IBAction)clickBack:(UIButton *)sender; | |
| 34 | +- (IBAction)clickCreateGroup:(AutoTransButton *)sender; | |
| 35 | + | |
| 36 | +@end |
LifeLog/LifeLog/CreateGroupViewController.m
| ... | ... | @@ -0,0 +1,116 @@ |
| 1 | +// | |
| 2 | +// CreateGroupViewController.m | |
| 3 | +// LifeLog | |
| 4 | +// | |
| 5 | +// Created by nvtu on 8/19/17. | |
| 6 | +// Copyright © 2017 PhongNV. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CreateGroupViewController.h" | |
| 10 | +#import "ServerAPI.h" | |
| 11 | + | |
| 12 | +@interface CreateGroupViewController () | |
| 13 | + | |
| 14 | +@end | |
| 15 | + | |
| 16 | +@implementation CreateGroupViewController | |
| 17 | + | |
| 18 | +- (void)viewDidLoad { | |
| 19 | + [super viewDidLoad]; | |
| 20 | + // Do any additional setup after loading the view from its nib. | |
| 21 | +} | |
| 22 | + | |
| 23 | +- (void)didReceiveMemoryWarning { | |
| 24 | + [super didReceiveMemoryWarning]; | |
| 25 | + // Dispose of any resources that can be recreated. | |
| 26 | +} | |
| 27 | + | |
| 28 | +#pragma mark IBAction | |
| 29 | + | |
| 30 | +- (IBAction)clickBack:(UIButton *)sender { | |
| 31 | + [self.navigationController popViewControllerAnimated:true]; | |
| 32 | +} | |
| 33 | + | |
| 34 | +- (IBAction)clickCreateGroup:(AutoTransButton *)sender { | |
| 35 | + NSString *name = self.textName.text; | |
| 36 | + NSString *goal = self.textGoal.text; | |
| 37 | + if(name.length == 0) { | |
| 38 | + [Utilities showErrorMessage:@"Fill name of group!" withViewController:self]; | |
| 39 | + return; | |
| 40 | + } | |
| 41 | + else if(name.length >= 255) { | |
| 42 | + [Utilities showErrorMessage:@"Name of group is too long!" withViewController:self]; | |
| 43 | + return; | |
| 44 | + } | |
| 45 | + else if(goal.length == 0) { | |
| 46 | + [Utilities showErrorMessage:@"Fill information for goal of group" withViewController:self]; | |
| 47 | + return; | |
| 48 | + } | |
| 49 | + if(self.switchWalk.on && [self.textGoalWalk.text intValue] == 0) { | |
| 50 | + [Utilities showErrorMessage:@"Add goal for walk mode" withViewController:self]; | |
| 51 | + return; | |
| 52 | + } | |
| 53 | + if(self.switchBike.on && [self.textGoalBike.text intValue] == 0) { | |
| 54 | + [Utilities showErrorMessage:@"Add goal for bike mode" withViewController:self]; | |
| 55 | + return; | |
| 56 | + } | |
| 57 | + if(self.switchRun.on && [self.textGoalRun.text intValue] == 0) { | |
| 58 | + [Utilities showErrorMessage:@"Add goal for run mode" withViewController:self]; | |
| 59 | + return; | |
| 60 | + } | |
| 61 | + GroupObject *object = [[GroupObject alloc] init]; | |
| 62 | + object.name = name; | |
| 63 | + object.goal = goal; | |
| 64 | + object.walkMode = self.switchWalk.on; | |
| 65 | + object.runMode = self.switchRun.on; | |
| 66 | + object.bikeMode = self.switchBike.on; | |
| 67 | + object.stepMode = self.switchStep.on; | |
| 68 | + object.gymMode = self.switchGym.on; | |
| 69 | + object.beginMode = self.switchBegin.on; | |
| 70 | + object.walkGoal = [self.textGoalWalk.text intValue]; | |
| 71 | + object.bikeGoal = [self.textGoalBike.text intValue]; | |
| 72 | + object.runGoal = [self.textGoalRun.text intValue]; | |
| 73 | + | |
| 74 | + NSLog(@"%@", object.name); | |
| 75 | + NSLog(@"%@", object.goal); | |
| 76 | + NSLog(@"%d", object.walkGoal); | |
| 77 | + NSLog(@"%d", object.bikeGoal); | |
| 78 | + NSLog(@"%d", object.runGoal); | |
| 79 | + NSLog(@"%d", object.walkMode); | |
| 80 | + NSLog(@"%d", object.runMode); | |
| 81 | + NSLog(@"%d", object.bikeMode); | |
| 82 | + NSLog(@"%d", object.stepMode); | |
| 83 | + NSLog(@"%d", object.gymMode); | |
| 84 | + NSLog(@"%d", object.beginMode); | |
| 85 | + | |
| 86 | + NSString * token = [[NSUserDefaults standardUserDefaults] stringForKey:kToken]; | |
| 87 | + MBProgressHUD *hudView = [MBProgressHUD showHUDAddedTo:self.view animated:true]; | |
| 88 | + [[ServerAPI server] requestCreateGroup:token withGroup:object CompletionHandler:^(GroupObject * group, NSError * error) { | |
| 89 | + CreateGroupViewController __weak *weakSelf = self; | |
| 90 | + if(error == nil) { | |
| 91 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 92 | + if(weakSelf.createGroupSuccess != nil) { | |
| 93 | + [hudView hideAnimated:true]; | |
| 94 | + [weakSelf clickBack:nil]; | |
| 95 | + weakSelf.createGroupSuccess(object); | |
| 96 | + } | |
| 97 | + }); | |
| 98 | + } | |
| 99 | + else { | |
| 100 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 101 | + [hudView hideAnimated:true]; | |
| 102 | + NSString *message = [error.userInfo objectForKey:@"message"]; | |
| 103 | + [Utilities showErrorMessage:message withViewController:weakSelf]; | |
| 104 | + }); | |
| 105 | + } | |
| 106 | + }]; | |
| 107 | +} | |
| 108 | + | |
| 109 | +#pragma mark UITextView Delegate | |
| 110 | + | |
| 111 | +-(BOOL) textFieldShouldReturn:(UITextField *)textField { | |
| 112 | + [self.view endEditing:true]; | |
| 113 | + return true; | |
| 114 | +} | |
| 115 | + | |
| 116 | +@end |
LifeLog/LifeLog/CreateGroupViewController.xib
| ... | ... | @@ -0,0 +1,601 @@ |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12118" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> | |
| 3 | + <device id="retina4_7" orientation="portrait"> | |
| 4 | + <adaptation id="fullscreen"/> | |
| 5 | + </device> | |
| 6 | + <dependencies> | |
| 7 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/> | |
| 8 | + <capability name="Aspect ratio constraints" minToolsVersion="5.1"/> | |
| 9 | + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | |
| 10 | + </dependencies> | |
| 11 | + <objects> | |
| 12 | + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CreateGroupViewController"> | |
| 13 | + <connections> | |
| 14 | + <outlet property="switchBegin" destination="e63-8i-6aa" id="bbT-m6-3CV"/> | |
| 15 | + <outlet property="switchBike" destination="fGW-Vw-PwQ" id="ncx-kP-qdd"/> | |
| 16 | + <outlet property="switchGym" destination="Yga-UQ-xoU" id="rIN-kO-wmO"/> | |
| 17 | + <outlet property="switchRun" destination="2gX-B2-tkR" id="yak-gV-Cas"/> | |
| 18 | + <outlet property="switchStep" destination="RoR-w7-dNT" id="19b-K3-qAu"/> | |
| 19 | + <outlet property="switchWalk" destination="3xD-aH-JHl" id="OZ9-l7-Rww"/> | |
| 20 | + <outlet property="textGoal" destination="hWb-vU-yVd" id="dp0-yK-P60"/> | |
| 21 | + <outlet property="textGoalBike" destination="eOi-eo-GYn" id="qfW-ns-tsM"/> | |
| 22 | + <outlet property="textGoalRun" destination="3aE-uP-KLS" id="WAE-tl-O94"/> | |
| 23 | + <outlet property="textGoalWalk" destination="4JZ-J2-3D9" id="yHV-mB-rcn"/> | |
| 24 | + <outlet property="textName" destination="pXO-K0-vne" id="ePQ-35-RLr"/> | |
| 25 | + <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> | |
| 26 | + </connections> | |
| 27 | + </placeholder> | |
| 28 | + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | |
| 29 | + <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> | |
| 30 | + <rect key="frame" x="0.0" y="0.0" width="320" height="626"/> | |
| 31 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |
| 32 | + <subviews> | |
| 33 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QYv-QM-Bkk" userLabel="ViewHeader"> | |
| 34 | + <rect key="frame" x="0.0" y="0.0" width="320" height="46"/> | |
| 35 | + <subviews> | |
| 36 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="コミュニティー グループ作成" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9hM-Gv-AxQ" customClass="AutoTransLabel"> | |
| 37 | + <rect key="frame" x="0.0" y="0.0" width="320" height="46"/> | |
| 38 | + <fontDescription key="fontDescription" type="system" pointSize="16"/> | |
| 39 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 40 | + <nil key="highlightedColor"/> | |
| 41 | + <userDefinedRuntimeAttributes> | |
| 42 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.title"/> | |
| 43 | + </userDefinedRuntimeAttributes> | |
| 44 | + </label> | |
| 45 | + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="O23-Hy-4Ld"> | |
| 46 | + <rect key="frame" x="0.0" y="5" width="70" height="36"/> | |
| 47 | + <constraints> | |
| 48 | + <constraint firstAttribute="width" constant="70" id="8vZ-Ta-Rzv"/> | |
| 49 | + </constraints> | |
| 50 | + <state key="normal" image="today_back_button"/> | |
| 51 | + <connections> | |
| 52 | + <action selector="clickBack:" destination="-1" eventType="touchUpInside" id="BO6-jx-vuO"/> | |
| 53 | + </connections> | |
| 54 | + </button> | |
| 55 | + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fPg-VP-VkU"> | |
| 56 | + <rect key="frame" x="275" y="0.0" width="45" height="46"/> | |
| 57 | + <constraints> | |
| 58 | + <constraint firstAttribute="width" constant="45" id="k1W-Oc-mRq"/> | |
| 59 | + </constraints> | |
| 60 | + <state key="normal" image="icon_menu"/> | |
| 61 | + </button> | |
| 62 | + </subviews> | |
| 63 | + <color key="backgroundColor" red="0.098039215690000001" green="0.098039215690000001" blue="0.098039215690000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |
| 64 | + <constraints> | |
| 65 | + <constraint firstAttribute="trailing" secondItem="9hM-Gv-AxQ" secondAttribute="trailing" id="5f8-Xt-vKd"/> | |
| 66 | + <constraint firstAttribute="bottom" secondItem="9hM-Gv-AxQ" secondAttribute="bottom" id="Q3z-hF-VbV"/> | |
| 67 | + <constraint firstItem="9hM-Gv-AxQ" firstAttribute="top" secondItem="QYv-QM-Bkk" secondAttribute="top" id="XNi-3d-xFW"/> | |
| 68 | + <constraint firstItem="O23-Hy-4Ld" firstAttribute="leading" secondItem="QYv-QM-Bkk" secondAttribute="leading" id="aMc-uz-vGA"/> | |
| 69 | + <constraint firstItem="fPg-VP-VkU" firstAttribute="top" secondItem="QYv-QM-Bkk" secondAttribute="top" id="bLC-DU-cJf"/> | |
| 70 | + <constraint firstItem="9hM-Gv-AxQ" firstAttribute="leading" secondItem="QYv-QM-Bkk" secondAttribute="leading" id="cUY-dT-Rh0"/> | |
| 71 | + <constraint firstAttribute="trailing" secondItem="fPg-VP-VkU" secondAttribute="trailing" id="fn0-SY-e1Z"/> | |
| 72 | + <constraint firstAttribute="height" constant="46" id="lBP-32-aFw"/> | |
| 73 | + <constraint firstItem="O23-Hy-4Ld" firstAttribute="top" secondItem="QYv-QM-Bkk" secondAttribute="top" constant="5" id="ogR-c4-QQ3"/> | |
| 74 | + <constraint firstAttribute="bottom" secondItem="fPg-VP-VkU" secondAttribute="bottom" id="wdr-SH-Wm2"/> | |
| 75 | + <constraint firstAttribute="bottom" secondItem="O23-Hy-4Ld" secondAttribute="bottom" constant="5" id="yJ4-81-rJx"/> | |
| 76 | + </constraints> | |
| 77 | + </view> | |
| 78 | + <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aKu-bd-xMP" customClass="TPKeyboardAvoidingScrollView"> | |
| 79 | + <rect key="frame" x="0.0" y="46" width="320" height="580"/> | |
| 80 | + <subviews> | |
| 81 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9w1-87-U1W"> | |
| 82 | + <rect key="frame" x="0.0" y="0.0" width="320" height="580"/> | |
| 83 | + <subviews> | |
| 84 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="名称" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZtU-mt-3Ov" customClass="AutoTransLabel"> | |
| 85 | + <rect key="frame" x="8" y="10" width="70" height="30"/> | |
| 86 | + <constraints> | |
| 87 | + <constraint firstAttribute="width" constant="70" id="Zvx-V3-7AW"/> | |
| 88 | + <constraint firstAttribute="height" constant="30" id="nok-hA-mW9"/> | |
| 89 | + </constraints> | |
| 90 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 91 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 92 | + <nil key="highlightedColor"/> | |
| 93 | + <userDefinedRuntimeAttributes> | |
| 94 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.name"/> | |
| 95 | + </userDefinedRuntimeAttributes> | |
| 96 | + </label> | |
| 97 | + <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="pXO-K0-vne"> | |
| 98 | + <rect key="frame" x="88" y="10" width="222" height="30"/> | |
| 99 | + <constraints> | |
| 100 | + <constraint firstAttribute="height" constant="30" id="YJe-TW-hvA"/> | |
| 101 | + </constraints> | |
| 102 | + <nil key="textColor"/> | |
| 103 | + <fontDescription key="fontDescription" type="system" pointSize="14"/> | |
| 104 | + <textInputTraits key="textInputTraits"/> | |
| 105 | + <connections> | |
| 106 | + <outlet property="delegate" destination="-1" id="3NL-Ya-JuM"/> | |
| 107 | + </connections> | |
| 108 | + </textField> | |
| 109 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ONn-27-HqB"> | |
| 110 | + <rect key="frame" x="10" y="50" width="140" height="120"/> | |
| 111 | + <subviews> | |
| 112 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="S2z-DI-pIE"> | |
| 113 | + <rect key="frame" x="0.0" y="0.0" width="140" height="40"/> | |
| 114 | + <subviews> | |
| 115 | + <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3xD-aH-JHl"> | |
| 116 | + <rect key="frame" x="85" y="4" width="51" height="31"/> | |
| 117 | + <constraints> | |
| 118 | + <constraint firstAttribute="width" secondItem="3xD-aH-JHl" secondAttribute="height" multiplier="49:31" id="7LJ-H5-oQR"/> | |
| 119 | + </constraints> | |
| 120 | + <color key="onTintColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |
| 121 | + </switch> | |
| 122 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="WALK" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yFv-kp-ag8" customClass="AutoTransLabel"> | |
| 123 | + <rect key="frame" x="6" y="10.5" width="47.5" height="20.5"/> | |
| 124 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 125 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 126 | + <nil key="highlightedColor"/> | |
| 127 | + <userDefinedRuntimeAttributes> | |
| 128 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.walk"/> | |
| 129 | + </userDefinedRuntimeAttributes> | |
| 130 | + </label> | |
| 131 | + </subviews> | |
| 132 | + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | |
| 133 | + <constraints> | |
| 134 | + <constraint firstAttribute="trailing" secondItem="3xD-aH-JHl" secondAttribute="trailing" constant="6" id="KNe-Rx-lun"/> | |
| 135 | + <constraint firstAttribute="height" constant="40" id="akz-T7-d2v"/> | |
| 136 | + <constraint firstItem="3xD-aH-JHl" firstAttribute="centerY" secondItem="S2z-DI-pIE" secondAttribute="centerY" id="oRy-OM-Om1"/> | |
| 137 | + <constraint firstItem="yFv-kp-ag8" firstAttribute="leading" secondItem="S2z-DI-pIE" secondAttribute="leading" constant="6" id="prt-UF-Ori"/> | |
| 138 | + <constraint firstItem="yFv-kp-ag8" firstAttribute="centerY" secondItem="S2z-DI-pIE" secondAttribute="centerY" id="xEl-Rl-8C1"/> | |
| 139 | + </constraints> | |
| 140 | + </view> | |
| 141 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dVh-y2-XTr"> | |
| 142 | + <rect key="frame" x="0.0" y="40" width="140" height="40"/> | |
| 143 | + <subviews> | |
| 144 | + <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2gX-B2-tkR"> | |
| 145 | + <rect key="frame" x="85" y="4" width="51" height="31"/> | |
| 146 | + <constraints> | |
| 147 | + <constraint firstAttribute="width" secondItem="2gX-B2-tkR" secondAttribute="height" multiplier="49:31" id="pBG-Mw-aNK"/> | |
| 148 | + </constraints> | |
| 149 | + <color key="onTintColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |
| 150 | + </switch> | |
| 151 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="RUN" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="r9v-yX-mx8" customClass="AutoTransLabel"> | |
| 152 | + <rect key="frame" x="6" y="10.5" width="36" height="20.5"/> | |
| 153 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 154 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 155 | + <nil key="highlightedColor"/> | |
| 156 | + <userDefinedRuntimeAttributes> | |
| 157 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.run"/> | |
| 158 | + </userDefinedRuntimeAttributes> | |
| 159 | + </label> | |
| 160 | + </subviews> | |
| 161 | + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | |
| 162 | + <constraints> | |
| 163 | + <constraint firstItem="2gX-B2-tkR" firstAttribute="centerY" secondItem="dVh-y2-XTr" secondAttribute="centerY" id="bNR-wC-PQG"/> | |
| 164 | + <constraint firstItem="r9v-yX-mx8" firstAttribute="leading" secondItem="dVh-y2-XTr" secondAttribute="leading" constant="6" id="iHM-Q7-Z1Z"/> | |
| 165 | + <constraint firstAttribute="height" constant="40" id="s8W-Ak-VrH"/> | |
| 166 | + <constraint firstAttribute="trailing" secondItem="2gX-B2-tkR" secondAttribute="trailing" constant="6" id="usV-BG-oqp"/> | |
| 167 | + <constraint firstItem="r9v-yX-mx8" firstAttribute="centerY" secondItem="dVh-y2-XTr" secondAttribute="centerY" id="yZW-Wk-raQ"/> | |
| 168 | + </constraints> | |
| 169 | + </view> | |
| 170 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7PQ-zz-N0X"> | |
| 171 | + <rect key="frame" x="0.0" y="80" width="140" height="40"/> | |
| 172 | + <subviews> | |
| 173 | + <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Yga-UQ-xoU"> | |
| 174 | + <rect key="frame" x="85" y="4" width="51" height="31"/> | |
| 175 | + <constraints> | |
| 176 | + <constraint firstAttribute="width" secondItem="Yga-UQ-xoU" secondAttribute="height" multiplier="49:31" id="laB-Zs-gOj"/> | |
| 177 | + </constraints> | |
| 178 | + <color key="onTintColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |
| 179 | + </switch> | |
| 180 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ジム" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EFD-Ys-PqS" customClass="AutoTransLabel"> | |
| 181 | + <rect key="frame" x="6" y="10.5" width="35" height="20.5"/> | |
| 182 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 183 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 184 | + <nil key="highlightedColor"/> | |
| 185 | + <userDefinedRuntimeAttributes> | |
| 186 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.gym"/> | |
| 187 | + </userDefinedRuntimeAttributes> | |
| 188 | + </label> | |
| 189 | + </subviews> | |
| 190 | + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | |
| 191 | + <constraints> | |
| 192 | + <constraint firstItem="EFD-Ys-PqS" firstAttribute="centerY" secondItem="7PQ-zz-N0X" secondAttribute="centerY" id="Ein-vC-mpy"/> | |
| 193 | + <constraint firstAttribute="height" constant="40" id="aKm-hG-Hyh"/> | |
| 194 | + <constraint firstAttribute="trailing" secondItem="Yga-UQ-xoU" secondAttribute="trailing" constant="6" id="cfd-4G-1NF"/> | |
| 195 | + <constraint firstItem="EFD-Ys-PqS" firstAttribute="leading" secondItem="7PQ-zz-N0X" secondAttribute="leading" constant="6" id="ojT-rz-8oC"/> | |
| 196 | + <constraint firstItem="Yga-UQ-xoU" firstAttribute="centerY" secondItem="7PQ-zz-N0X" secondAttribute="centerY" id="xYy-kb-5Sk"/> | |
| 197 | + </constraints> | |
| 198 | + </view> | |
| 199 | + </subviews> | |
| 200 | + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | |
| 201 | + <constraints> | |
| 202 | + <constraint firstItem="dVh-y2-XTr" firstAttribute="top" secondItem="S2z-DI-pIE" secondAttribute="bottom" id="2LH-28-ssn"/> | |
| 203 | + <constraint firstItem="7PQ-zz-N0X" firstAttribute="leading" secondItem="ONn-27-HqB" secondAttribute="leading" id="6md-Y8-lIk"/> | |
| 204 | + <constraint firstAttribute="height" constant="120" id="7Tb-oJ-5eC"/> | |
| 205 | + <constraint firstItem="7PQ-zz-N0X" firstAttribute="top" secondItem="dVh-y2-XTr" secondAttribute="bottom" id="Fsa-Ai-cKQ"/> | |
| 206 | + <constraint firstAttribute="trailing" secondItem="S2z-DI-pIE" secondAttribute="trailing" id="OV6-wK-IJj"/> | |
| 207 | + <constraint firstItem="dVh-y2-XTr" firstAttribute="leading" secondItem="ONn-27-HqB" secondAttribute="leading" id="TFE-bH-HwH"/> | |
| 208 | + <constraint firstAttribute="trailing" secondItem="dVh-y2-XTr" secondAttribute="trailing" id="Vul-EM-V8H"/> | |
| 209 | + <constraint firstItem="S2z-DI-pIE" firstAttribute="top" secondItem="ONn-27-HqB" secondAttribute="top" id="Yf4-Rz-E4g"/> | |
| 210 | + <constraint firstAttribute="trailing" secondItem="7PQ-zz-N0X" secondAttribute="trailing" id="hLr-NV-hyv"/> | |
| 211 | + <constraint firstItem="S2z-DI-pIE" firstAttribute="leading" secondItem="ONn-27-HqB" secondAttribute="leading" id="zMY-Vd-Ge9"/> | |
| 212 | + </constraints> | |
| 213 | + </view> | |
| 214 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Kpa-HJ-7cE"> | |
| 215 | + <rect key="frame" x="170" y="50" width="140" height="120"/> | |
| 216 | + <subviews> | |
| 217 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ALk-sL-SXG"> | |
| 218 | + <rect key="frame" x="0.0" y="0.0" width="140" height="40"/> | |
| 219 | + <subviews> | |
| 220 | + <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fGW-Vw-PwQ"> | |
| 221 | + <rect key="frame" x="85" y="4" width="51" height="31"/> | |
| 222 | + <constraints> | |
| 223 | + <constraint firstAttribute="width" secondItem="fGW-Vw-PwQ" secondAttribute="height" multiplier="49:31" id="qd5-Cg-6pG"/> | |
| 224 | + </constraints> | |
| 225 | + <color key="onTintColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |
| 226 | + </switch> | |
| 227 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="BIKE" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WfE-YM-vVU" customClass="AutoTransLabel"> | |
| 228 | + <rect key="frame" x="6" y="10.5" width="36.5" height="20.5"/> | |
| 229 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 230 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 231 | + <nil key="highlightedColor"/> | |
| 232 | + <userDefinedRuntimeAttributes> | |
| 233 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.bike"/> | |
| 234 | + </userDefinedRuntimeAttributes> | |
| 235 | + </label> | |
| 236 | + </subviews> | |
| 237 | + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | |
| 238 | + <constraints> | |
| 239 | + <constraint firstItem="WfE-YM-vVU" firstAttribute="leading" secondItem="ALk-sL-SXG" secondAttribute="leading" constant="6" id="7xm-U8-L7U"/> | |
| 240 | + <constraint firstAttribute="height" constant="40" id="L4u-uj-rHa"/> | |
| 241 | + <constraint firstItem="fGW-Vw-PwQ" firstAttribute="centerY" secondItem="ALk-sL-SXG" secondAttribute="centerY" id="PBA-tv-gec"/> | |
| 242 | + <constraint firstAttribute="trailing" secondItem="fGW-Vw-PwQ" secondAttribute="trailing" constant="6" id="bHc-Ih-6ar"/> | |
| 243 | + <constraint firstItem="WfE-YM-vVU" firstAttribute="centerY" secondItem="ALk-sL-SXG" secondAttribute="centerY" id="te7-Im-Oqh"/> | |
| 244 | + </constraints> | |
| 245 | + </view> | |
| 246 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4Az-6N-8u4"> | |
| 247 | + <rect key="frame" x="0.0" y="40" width="140" height="40"/> | |
| 248 | + <subviews> | |
| 249 | + <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RoR-w7-dNT"> | |
| 250 | + <rect key="frame" x="85" y="4" width="51" height="31"/> | |
| 251 | + <constraints> | |
| 252 | + <constraint firstAttribute="width" secondItem="RoR-w7-dNT" secondAttribute="height" multiplier="49:31" id="YUz-Eh-EmZ"/> | |
| 253 | + </constraints> | |
| 254 | + <color key="onTintColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |
| 255 | + </switch> | |
| 256 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="STEP" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZyO-6K-2gA" customClass="AutoTransLabel"> | |
| 257 | + <rect key="frame" x="6" y="10.5" width="42" height="20.5"/> | |
| 258 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 259 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 260 | + <nil key="highlightedColor"/> | |
| 261 | + <userDefinedRuntimeAttributes> | |
| 262 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.step"/> | |
| 263 | + </userDefinedRuntimeAttributes> | |
| 264 | + </label> | |
| 265 | + </subviews> | |
| 266 | + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | |
| 267 | + <constraints> | |
| 268 | + <constraint firstAttribute="trailing" secondItem="RoR-w7-dNT" secondAttribute="trailing" constant="6" id="Cc4-W7-Qc8"/> | |
| 269 | + <constraint firstItem="ZyO-6K-2gA" firstAttribute="leading" secondItem="4Az-6N-8u4" secondAttribute="leading" constant="6" id="ER7-Bx-w9j"/> | |
| 270 | + <constraint firstAttribute="height" constant="40" id="Kcy-ij-IsH"/> | |
| 271 | + <constraint firstItem="RoR-w7-dNT" firstAttribute="centerY" secondItem="4Az-6N-8u4" secondAttribute="centerY" id="O1R-k3-iBZ"/> | |
| 272 | + <constraint firstItem="ZyO-6K-2gA" firstAttribute="centerY" secondItem="4Az-6N-8u4" secondAttribute="centerY" id="fWH-tG-gSV"/> | |
| 273 | + </constraints> | |
| 274 | + </view> | |
| 275 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ORZ-El-owx"> | |
| 276 | + <rect key="frame" x="0.0" y="80" width="140" height="40"/> | |
| 277 | + <subviews> | |
| 278 | + <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="e63-8i-6aa"> | |
| 279 | + <rect key="frame" x="85" y="4" width="51" height="31"/> | |
| 280 | + <constraints> | |
| 281 | + <constraint firstAttribute="width" secondItem="e63-8i-6aa" secondAttribute="height" multiplier="49:31" id="TTd-tM-PrG"/> | |
| 282 | + </constraints> | |
| 283 | + <color key="onTintColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |
| 284 | + </switch> | |
| 285 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="初心者" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RfO-1U-s4W" customClass="AutoTransLabel"> | |
| 286 | + <rect key="frame" x="6" y="10.5" width="52" height="20.5"/> | |
| 287 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 288 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 289 | + <nil key="highlightedColor"/> | |
| 290 | + <userDefinedRuntimeAttributes> | |
| 291 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.begin"/> | |
| 292 | + </userDefinedRuntimeAttributes> | |
| 293 | + </label> | |
| 294 | + </subviews> | |
| 295 | + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | |
| 296 | + <constraints> | |
| 297 | + <constraint firstItem="RfO-1U-s4W" firstAttribute="leading" secondItem="ORZ-El-owx" secondAttribute="leading" constant="6" id="5Vq-B2-215"/> | |
| 298 | + <constraint firstAttribute="trailing" secondItem="e63-8i-6aa" secondAttribute="trailing" constant="6" id="NUX-0H-z8v"/> | |
| 299 | + <constraint firstAttribute="height" constant="40" id="PdI-3J-BTC"/> | |
| 300 | + <constraint firstItem="e63-8i-6aa" firstAttribute="centerY" secondItem="ORZ-El-owx" secondAttribute="centerY" id="Vxw-Vk-POY"/> | |
| 301 | + <constraint firstItem="RfO-1U-s4W" firstAttribute="centerY" secondItem="ORZ-El-owx" secondAttribute="centerY" id="tX1-Qb-pKG"/> | |
| 302 | + </constraints> | |
| 303 | + </view> | |
| 304 | + </subviews> | |
| 305 | + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | |
| 306 | + <constraints> | |
| 307 | + <constraint firstAttribute="height" constant="120" id="1Z3-Ap-Qv1"/> | |
| 308 | + <constraint firstAttribute="trailing" secondItem="ALk-sL-SXG" secondAttribute="trailing" id="2DO-V0-pH1"/> | |
| 309 | + <constraint firstItem="ORZ-El-owx" firstAttribute="top" secondItem="4Az-6N-8u4" secondAttribute="bottom" id="9ap-NH-2HO"/> | |
| 310 | + <constraint firstItem="ALk-sL-SXG" firstAttribute="top" secondItem="Kpa-HJ-7cE" secondAttribute="top" id="Lc0-Xq-rka"/> | |
| 311 | + <constraint firstItem="4Az-6N-8u4" firstAttribute="leading" secondItem="Kpa-HJ-7cE" secondAttribute="leading" id="PVG-jU-N5c"/> | |
| 312 | + <constraint firstAttribute="trailing" secondItem="ORZ-El-owx" secondAttribute="trailing" id="WYz-Kv-H08"/> | |
| 313 | + <constraint firstItem="ORZ-El-owx" firstAttribute="leading" secondItem="Kpa-HJ-7cE" secondAttribute="leading" id="a7E-Je-SkO"/> | |
| 314 | + <constraint firstAttribute="bottom" secondItem="ORZ-El-owx" secondAttribute="bottom" id="dr5-Tk-AAg"/> | |
| 315 | + <constraint firstAttribute="trailing" secondItem="4Az-6N-8u4" secondAttribute="trailing" id="wOX-wa-25X"/> | |
| 316 | + <constraint firstItem="4Az-6N-8u4" firstAttribute="top" secondItem="ALk-sL-SXG" secondAttribute="bottom" id="xgc-3W-TS2"/> | |
| 317 | + <constraint firstItem="ALk-sL-SXG" firstAttribute="leading" secondItem="Kpa-HJ-7cE" secondAttribute="leading" id="yrE-eZ-Vg4"/> | |
| 318 | + </constraints> | |
| 319 | + </view> | |
| 320 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="目標" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KTY-Ed-NJL" customClass="AutoTransLabel"> | |
| 321 | + <rect key="frame" x="10" y="178" width="70" height="30"/> | |
| 322 | + <constraints> | |
| 323 | + <constraint firstAttribute="width" constant="70" id="Zlu-jK-x6p"/> | |
| 324 | + <constraint firstAttribute="height" constant="30" id="tVk-5e-QAY"/> | |
| 325 | + </constraints> | |
| 326 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 327 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 328 | + <nil key="highlightedColor"/> | |
| 329 | + <userDefinedRuntimeAttributes> | |
| 330 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.goal"/> | |
| 331 | + </userDefinedRuntimeAttributes> | |
| 332 | + </label> | |
| 333 | + <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="hWb-vU-yVd"> | |
| 334 | + <rect key="frame" x="88" y="178" width="222" height="120"/> | |
| 335 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 336 | + <constraints> | |
| 337 | + <constraint firstAttribute="height" constant="120" id="iYo-mA-ZGR"/> | |
| 338 | + </constraints> | |
| 339 | + <fontDescription key="fontDescription" type="system" pointSize="14"/> | |
| 340 | + <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/> | |
| 341 | + <userDefinedRuntimeAttributes> | |
| 342 | + <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius"> | |
| 343 | + <integer key="value" value="10"/> | |
| 344 | + </userDefinedRuntimeAttribute> | |
| 345 | + </userDefinedRuntimeAttributes> | |
| 346 | + <connections> | |
| 347 | + <outlet property="delegate" destination="-1" id="fVh-oh-7St"/> | |
| 348 | + </connections> | |
| 349 | + </textView> | |
| 350 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="マップ" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qdi-Na-zsj" customClass="AutoTransLabel"> | |
| 351 | + <rect key="frame" x="10" y="313" width="70" height="30"/> | |
| 352 | + <constraints> | |
| 353 | + <constraint firstAttribute="height" constant="30" id="Ptf-0N-ewh"/> | |
| 354 | + <constraint firstAttribute="width" constant="70" id="mT3-FA-eev"/> | |
| 355 | + </constraints> | |
| 356 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 357 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 358 | + <nil key="highlightedColor"/> | |
| 359 | + <userDefinedRuntimeAttributes> | |
| 360 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.map"/> | |
| 361 | + </userDefinedRuntimeAttributes> | |
| 362 | + </label> | |
| 363 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1日目標" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qfU-7x-uss" customClass="AutoTransLabel"> | |
| 364 | + <rect key="frame" x="10" y="353" width="300" height="30"/> | |
| 365 | + <constraints> | |
| 366 | + <constraint firstAttribute="height" constant="30" id="9dB-8p-Wdv"/> | |
| 367 | + </constraints> | |
| 368 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 369 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 370 | + <nil key="highlightedColor"/> | |
| 371 | + <userDefinedRuntimeAttributes> | |
| 372 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.goal1day"/> | |
| 373 | + </userDefinedRuntimeAttributes> | |
| 374 | + </label> | |
| 375 | + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KEy-T1-mdK" customClass="AutoTransButton"> | |
| 376 | + <rect key="frame" x="88" y="313" width="110" height="30"/> | |
| 377 | + <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> | |
| 378 | + <constraints> | |
| 379 | + <constraint firstAttribute="height" constant="30" id="MWc-Aj-2JZ"/> | |
| 380 | + <constraint firstAttribute="width" constant="110" id="V16-pC-FRv"/> | |
| 381 | + </constraints> | |
| 382 | + <state key="normal" title="マップ作成"> | |
| 383 | + <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 384 | + </state> | |
| 385 | + <userDefinedRuntimeAttributes> | |
| 386 | + <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius"> | |
| 387 | + <integer key="value" value="5"/> | |
| 388 | + </userDefinedRuntimeAttribute> | |
| 389 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.bt.map"/> | |
| 390 | + </userDefinedRuntimeAttributes> | |
| 391 | + </button> | |
| 392 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="WALK" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3QV-Ov-PmX" customClass="AutoTransLabel"> | |
| 393 | + <rect key="frame" x="10" y="391" width="70" height="30"/> | |
| 394 | + <constraints> | |
| 395 | + <constraint firstAttribute="height" constant="30" id="GSj-Tq-AsU"/> | |
| 396 | + <constraint firstAttribute="width" constant="70" id="uIv-Ty-eR2"/> | |
| 397 | + </constraints> | |
| 398 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 399 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 400 | + <nil key="highlightedColor"/> | |
| 401 | + <userDefinedRuntimeAttributes> | |
| 402 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.walk"/> | |
| 403 | + </userDefinedRuntimeAttributes> | |
| 404 | + </label> | |
| 405 | + <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="4JZ-J2-3D9"> | |
| 406 | + <rect key="frame" x="95" y="391" width="130" height="30"/> | |
| 407 | + <constraints> | |
| 408 | + <constraint firstAttribute="height" constant="30" id="JaF-D4-zT2"/> | |
| 409 | + <constraint firstAttribute="width" constant="130" id="qCj-P5-l4y"/> | |
| 410 | + </constraints> | |
| 411 | + <nil key="textColor"/> | |
| 412 | + <fontDescription key="fontDescription" type="system" pointSize="14"/> | |
| 413 | + <textInputTraits key="textInputTraits" keyboardType="numberPad"/> | |
| 414 | + </textField> | |
| 415 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="m" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o9b-Am-GTl"> | |
| 416 | + <rect key="frame" x="240" y="391" width="70" height="30"/> | |
| 417 | + <constraints> | |
| 418 | + <constraint firstAttribute="width" constant="70" id="MN1-fg-mf1"/> | |
| 419 | + <constraint firstAttribute="height" constant="30" id="l7E-J3-Syw"/> | |
| 420 | + </constraints> | |
| 421 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 422 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 423 | + <nil key="highlightedColor"/> | |
| 424 | + <userDefinedRuntimeAttributes> | |
| 425 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.name"/> | |
| 426 | + </userDefinedRuntimeAttributes> | |
| 427 | + </label> | |
| 428 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="RUN" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bq4-nh-Cxk" customClass="AutoTransLabel"> | |
| 429 | + <rect key="frame" x="10" y="429" width="70" height="30"/> | |
| 430 | + <constraints> | |
| 431 | + <constraint firstAttribute="height" constant="30" id="MmK-Nk-eFt"/> | |
| 432 | + <constraint firstAttribute="width" constant="70" id="nuP-fj-jk2"/> | |
| 433 | + </constraints> | |
| 434 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 435 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 436 | + <nil key="highlightedColor"/> | |
| 437 | + <userDefinedRuntimeAttributes> | |
| 438 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.run"/> | |
| 439 | + </userDefinedRuntimeAttributes> | |
| 440 | + </label> | |
| 441 | + <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3aE-uP-KLS"> | |
| 442 | + <rect key="frame" x="95" y="429" width="130" height="30"/> | |
| 443 | + <constraints> | |
| 444 | + <constraint firstAttribute="height" constant="30" id="37e-2c-qka"/> | |
| 445 | + <constraint firstAttribute="width" constant="130" id="owG-Ob-QnB"/> | |
| 446 | + </constraints> | |
| 447 | + <nil key="textColor"/> | |
| 448 | + <fontDescription key="fontDescription" type="system" pointSize="14"/> | |
| 449 | + <textInputTraits key="textInputTraits" keyboardType="numberPad"/> | |
| 450 | + </textField> | |
| 451 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="m" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CGA-Xm-2ll"> | |
| 452 | + <rect key="frame" x="240" y="429" width="70" height="30"/> | |
| 453 | + <constraints> | |
| 454 | + <constraint firstAttribute="width" constant="70" id="6cf-Y6-Dwq"/> | |
| 455 | + <constraint firstAttribute="height" constant="30" id="dHv-kM-AX2"/> | |
| 456 | + </constraints> | |
| 457 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 458 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 459 | + <nil key="highlightedColor"/> | |
| 460 | + <userDefinedRuntimeAttributes> | |
| 461 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.name"/> | |
| 462 | + </userDefinedRuntimeAttributes> | |
| 463 | + </label> | |
| 464 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="BIKE" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mvZ-9L-7a8" customClass="AutoTransLabel"> | |
| 465 | + <rect key="frame" x="10" y="467" width="70" height="30"/> | |
| 466 | + <constraints> | |
| 467 | + <constraint firstAttribute="height" constant="30" id="hX2-SJ-SMG"/> | |
| 468 | + <constraint firstAttribute="width" constant="70" id="roN-jL-tXp"/> | |
| 469 | + </constraints> | |
| 470 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 471 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 472 | + <nil key="highlightedColor"/> | |
| 473 | + <userDefinedRuntimeAttributes> | |
| 474 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.bike"/> | |
| 475 | + </userDefinedRuntimeAttributes> | |
| 476 | + </label> | |
| 477 | + <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="eOi-eo-GYn"> | |
| 478 | + <rect key="frame" x="95" y="467" width="130" height="30"/> | |
| 479 | + <constraints> | |
| 480 | + <constraint firstAttribute="width" constant="130" id="SBb-jw-NHP"/> | |
| 481 | + <constraint firstAttribute="height" constant="30" id="ida-Ih-wRM"/> | |
| 482 | + </constraints> | |
| 483 | + <nil key="textColor"/> | |
| 484 | + <fontDescription key="fontDescription" type="system" pointSize="14"/> | |
| 485 | + <textInputTraits key="textInputTraits" keyboardType="numberPad"/> | |
| 486 | + </textField> | |
| 487 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="m" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="t6i-sV-ycx"> | |
| 488 | + <rect key="frame" x="240" y="467" width="70" height="30"/> | |
| 489 | + <constraints> | |
| 490 | + <constraint firstAttribute="width" constant="70" id="DoG-hb-QbI"/> | |
| 491 | + <constraint firstAttribute="height" constant="30" id="pAs-GK-YE3"/> | |
| 492 | + </constraints> | |
| 493 | + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> | |
| 494 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 495 | + <nil key="highlightedColor"/> | |
| 496 | + <userDefinedRuntimeAttributes> | |
| 497 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.lbl.name"/> | |
| 498 | + </userDefinedRuntimeAttributes> | |
| 499 | + </label> | |
| 500 | + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sef-8T-0hQ" customClass="AutoTransButton"> | |
| 501 | + <rect key="frame" x="10" y="509" width="300" height="30"/> | |
| 502 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 503 | + <constraints> | |
| 504 | + <constraint firstAttribute="height" constant="30" id="8XP-Y1-hlJ"/> | |
| 505 | + </constraints> | |
| 506 | + <state key="normal" title="グループを作成する"> | |
| 507 | + <color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/> | |
| 508 | + </state> | |
| 509 | + <userDefinedRuntimeAttributes> | |
| 510 | + <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius"> | |
| 511 | + <integer key="value" value="5"/> | |
| 512 | + </userDefinedRuntimeAttribute> | |
| 513 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.createGr.bt.createGr"/> | |
| 514 | + </userDefinedRuntimeAttributes> | |
| 515 | + <connections> | |
| 516 | + <action selector="clickCreateGroup:" destination="-1" eventType="touchUpInside" id="n8x-KR-til"/> | |
| 517 | + </connections> | |
| 518 | + </button> | |
| 519 | + </subviews> | |
| 520 | + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | |
| 521 | + <constraints> | |
| 522 | + <constraint firstItem="KTY-Ed-NJL" firstAttribute="leading" secondItem="9w1-87-U1W" secondAttribute="leading" constant="10" id="08M-tc-J6o"/> | |
| 523 | + <constraint firstItem="3QV-Ov-PmX" firstAttribute="leading" secondItem="qfU-7x-uss" secondAttribute="leading" id="1CN-mt-xv7"/> | |
| 524 | + <constraint firstItem="3aE-uP-KLS" firstAttribute="top" secondItem="bq4-nh-Cxk" secondAttribute="top" id="1YH-oa-gPy"/> | |
| 525 | + <constraint firstAttribute="trailing" secondItem="qfU-7x-uss" secondAttribute="trailing" constant="10" id="1fh-fC-Tvd"/> | |
| 526 | + <constraint firstItem="t6i-sV-ycx" firstAttribute="leading" secondItem="eOi-eo-GYn" secondAttribute="trailing" constant="15" id="2d5-8C-v4q"/> | |
| 527 | + <constraint firstItem="4JZ-J2-3D9" firstAttribute="top" secondItem="3QV-Ov-PmX" secondAttribute="top" id="2rO-Pd-t8O"/> | |
| 528 | + <constraint firstItem="t6i-sV-ycx" firstAttribute="top" secondItem="mvZ-9L-7a8" secondAttribute="top" id="4rc-co-XRr"/> | |
| 529 | + <constraint firstAttribute="trailing" secondItem="sef-8T-0hQ" secondAttribute="trailing" constant="10" id="89W-o8-uLa"/> | |
| 530 | + <constraint firstItem="qdi-Na-zsj" firstAttribute="leading" secondItem="9w1-87-U1W" secondAttribute="leading" constant="10" id="8Cr-Gt-ts7"/> | |
| 531 | + <constraint firstItem="ZtU-mt-3Ov" firstAttribute="leading" secondItem="9w1-87-U1W" secondAttribute="leading" constant="8" id="8QA-ZH-zig"/> | |
| 532 | + <constraint firstItem="KTY-Ed-NJL" firstAttribute="top" secondItem="ONn-27-HqB" secondAttribute="bottom" constant="8" id="8cI-hb-3IU"/> | |
| 533 | + <constraint firstItem="CGA-Xm-2ll" firstAttribute="leading" secondItem="3aE-uP-KLS" secondAttribute="trailing" constant="15" id="AJD-KP-oLm"/> | |
| 534 | + <constraint firstItem="qfU-7x-uss" firstAttribute="leading" secondItem="9w1-87-U1W" secondAttribute="leading" constant="10" id="Akh-2h-Y5Z"/> | |
| 535 | + <constraint firstItem="mvZ-9L-7a8" firstAttribute="leading" secondItem="qfU-7x-uss" secondAttribute="leading" id="CyJ-DC-cmk"/> | |
| 536 | + <constraint firstAttribute="trailing" secondItem="hWb-vU-yVd" secondAttribute="trailing" constant="10" id="Gpv-Cf-wmA"/> | |
| 537 | + <constraint firstItem="ONn-27-HqB" firstAttribute="leading" secondItem="9w1-87-U1W" secondAttribute="leading" constant="10" id="GqQ-jG-2Ss"/> | |
| 538 | + <constraint firstItem="Kpa-HJ-7cE" firstAttribute="top" secondItem="ONn-27-HqB" secondAttribute="top" id="I8B-QJ-8Kw"/> | |
| 539 | + <constraint firstItem="ONn-27-HqB" firstAttribute="top" secondItem="pXO-K0-vne" secondAttribute="bottom" constant="10" id="IUV-iX-zqx"/> | |
| 540 | + <constraint firstItem="pXO-K0-vne" firstAttribute="leading" secondItem="ZtU-mt-3Ov" secondAttribute="trailing" constant="10" id="JQi-T2-HRB"/> | |
| 541 | + <constraint firstItem="o9b-Am-GTl" firstAttribute="top" secondItem="3QV-Ov-PmX" secondAttribute="top" id="Osm-tS-nSE"/> | |
| 542 | + <constraint firstItem="sef-8T-0hQ" firstAttribute="top" secondItem="t6i-sV-ycx" secondAttribute="bottom" constant="12" id="PNY-xc-4go"/> | |
| 543 | + <constraint firstItem="3aE-uP-KLS" firstAttribute="leading" secondItem="bq4-nh-Cxk" secondAttribute="trailing" constant="15" id="QhW-Vx-RNc"/> | |
| 544 | + <constraint firstItem="mvZ-9L-7a8" firstAttribute="top" secondItem="bq4-nh-Cxk" secondAttribute="bottom" constant="8" id="Qu7-jT-zZM"/> | |
| 545 | + <constraint firstItem="qdi-Na-zsj" firstAttribute="top" secondItem="KTY-Ed-NJL" secondAttribute="bottom" constant="105" id="Rbx-GC-D0X"/> | |
| 546 | + <constraint firstItem="eOi-eo-GYn" firstAttribute="leading" secondItem="mvZ-9L-7a8" secondAttribute="trailing" constant="15" id="Rcg-h2-Qfa"/> | |
| 547 | + <constraint firstItem="pXO-K0-vne" firstAttribute="top" secondItem="ZtU-mt-3Ov" secondAttribute="top" id="T8M-OQ-0Wk"/> | |
| 548 | + <constraint firstItem="o9b-Am-GTl" firstAttribute="leading" secondItem="4JZ-J2-3D9" secondAttribute="trailing" constant="15" id="UyE-qx-Mtp"/> | |
| 549 | + <constraint firstItem="4JZ-J2-3D9" firstAttribute="top" secondItem="3QV-Ov-PmX" secondAttribute="top" id="aRK-i9-XKN"/> | |
| 550 | + <constraint firstItem="hWb-vU-yVd" firstAttribute="top" secondItem="Kpa-HJ-7cE" secondAttribute="bottom" constant="8" id="chw-2w-QOv"/> | |
| 551 | + <constraint firstItem="sef-8T-0hQ" firstAttribute="leading" secondItem="9w1-87-U1W" secondAttribute="leading" constant="10" id="dfN-4U-9Oc"/> | |
| 552 | + <constraint firstItem="eOi-eo-GYn" firstAttribute="top" secondItem="mvZ-9L-7a8" secondAttribute="top" id="e8C-p7-obk"/> | |
| 553 | + <constraint firstItem="bq4-nh-Cxk" firstAttribute="top" secondItem="3QV-Ov-PmX" secondAttribute="bottom" constant="8" id="gjA-dw-4j6"/> | |
| 554 | + <constraint firstItem="4JZ-J2-3D9" firstAttribute="leading" secondItem="3QV-Ov-PmX" secondAttribute="trailing" constant="15" id="hCs-KK-0oG"/> | |
| 555 | + <constraint firstItem="Kpa-HJ-7cE" firstAttribute="width" secondItem="ONn-27-HqB" secondAttribute="width" id="i0I-s6-95a"/> | |
| 556 | + <constraint firstAttribute="trailing" secondItem="pXO-K0-vne" secondAttribute="trailing" constant="10" id="j2H-Na-egE"/> | |
| 557 | + <constraint firstItem="bq4-nh-Cxk" firstAttribute="leading" secondItem="qfU-7x-uss" secondAttribute="leading" id="kTU-cF-wdS"/> | |
| 558 | + <constraint firstItem="hWb-vU-yVd" firstAttribute="leading" secondItem="KTY-Ed-NJL" secondAttribute="trailing" constant="8" id="ka5-tK-yxs"/> | |
| 559 | + <constraint firstItem="eOi-eo-GYn" firstAttribute="top" secondItem="mvZ-9L-7a8" secondAttribute="top" id="klA-2z-2Kx"/> | |
| 560 | + <constraint firstItem="3aE-uP-KLS" firstAttribute="top" secondItem="bq4-nh-Cxk" secondAttribute="top" id="pdY-Ef-eHr"/> | |
| 561 | + <constraint firstItem="3QV-Ov-PmX" firstAttribute="top" secondItem="qfU-7x-uss" secondAttribute="bottom" constant="8" id="qLb-a1-eOB"/> | |
| 562 | + <constraint firstItem="Kpa-HJ-7cE" firstAttribute="leading" secondItem="ONn-27-HqB" secondAttribute="trailing" constant="20" id="rMt-rx-zDY"/> | |
| 563 | + <constraint firstItem="KEy-T1-mdK" firstAttribute="top" secondItem="hWb-vU-yVd" secondAttribute="bottom" constant="15" id="sIJ-Rk-gj3"/> | |
| 564 | + <constraint firstItem="ZtU-mt-3Ov" firstAttribute="top" secondItem="9w1-87-U1W" secondAttribute="top" constant="10" id="tBp-C6-fjS"/> | |
| 565 | + <constraint firstItem="CGA-Xm-2ll" firstAttribute="top" secondItem="bq4-nh-Cxk" secondAttribute="top" id="uaB-yp-z16"/> | |
| 566 | + <constraint firstItem="qfU-7x-uss" firstAttribute="top" secondItem="KEy-T1-mdK" secondAttribute="bottom" constant="10" id="w4X-lJ-yL1"/> | |
| 567 | + <constraint firstAttribute="trailing" secondItem="Kpa-HJ-7cE" secondAttribute="trailing" constant="10" id="wvh-Lk-tt9"/> | |
| 568 | + <constraint firstItem="KEy-T1-mdK" firstAttribute="leading" secondItem="qdi-Na-zsj" secondAttribute="trailing" constant="8" id="xGa-CF-V9a"/> | |
| 569 | + </constraints> | |
| 570 | + </view> | |
| 571 | + </subviews> | |
| 572 | + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | |
| 573 | + <constraints> | |
| 574 | + <constraint firstItem="9w1-87-U1W" firstAttribute="leading" secondItem="aKu-bd-xMP" secondAttribute="leading" id="BLm-dD-oN3"/> | |
| 575 | + <constraint firstItem="9w1-87-U1W" firstAttribute="centerY" secondItem="aKu-bd-xMP" secondAttribute="centerY" id="DT9-CK-3ZL"/> | |
| 576 | + <constraint firstItem="9w1-87-U1W" firstAttribute="top" secondItem="aKu-bd-xMP" secondAttribute="top" id="PZC-BJ-DLV"/> | |
| 577 | + <constraint firstAttribute="trailing" secondItem="9w1-87-U1W" secondAttribute="trailing" id="RDM-mt-Fjr"/> | |
| 578 | + <constraint firstAttribute="bottom" secondItem="9w1-87-U1W" secondAttribute="bottom" id="w42-vd-D7e"/> | |
| 579 | + <constraint firstItem="9w1-87-U1W" firstAttribute="centerX" secondItem="aKu-bd-xMP" secondAttribute="centerX" id="wJD-gn-ctq"/> | |
| 580 | + </constraints> | |
| 581 | + </scrollView> | |
| 582 | + </subviews> | |
| 583 | + <color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/> | |
| 584 | + <constraints> | |
| 585 | + <constraint firstItem="aKu-bd-xMP" firstAttribute="top" secondItem="QYv-QM-Bkk" secondAttribute="bottom" id="Q7l-Ra-0wb"/> | |
| 586 | + <constraint firstAttribute="trailing" secondItem="aKu-bd-xMP" secondAttribute="trailing" id="WAl-wE-FB4"/> | |
| 587 | + <constraint firstAttribute="trailing" secondItem="QYv-QM-Bkk" secondAttribute="trailing" id="XdX-OA-ALX"/> | |
| 588 | + <constraint firstItem="aKu-bd-xMP" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="cE7-y5-LL4"/> | |
| 589 | + <constraint firstItem="QYv-QM-Bkk" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="dAn-YE-2s3"/> | |
| 590 | + <constraint firstItem="QYv-QM-Bkk" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="fFF-bj-0uk"/> | |
| 591 | + <constraint firstAttribute="bottom" secondItem="aKu-bd-xMP" secondAttribute="bottom" id="oPE-ST-BIo"/> | |
| 592 | + </constraints> | |
| 593 | + <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> | |
| 594 | + <point key="canvasLocation" x="26" y="125"/> | |
| 595 | + </view> | |
| 596 | + </objects> | |
| 597 | + <resources> | |
| 598 | + <image name="icon_menu" width="30" height="30"/> | |
| 599 | + <image name="today_back_button" width="73" height="37"/> | |
| 600 | + </resources> | |
| 601 | +</document> |
LifeLog/LifeLog/GroupDetailViewController.xib
| ... | ... | @@ -89,7 +89,7 @@ |
| 89 | 89 | <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> |
| 90 | 90 | <nil key="highlightedColor"/> |
| 91 | 91 | </label> |
| 92 | - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Bdy-dI-j47"> | |
| 92 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Bdy-dI-j47"> | |
| 93 | 93 | <rect key="frame" x="15" y="160" width="345" height="80"/> |
| 94 | 94 | <constraints> |
| 95 | 95 | <constraint firstAttribute="height" constant="80" id="jgH-57-Bae"/> |
LifeLog/LifeLog/GroupObject.h
| ... | ... | @@ -34,6 +34,7 @@ |
| 34 | 34 | |
| 35 | 35 | @property (nonatomic, strong) NSDate * createDate; |
| 36 | 36 | |
| 37 | +-(id) initWithShortData : (NSDictionary *) dict; | |
| 37 | 38 | -(id) initWithData : (NSDictionary *) dict; |
| 38 | 39 | -(id) initWithData : (NSDictionary *) dict andGroupID : (int) groupID; |
| 39 | 40 | -(void) updateDate : (GroupObject *) obj; |
LifeLog/LifeLog/GroupObject.m
| ... | ... | @@ -10,6 +10,17 @@ |
| 10 | 10 | #import "Utilities.h" |
| 11 | 11 | |
| 12 | 12 | @implementation GroupObject |
| 13 | + | |
| 14 | +-(id) initWithShortData : (NSDictionary *) dict { | |
| 15 | + if([dict objectForKey:@"id"] != nil) { | |
| 16 | + self.groupID = [dict[@"id"] intValue]; | |
| 17 | + } | |
| 18 | + if([dict objectForKey:@"group_name"] != nil) { | |
| 19 | + self.name = dict[@"group_name"]; | |
| 20 | + } | |
| 21 | + return self; | |
| 22 | +} | |
| 23 | + | |
| 13 | 24 | -(id) initWithData : (NSDictionary *) dict { |
| 14 | 25 | if([dict objectForKey:@"group_id"] != nil) { |
| 15 | 26 | self.groupID = [dict[@"group_id"] intValue]; |
| ... | ... | @@ -17,7 +28,7 @@ |
| 17 | 28 | if([dict objectForKey:@"group_avatar"] != nil) { |
| 18 | 29 | self.avatar = dict[@"group_avatar"]; |
| 19 | 30 | } |
| 20 | - if([dict objectForKey:@"created_at"] != nil) { | |
| 31 | + if([dict objectForKey:@"created_at"] != nil && ![[dict objectForKey:@"created_at"] isKindOfClass:[NSNull class]]) { | |
| 21 | 32 | NSString *dateString = dict[@"created_at"]; |
| 22 | 33 | self.createDate = [Utilities dateFromString:dateString withFormat:@"yyyy-MM-dd hh:mm:ss"]; |
| 23 | 34 | } |
LifeLog/LifeLog/Localizable.strings
No preview for this file type
LifeLog/LifeLog/MyGroupViewController.h
| ... | ... | @@ -0,0 +1,32 @@ |
| 1 | +// | |
| 2 | +// MyGroupViewController.h | |
| 3 | +// LifeLog | |
| 4 | +// | |
| 5 | +// Created by nvtu on 8/20/17. | |
| 6 | +// Copyright © 2017 PhongNV. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import <UIKit/UIKit.h> | |
| 10 | +#import "BaseTableViewController.h" | |
| 11 | +#import "AutoTransButton.h" | |
| 12 | +#import "Entities.h" | |
| 13 | + | |
| 14 | +@interface MyGroupViewController : BaseTableViewController { | |
| 15 | + NSMutableArray *_curListGrp; | |
| 16 | + GroupObject *_curGroup; | |
| 17 | + BOOL isMemberList; | |
| 18 | +} | |
| 19 | + | |
| 20 | +@property (weak, nonatomic) IBOutlet UITableView *tableGrp; | |
| 21 | + | |
| 22 | +@property (weak, nonatomic) IBOutlet UILabel *lblGroupName; | |
| 23 | +@property (weak, nonatomic) IBOutlet UILabel *lblActiveMode; | |
| 24 | +@property (weak, nonatomic) IBOutlet UILabel *lblGoal; | |
| 25 | +@property (weak, nonatomic) IBOutlet UIButton *btShowGrp; | |
| 26 | +@property (weak, nonatomic) IBOutlet AutoTransButton *btSwitch; | |
| 27 | + | |
| 28 | +- (IBAction)clickBack:(id)sender; | |
| 29 | +- (IBAction)clickShowGrp:(id)sender; | |
| 30 | +- (IBAction)clickSwitch:(id)sender; | |
| 31 | + | |
| 32 | +@end |
LifeLog/LifeLog/MyGroupViewController.m
| ... | ... | @@ -0,0 +1,251 @@ |
| 1 | +// | |
| 2 | +// MyGroupViewController.m | |
| 3 | +// LifeLog | |
| 4 | +// | |
| 5 | +// Created by nvtu on 8/20/17. | |
| 6 | +// Copyright © 2017 PhongNV. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "MyGroupViewController.h" | |
| 10 | +#import <SDWebImage/UIImageView+WebCache.h> | |
| 11 | + | |
| 12 | +#import "Utilities.h" | |
| 13 | +#import "ServerAPI.h" | |
| 14 | +#import "SNSRecentTopicTableViewCell.h" | |
| 15 | + | |
| 16 | +@interface MyGroupViewController () | |
| 17 | + | |
| 18 | +@end | |
| 19 | + | |
| 20 | +@implementation MyGroupViewController | |
| 21 | + | |
| 22 | +- (void)viewDidLoad { | |
| 23 | + [super viewDidLoad]; | |
| 24 | + isMemberList = false; | |
| 25 | + _curListGrp = [[NSMutableArray alloc] init]; | |
| 26 | + [self.tableBase registerNib:[UINib nibWithNibName:@"SNSRecentTopicTableViewCell" bundle:nil] forCellReuseIdentifier:@"RecentTopicCell"]; | |
| 27 | + | |
| 28 | + [self requestGroupList]; | |
| 29 | + // Do any additional setup after loading the view from its nib. | |
| 30 | +} | |
| 31 | + | |
| 32 | +- (void)didReceiveMemoryWarning { | |
| 33 | + [super didReceiveMemoryWarning]; | |
| 34 | + // Dispose of any resources that can be recreated. | |
| 35 | +} | |
| 36 | + | |
| 37 | +- (void)setupView { | |
| 38 | + if(_curGroup != nil) { | |
| 39 | + [self.lblGoal setText:_curGroup.goal]; | |
| 40 | + NSString *mode = @""; | |
| 41 | + if(_curGroup.runMode) { | |
| 42 | + mode = [mode stringByAppendingString:NSLocalizedString(@"lifelog.grDetail.mode.running", nil)]; | |
| 43 | + mode = [mode stringByAppendingString:@"\n"]; | |
| 44 | + } | |
| 45 | + if(_curGroup.walkMode) { | |
| 46 | + mode = [mode stringByAppendingString:NSLocalizedString(@"lifelog.grDetail.mode.walking", nil)]; | |
| 47 | + mode = [mode stringByAppendingString:@"\n"]; | |
| 48 | + } | |
| 49 | + if(_curGroup.bikeMode) { | |
| 50 | + mode = [mode stringByAppendingString:NSLocalizedString(@"lifelog.grDetail.mode.bike", nil)]; | |
| 51 | + mode = [mode stringByAppendingString:@"\n"]; | |
| 52 | + } | |
| 53 | + if(_curGroup.stepMode) { | |
| 54 | + mode = [mode stringByAppendingString:NSLocalizedString(@"lifelog.grDetail.mode.step", nil)]; | |
| 55 | + mode = [mode stringByAppendingString:@"\n"]; | |
| 56 | + } | |
| 57 | + if(_curGroup.beginMode) { | |
| 58 | + mode = [mode stringByAppendingString:NSLocalizedString(@"lifelog.grDetail.mode.begin", nil)]; | |
| 59 | + mode = [mode stringByAppendingString:@"\n"]; | |
| 60 | + } | |
| 61 | + if(_curGroup.gymMode) { | |
| 62 | + mode = [mode stringByAppendingString:NSLocalizedString(@"lifelog.grDetail.mode.gym", nil)]; | |
| 63 | + mode = [mode stringByAppendingString:@"\n"]; | |
| 64 | + } | |
| 65 | + NSRange range = [mode rangeOfString:@"\n" options:NSBackwardsSearch]; | |
| 66 | + if(range.length > 0) { | |
| 67 | + mode = [mode stringByReplacingOccurrencesOfString:@"\n" withString:@"" options:NSBackwardsSearch range:range]; | |
| 68 | + } | |
| 69 | + self.lblActiveMode.text = mode; | |
| 70 | + } | |
| 71 | +} | |
| 72 | + | |
| 73 | +#pragma mark IBAction | |
| 74 | + | |
| 75 | +- (IBAction)clickBack:(id)sender { | |
| 76 | + [self.navigationController popViewControllerAnimated:true]; | |
| 77 | +} | |
| 78 | + | |
| 79 | +- (IBAction)clickShowGrp:(id)sender { | |
| 80 | + self.tableGrp.hidden = !self.tableGrp.isHidden; | |
| 81 | +} | |
| 82 | + | |
| 83 | +- (IBAction)clickSwitch:(id)sender { | |
| 84 | + isMemberList = !isMemberList; | |
| 85 | + if(isMemberList) { | |
| 86 | + [sender setTitle:NSLocalizedString(@"lifelog.grDetail.bt.viewTweet", nil) forState:UIControlStateNormal]; | |
| 87 | + } | |
| 88 | + else { | |
| 89 | + [sender setTitle:NSLocalizedString(@"lifelog.grDetail.bt.viewMem", nil) forState:UIControlStateNormal]; | |
| 90 | + } | |
| 91 | + [sender setUserInteractionEnabled:false]; | |
| 92 | + [self resetData]; | |
| 93 | +} | |
| 94 | + | |
| 95 | +#pragma mark UITableView Delegate | |
| 96 | +-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { | |
| 97 | + if(tableView == self.tableGrp) | |
| 98 | + return 1; | |
| 99 | + else | |
| 100 | + return [super numberOfSectionsInTableView:tableView]; | |
| 101 | +} | |
| 102 | + | |
| 103 | +- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |
| 104 | + if(tableView == self.tableGrp) | |
| 105 | + return _curListGrp.count; | |
| 106 | + else | |
| 107 | + return [super tableView:tableView numberOfRowsInSection:section]; | |
| 108 | +} | |
| 109 | + | |
| 110 | +- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 111 | + if(tableView == self.tableGrp) { | |
| 112 | + UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"GroupCell"]; | |
| 113 | + if(cell == nil) { | |
| 114 | + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"GroupCell"]; | |
| 115 | + } | |
| 116 | + GroupObject *object = [_curListGrp objectAtIndex:indexPath.row]; | |
| 117 | + cell.textLabel.text = object.name; | |
| 118 | + return cell; | |
| 119 | + } | |
| 120 | + else { | |
| 121 | + SNSRecentTopicTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"RecentTopicCell"]; | |
| 122 | + if(isMemberList) { | |
| 123 | + MemberObject *object = [_curDataList objectAtIndex:indexPath.row]; | |
| 124 | + if(object.avatar && ![object.avatar isKindOfClass:[NSNull class]]) { | |
| 125 | + [cell.imgAvatar sd_setImageWithURL:[NSURL URLWithString:[Utilities getImageLink:object.avatar]]]; | |
| 126 | + } | |
| 127 | + else { | |
| 128 | + [cell.imgAvatar setImage:[UIImage imageNamed:@"avatar_default"]]; | |
| 129 | + } | |
| 130 | + cell.lblUsername.text = @""; | |
| 131 | + cell.lblDateTime.text = @""; | |
| 132 | + cell.lblDes.text = object.userName; | |
| 133 | + cell.lblMode.text = @""; | |
| 134 | + cell.lblDistance.text = @""; | |
| 135 | + cell.lblDuration.text = @""; | |
| 136 | + } | |
| 137 | + else { | |
| 138 | + TweetObject *object = [_curDataList objectAtIndex:indexPath.row]; | |
| 139 | + if(object.avatar && ![object.avatar isKindOfClass:[NSNull class]]) { | |
| 140 | + [cell.imgAvatar sd_setImageWithURL:[NSURL URLWithString:[Utilities getImageLink:object.avatar]]]; | |
| 141 | + } | |
| 142 | + else { | |
| 143 | + [cell.imgAvatar setImage:[UIImage imageNamed:@"avatar_default"]]; | |
| 144 | + } | |
| 145 | + cell.lblDateTime.text = [Utilities stringFromDate:object.createDate withFormat:@"YYYY/MM/dd hh:mm"]; | |
| 146 | + cell.lblUsername.text = object.userName; | |
| 147 | + cell.lblDes.text = object.content; | |
| 148 | + cell.lblMode.text = object.mode; | |
| 149 | + cell.lblDistance.text = [NSString stringWithFormat:@"%.0f m", object.distance]; | |
| 150 | + cell.lblDuration.text = object.time; | |
| 151 | + } | |
| 152 | + return cell; | |
| 153 | + } | |
| 154 | +} | |
| 155 | + | |
| 156 | +- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 157 | + if(tableView == self.tableGrp) { | |
| 158 | + return; | |
| 159 | + } | |
| 160 | + [super tableView:tableView willDisplayCell:cell forRowAtIndexPath:indexPath]; | |
| 161 | +} | |
| 162 | + | |
| 163 | +-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 164 | + if(tableView == self.tableGrp) { | |
| 165 | + [tableView setHidden:true]; | |
| 166 | + [self resetGroupData:indexPath.row]; | |
| 167 | + } | |
| 168 | +} | |
| 169 | + | |
| 170 | +#pragma mark Private Function | |
| 171 | + | |
| 172 | +- (void) resetGroupData : (int) index { | |
| 173 | + _curGroup = [_curListGrp objectAtIndex:index]; | |
| 174 | + self.lblGroupName.text = _curGroup.name; | |
| 175 | + [_curDataList removeAllObjects]; | |
| 176 | + [self.tableBase reloadData]; | |
| 177 | + [self requestGroupDetail]; | |
| 178 | +} | |
| 179 | + | |
| 180 | +- (void) requestGroupList { | |
| 181 | + NSString * token = [[NSUserDefaults standardUserDefaults] stringForKey:kToken]; | |
| 182 | + MBProgressHUD *hudView = [MBProgressHUD showHUDAddedTo:self.view animated:true]; | |
| 183 | + [[ServerAPI server] requestGroupList:token CompletionHandler:^(NSArray *array, NSError *error) { | |
| 184 | + if(error == nil) { | |
| 185 | + [_curListGrp removeAllObjects]; | |
| 186 | + [_curListGrp addObjectsFromArray:array]; | |
| 187 | + MyGroupViewController __weak *weakSelf = self; | |
| 188 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 189 | + [hudView hideAnimated:true]; | |
| 190 | + [self.tableGrp reloadData]; | |
| 191 | + if(_curListGrp.count > 0) { | |
| 192 | + [weakSelf resetGroupData:0]; | |
| 193 | + } | |
| 194 | + else { | |
| 195 | + weakSelf.lblGroupName.text = @"No Group"; | |
| 196 | + } | |
| 197 | + [weakSelf.btShowGrp setEnabled:(_curListGrp.count > 0)]; | |
| 198 | + }); | |
| 199 | + } | |
| 200 | + }]; | |
| 201 | +} | |
| 202 | + | |
| 203 | +- (void) requestGroupDetail { | |
| 204 | + NSString * token = [[NSUserDefaults standardUserDefaults] stringForKey:kToken]; | |
| 205 | + MBProgressHUD *hudView = [MBProgressHUD showHUDAddedTo:self.view animated:true]; | |
| 206 | + [[ServerAPI server] getGroupDetail:token withGroupID:_curGroup.groupID CompletionHandler:^(GroupObject *object, NSError *error) { | |
| 207 | + MyGroupViewController __weak *weakSelf = self; | |
| 208 | + [_curGroup updateDate:object]; | |
| 209 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 210 | + [hudView hideAnimated:true]; | |
| 211 | + [weakSelf setupView]; | |
| 212 | + [weakSelf callRequestToUpdateData]; | |
| 213 | + }); | |
| 214 | + }]; | |
| 215 | +} | |
| 216 | + | |
| 217 | +-(void) callRequestToUpdateData { | |
| 218 | + [super callRequestToUpdateData]; | |
| 219 | + | |
| 220 | + NSString * token = [[NSUserDefaults standardUserDefaults] stringForKey:kToken]; | |
| 221 | + MBProgressHUD *hudView = nil; | |
| 222 | + if(_curPage == 1 && !self.refreshControl.isRefreshing) { | |
| 223 | + hudView = [MBProgressHUD showHUDAddedTo:self.view animated:true]; | |
| 224 | + } | |
| 225 | + if(isMemberList) { | |
| 226 | + [[ServerAPI server] requestMemberList:token groupID:_curGroup.groupID withPage:_curPage CompletionHandler:^(NSArray *array, NSError *error){ | |
| 227 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 228 | + if(hudView != nil) { | |
| 229 | + [hudView hideAnimated:true]; | |
| 230 | + } | |
| 231 | + }); | |
| 232 | + MyGroupViewController __weak *weakSelf = self; | |
| 233 | + [weakSelf updateTableData:array error:error]; | |
| 234 | + [weakSelf.btSwitch setUserInteractionEnabled:true]; | |
| 235 | + }]; | |
| 236 | + } | |
| 237 | + else { | |
| 238 | + [[ServerAPI server] requestTweetsList:token groupID:_curGroup.groupID withPage:_curPage CompletionHandler:^(NSArray *array, NSError *error){ | |
| 239 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 240 | + if(hudView != nil) { | |
| 241 | + [hudView hideAnimated:true]; | |
| 242 | + } | |
| 243 | + }); | |
| 244 | + MyGroupViewController __weak *weakSelf = self; | |
| 245 | + [weakSelf updateTableData:array error:error]; | |
| 246 | + [weakSelf.btSwitch setUserInteractionEnabled:true]; | |
| 247 | + }]; | |
| 248 | + } | |
| 249 | +} | |
| 250 | + | |
| 251 | +@end |
LifeLog/LifeLog/MyGroupViewController.xib
| ... | ... | @@ -0,0 +1,241 @@ |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12118" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> | |
| 3 | + <device id="retina4_7" orientation="portrait"> | |
| 4 | + <adaptation id="fullscreen"/> | |
| 5 | + </device> | |
| 6 | + <dependencies> | |
| 7 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/> | |
| 8 | + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | |
| 9 | + </dependencies> | |
| 10 | + <objects> | |
| 11 | + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MyGroupViewController"> | |
| 12 | + <connections> | |
| 13 | + <outlet property="btShowGrp" destination="MvK-5R-njL" id="bcb-N7-jbu"/> | |
| 14 | + <outlet property="btSwitch" destination="eBu-7L-nsx" id="od6-v0-6eh"/> | |
| 15 | + <outlet property="lblActiveMode" destination="P1r-ft-imP" id="WRV-YQ-1IY"/> | |
| 16 | + <outlet property="lblGoal" destination="ftA-wa-19F" id="Ziv-cg-at5"/> | |
| 17 | + <outlet property="lblGroupName" destination="xXv-SO-m4h" id="yGe-lh-RC3"/> | |
| 18 | + <outlet property="tableBase" destination="ubS-v9-zCa" id="gea-9H-gpI"/> | |
| 19 | + <outlet property="tableGrp" destination="dtD-J5-dze" id="ahq-Cd-85X"/> | |
| 20 | + <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> | |
| 21 | + </connections> | |
| 22 | + </placeholder> | |
| 23 | + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | |
| 24 | + <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> | |
| 25 | + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | |
| 26 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |
| 27 | + <subviews> | |
| 28 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vxT-xe-7mV" userLabel="ViewHeader"> | |
| 29 | + <rect key="frame" x="0.0" y="0.0" width="375" height="46"/> | |
| 30 | + <subviews> | |
| 31 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SNS" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Txe-1I-61m" customClass="AutoTransLabel"> | |
| 32 | + <rect key="frame" x="0.0" y="0.0" width="375" height="46"/> | |
| 33 | + <fontDescription key="fontDescription" type="system" pointSize="17"/> | |
| 34 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 35 | + <nil key="highlightedColor"/> | |
| 36 | + <userDefinedRuntimeAttributes> | |
| 37 | + <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.grDetail.title"/> | |
| 38 | + </userDefinedRuntimeAttributes> | |
| 39 | + </label> | |
| 40 | + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DjI-qB-WTG"> | |
| 41 | + <rect key="frame" x="0.0" y="5" width="70" height="36"/> | |
| 42 | + <constraints> | |
| 43 | + <constraint firstAttribute="width" constant="70" id="Q1G-tI-sgx"/> | |
| 44 | + </constraints> | |
| 45 | + <state key="normal" image="today_back_button"/> | |
| 46 | + <connections> | |
| 47 | + <action selector="clickBack:" destination="-1" eventType="touchUpInside" id="93y-uZ-J2W"/> | |
| 48 | + </connections> | |
| 49 | + </button> | |
| 50 | + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7gh-nf-sKZ"> | |
| 51 | + <rect key="frame" x="330" y="0.0" width="45" height="46"/> | |
| 52 | + <constraints> | |
| 53 | + <constraint firstAttribute="width" constant="45" id="Vw3-60-kvV"/> | |
| 54 | + </constraints> | |
| 55 | + <state key="normal" image="icon_menu"/> | |
| 56 | + </button> | |
| 57 | + </subviews> | |
| 58 | + <color key="backgroundColor" red="0.098039215690000001" green="0.098039215690000001" blue="0.098039215690000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |
| 59 | + <constraints> | |
| 60 | + <constraint firstAttribute="trailing" secondItem="7gh-nf-sKZ" secondAttribute="trailing" id="2JD-YU-WS2"/> | |
| 61 | + <constraint firstItem="Txe-1I-61m" firstAttribute="leading" secondItem="vxT-xe-7mV" secondAttribute="leading" id="30c-J3-6ba"/> | |
| 62 | + <constraint firstAttribute="bottom" secondItem="7gh-nf-sKZ" secondAttribute="bottom" id="61g-Gv-ka0"/> | |
| 63 | + <constraint firstAttribute="bottom" secondItem="Txe-1I-61m" secondAttribute="bottom" id="BZZ-wj-MGj"/> | |
| 64 | + <constraint firstItem="7gh-nf-sKZ" firstAttribute="top" secondItem="vxT-xe-7mV" secondAttribute="top" id="DKT-Ea-U3k"/> | |
| 65 | + <constraint firstAttribute="trailing" secondItem="Txe-1I-61m" secondAttribute="trailing" id="WA1-1W-49C"/> | |
| 66 | + <constraint firstItem="DjI-qB-WTG" firstAttribute="leading" secondItem="vxT-xe-7mV" secondAttribute="leading" id="tA3-JF-Kjj"/> | |
| 67 | + <constraint firstAttribute="bottom" secondItem="DjI-qB-WTG" secondAttribute="bottom" constant="5" id="uFc-I1-M2c"/> | |
| 68 | + <constraint firstItem="Txe-1I-61m" firstAttribute="top" secondItem="vxT-xe-7mV" secondAttribute="top" id="ucO-rK-wAV"/> | |
| 69 | + <constraint firstItem="DjI-qB-WTG" firstAttribute="top" secondItem="vxT-xe-7mV" secondAttribute="top" constant="5" id="vR3-xv-3hD"/> | |
| 70 | + <constraint firstAttribute="height" constant="46" id="yIJ-Mu-bPA"/> | |
| 71 | + </constraints> | |
| 72 | + </view> | |
| 73 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hhh-nO-yn5"> | |
| 74 | + <rect key="frame" x="15" y="54" width="345" height="36"/> | |
| 75 | + <subviews> | |
| 76 | + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MvK-5R-njL"> | |
| 77 | + <rect key="frame" x="289" y="0.0" width="56" height="36"/> | |
| 78 | + <constraints> | |
| 79 | + <constraint firstAttribute="width" constant="56" id="l8Q-On-RNy"/> | |
| 80 | + </constraints> | |
| 81 | + <state key="normal" backgroundImage="arrow_down"/> | |
| 82 | + <connections> | |
| 83 | + <action selector="clickShowGrp:" destination="-1" eventType="touchUpInside" id="yfd-Yu-fTF"/> | |
| 84 | + </connections> | |
| 85 | + </button> | |
| 86 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xXv-SO-m4h"> | |
| 87 | + <rect key="frame" x="5" y="0.0" width="284" height="36"/> | |
| 88 | + <fontDescription key="fontDescription" type="system" pointSize="16"/> | |
| 89 | + <nil key="textColor"/> | |
| 90 | + <nil key="highlightedColor"/> | |
| 91 | + </label> | |
| 92 | + </subviews> | |
| 93 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 94 | + <constraints> | |
| 95 | + <constraint firstAttribute="trailing" secondItem="MvK-5R-njL" secondAttribute="trailing" id="IS8-5J-ypb"/> | |
| 96 | + <constraint firstAttribute="bottom" secondItem="MvK-5R-njL" secondAttribute="bottom" id="IVS-f9-RjH"/> | |
| 97 | + <constraint firstAttribute="bottom" secondItem="xXv-SO-m4h" secondAttribute="bottom" id="Ino-7v-CKz"/> | |
| 98 | + <constraint firstItem="MvK-5R-njL" firstAttribute="top" secondItem="hhh-nO-yn5" secondAttribute="top" id="NlH-tz-ByC"/> | |
| 99 | + <constraint firstAttribute="height" constant="36" id="O8T-vH-tg6"/> | |
| 100 | + <constraint firstItem="MvK-5R-njL" firstAttribute="leading" secondItem="xXv-SO-m4h" secondAttribute="trailing" id="V51-fg-KCf"/> | |
| 101 | + <constraint firstItem="xXv-SO-m4h" firstAttribute="leading" secondItem="hhh-nO-yn5" secondAttribute="leading" constant="5" id="eY6-uq-qWx"/> | |
| 102 | + <constraint firstItem="xXv-SO-m4h" firstAttribute="top" secondItem="hhh-nO-yn5" secondAttribute="top" id="l3a-Th-4Kb"/> | |
| 103 | + </constraints> | |
| 104 | + <userDefinedRuntimeAttributes> | |
| 105 | + <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius"> | |
| 106 | + <integer key="value" value="5"/> | |
| 107 | + </userDefinedRuntimeAttribute> | |
| 108 | + </userDefinedRuntimeAttributes> | |
| 109 | + </view> | |
| 110 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SNe-1B-nwV"> | |
| 111 | + <rect key="frame" x="15" y="105" width="345" height="105"/> | |
| 112 | + <subviews> | |
| 113 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="グループ VMAP アメリカルート61完走" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hyY-rU-WJx"> | |
| 114 | + <rect key="frame" x="8" y="8" width="329" height="20"/> | |
| 115 | + <constraints> | |
| 116 | + <constraint firstAttribute="height" constant="20" id="dx4-Lw-gRP"/> | |
| 117 | + </constraints> | |
| 118 | + <fontDescription key="fontDescription" type="system" pointSize="15"/> | |
| 119 | + <nil key="textColor"/> | |
| 120 | + <nil key="highlightedColor"/> | |
| 121 | + </label> | |
| 122 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="P1r-ft-imP"> | |
| 123 | + <rect key="frame" x="8" y="36" width="155" height="61"/> | |
| 124 | + <constraints> | |
| 125 | + <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="61" id="6m3-4u-yjQ"/> | |
| 126 | + <constraint firstAttribute="width" constant="155" id="bJa-4P-B84"/> | |
| 127 | + </constraints> | |
| 128 | + <fontDescription key="fontDescription" type="system" pointSize="15"/> | |
| 129 | + <nil key="textColor"/> | |
| 130 | + <nil key="highlightedColor"/> | |
| 131 | + </label> | |
| 132 | + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fXA-Zh-ABB" customClass="AutoTransButton"> | |
| 133 | + <rect key="frame" x="171" y="67" width="166" height="30"/> | |
| 134 | + <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> | |
| 135 | + <constraints> | |
| 136 | + <constraint firstAttribute="height" constant="30" id="4bu-TU-hhR"/> | |
| 137 | + <constraint firstAttribute="width" constant="166" id="hcm-Nd-TE4"/> | |
| 138 | + </constraints> | |
| 139 | + <state key="normal" title="VMAP"> | |
| 140 | + <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 141 | + </state> | |
| 142 | + <userDefinedRuntimeAttributes> | |
| 143 | + <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius"> | |
| 144 | + <integer key="value" value="10"/> | |
| 145 | + </userDefinedRuntimeAttribute> | |
| 146 | + </userDefinedRuntimeAttributes> | |
| 147 | + </button> | |
| 148 | + </subviews> | |
| 149 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 150 | + <constraints> | |
| 151 | + <constraint firstItem="P1r-ft-imP" firstAttribute="leading" secondItem="SNe-1B-nwV" secondAttribute="leading" constant="8" id="PCO-gJ-aUC"/> | |
| 152 | + <constraint firstItem="P1r-ft-imP" firstAttribute="top" secondItem="hyY-rU-WJx" secondAttribute="bottom" constant="8" id="TFE-rm-YuC"/> | |
| 153 | + <constraint firstItem="hyY-rU-WJx" firstAttribute="leading" secondItem="SNe-1B-nwV" secondAttribute="leading" constant="8" id="Urc-sV-0AF"/> | |
| 154 | + <constraint firstAttribute="bottom" secondItem="P1r-ft-imP" secondAttribute="bottom" constant="8" id="YYl-bN-XH2"/> | |
| 155 | + <constraint firstItem="hyY-rU-WJx" firstAttribute="top" secondItem="SNe-1B-nwV" secondAttribute="top" constant="8" id="a68-ja-X4x"/> | |
| 156 | + <constraint firstAttribute="trailing" secondItem="fXA-Zh-ABB" secondAttribute="trailing" constant="8" id="hNz-cE-JQc"/> | |
| 157 | + <constraint firstAttribute="trailing" secondItem="hyY-rU-WJx" secondAttribute="trailing" constant="8" id="tHp-Xw-Emj"/> | |
| 158 | + <constraint firstAttribute="bottom" secondItem="fXA-Zh-ABB" secondAttribute="bottom" constant="8" id="vRs-Al-kct"/> | |
| 159 | + </constraints> | |
| 160 | + </view> | |
| 161 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ftA-wa-19F"> | |
| 162 | + <rect key="frame" x="15" y="218" width="345" height="100"/> | |
| 163 | + <constraints> | |
| 164 | + <constraint firstAttribute="height" constant="100" id="sns-tn-c0d"/> | |
| 165 | + </constraints> | |
| 166 | + <fontDescription key="fontDescription" type="system" pointSize="17"/> | |
| 167 | + <nil key="textColor"/> | |
| 168 | + <nil key="highlightedColor"/> | |
| 169 | + </label> | |
| 170 | + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eBu-7L-nsx" customClass="AutoTransButton"> | |
| 171 | + <rect key="frame" x="194" y="328" width="166" height="30"/> | |
| 172 | + <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> | |
| 173 | + <constraints> | |
| 174 | + <constraint firstAttribute="width" constant="166" id="Rrn-lf-raV"/> | |
| 175 | + <constraint firstAttribute="height" constant="30" id="y2E-RH-aan"/> | |
| 176 | + </constraints> | |
| 177 | + <state key="normal" title="メンバー"> | |
| 178 | + <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 179 | + </state> | |
| 180 | + <userDefinedRuntimeAttributes> | |
| 181 | + <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius"> | |
| 182 | + <integer key="value" value="10"/> | |
| 183 | + </userDefinedRuntimeAttribute> | |
| 184 | + </userDefinedRuntimeAttributes> | |
| 185 | + <connections> | |
| 186 | + <action selector="clickSwitch:" destination="-1" eventType="touchUpInside" id="B7a-Hl-IlY"/> | |
| 187 | + </connections> | |
| 188 | + </button> | |
| 189 | + <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="none" rowHeight="100" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="ubS-v9-zCa"> | |
| 190 | + <rect key="frame" x="0.0" y="373" width="375" height="244"/> | |
| 191 | + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | |
| 192 | + <connections> | |
| 193 | + <outlet property="dataSource" destination="-1" id="HIG-w5-mXN"/> | |
| 194 | + <outlet property="delegate" destination="-1" id="GIa-bX-Av9"/> | |
| 195 | + </connections> | |
| 196 | + </tableView> | |
| 197 | + <tableView hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="35" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="dtD-J5-dze"> | |
| 198 | + <rect key="frame" x="15" y="91" width="345" height="140"/> | |
| 199 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 200 | + <constraints> | |
| 201 | + <constraint firstAttribute="height" constant="140" id="CrG-Ni-f6b"/> | |
| 202 | + </constraints> | |
| 203 | + <connections> | |
| 204 | + <outlet property="dataSource" destination="-1" id="2bH-mm-vKH"/> | |
| 205 | + <outlet property="delegate" destination="-1" id="9tr-mh-5Ir"/> | |
| 206 | + </connections> | |
| 207 | + </tableView> | |
| 208 | + </subviews> | |
| 209 | + <color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/> | |
| 210 | + <constraints> | |
| 211 | + <constraint firstItem="ftA-wa-19F" firstAttribute="top" secondItem="SNe-1B-nwV" secondAttribute="bottom" constant="8" id="4iN-BW-Eaa"/> | |
| 212 | + <constraint firstItem="vxT-xe-7mV" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="5np-jI-7iK"/> | |
| 213 | + <constraint firstAttribute="trailing" secondItem="eBu-7L-nsx" secondAttribute="trailing" constant="15" id="AkN-Cv-ULu"/> | |
| 214 | + <constraint firstItem="SNe-1B-nwV" firstAttribute="top" secondItem="hhh-nO-yn5" secondAttribute="bottom" constant="15" id="BL0-Cv-jlz"/> | |
| 215 | + <constraint firstItem="ubS-v9-zCa" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="Dt8-xl-lI8"/> | |
| 216 | + <constraint firstAttribute="trailing" secondItem="SNe-1B-nwV" secondAttribute="trailing" constant="15" id="QiL-ts-ryc"/> | |
| 217 | + <constraint firstItem="dtD-J5-dze" firstAttribute="top" secondItem="hhh-nO-yn5" secondAttribute="bottom" constant="1" id="QzJ-aS-NQ0"/> | |
| 218 | + <constraint firstItem="SNe-1B-nwV" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="15" id="T4b-fq-Gc8"/> | |
| 219 | + <constraint firstAttribute="trailing" secondItem="hhh-nO-yn5" secondAttribute="trailing" constant="15" id="YB3-2b-4yx"/> | |
| 220 | + <constraint firstAttribute="bottom" secondItem="ubS-v9-zCa" secondAttribute="bottom" constant="50" id="ZNH-0B-rWz"/> | |
| 221 | + <constraint firstItem="ftA-wa-19F" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="15" id="bnx-K2-jVS"/> | |
| 222 | + <constraint firstAttribute="trailing" secondItem="ubS-v9-zCa" secondAttribute="trailing" id="bsK-wi-RYU"/> | |
| 223 | + <constraint firstAttribute="trailing" secondItem="vxT-xe-7mV" secondAttribute="trailing" id="eld-fc-V95"/> | |
| 224 | + <constraint firstItem="hhh-nO-yn5" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="15" id="gDN-Hr-2vm"/> | |
| 225 | + <constraint firstItem="vxT-xe-7mV" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="iBy-99-6Ky"/> | |
| 226 | + <constraint firstItem="dtD-J5-dze" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="15" id="ie5-ll-WkY"/> | |
| 227 | + <constraint firstAttribute="trailing" secondItem="ftA-wa-19F" secondAttribute="trailing" constant="15" id="jaz-L9-glj"/> | |
| 228 | + <constraint firstItem="eBu-7L-nsx" firstAttribute="top" secondItem="ftA-wa-19F" secondAttribute="bottom" constant="10" id="lF2-iL-Xa6"/> | |
| 229 | + <constraint firstItem="ubS-v9-zCa" firstAttribute="top" secondItem="eBu-7L-nsx" secondAttribute="bottom" constant="15" id="ofF-9P-pq9"/> | |
| 230 | + <constraint firstItem="hhh-nO-yn5" firstAttribute="top" secondItem="vxT-xe-7mV" secondAttribute="bottom" constant="8" id="qIL-RX-3zl"/> | |
| 231 | + <constraint firstAttribute="trailing" secondItem="dtD-J5-dze" secondAttribute="trailing" constant="15" id="uHa-ot-bT0"/> | |
| 232 | + </constraints> | |
| 233 | + <point key="canvasLocation" x="24.5" y="52.5"/> | |
| 234 | + </view> | |
| 235 | + </objects> | |
| 236 | + <resources> | |
| 237 | + <image name="arrow_down" width="28" height="18"/> | |
| 238 | + <image name="icon_menu" width="30" height="30"/> | |
| 239 | + <image name="today_back_button" width="73" height="37"/> | |
| 240 | + </resources> | |
| 241 | +</document> |
LifeLog/LifeLog/SNSViewController.m
| ... | ... | @@ -14,6 +14,7 @@ |
| 14 | 14 | #import "Utilities.h" |
| 15 | 15 | |
| 16 | 16 | #import "SNSRecentTopicTableViewCell.h" |
| 17 | +#import "MyGroupViewController.h" | |
| 17 | 18 | #import "SearchGroupViewController.h" |
| 18 | 19 | #import "GroupDetailViewController.h" |
| 19 | 20 | |
| ... | ... | @@ -46,8 +47,8 @@ |
| 46 | 47 | } |
| 47 | 48 | |
| 48 | 49 | - (IBAction)clickMyGroup:(id)sender { |
| 49 | -// GroupDetailViewController * detail = [[GroupDetailViewController alloc] init]; | |
| 50 | -// [self.navigationController pushViewController:detail animated:true]; | |
| 50 | + MyGroupViewController * myGrp = [[MyGroupViewController alloc] init]; | |
| 51 | + [self.navigationController pushViewController:myGrp animated:true]; | |
| 51 | 52 | } |
| 52 | 53 | |
| 53 | 54 | #pragma mark UITableView Delegate |
LifeLog/LifeLog/SearchGroupViewController.h
| ... | ... | @@ -9,7 +9,9 @@ |
| 9 | 9 | #import <UIKit/UIKit.h> |
| 10 | 10 | #import "BaseTableViewController.h" |
| 11 | 11 | |
| 12 | -@interface SearchGroupViewController : BaseTableViewController<UITextFieldDelegate> | |
| 12 | +@interface SearchGroupViewController : BaseTableViewController<UITextFieldDelegate> { | |
| 13 | + NSTimer *timerSearch; | |
| 14 | +} | |
| 13 | 15 | |
| 14 | 16 | @property (weak, nonatomic) IBOutlet UITextField *textFieldSearch; |
| 15 | 17 |
LifeLog/LifeLog/SearchGroupViewController.m
| ... | ... | @@ -14,6 +14,7 @@ |
| 14 | 14 | #import "Utilities.h" |
| 15 | 15 | |
| 16 | 16 | #import "SearchGroupTableViewCell.h" |
| 17 | +#import "CreateGroupViewController.h" | |
| 17 | 18 | #import "GroupDetailViewController.h" |
| 18 | 19 | |
| 19 | 20 | @interface SearchGroupViewController () |
| ... | ... | @@ -42,11 +43,18 @@ |
| 42 | 43 | } |
| 43 | 44 | |
| 44 | 45 | - (IBAction)clickSearch:(id)sender { |
| 46 | + [self.view endEditing:true]; | |
| 45 | 47 | [self resetData]; |
| 46 | 48 | } |
| 47 | 49 | |
| 48 | 50 | - (IBAction)clickCreateGroup:(id)sender { |
| 49 | - | |
| 51 | + CreateGroupViewController * create = [[CreateGroupViewController alloc] init]; | |
| 52 | + create.createGroupSuccess = ^(GroupObject *object){ | |
| 53 | + GroupDetailViewController * detail = [[GroupDetailViewController alloc] init]; | |
| 54 | + [detail setGroup:object]; | |
| 55 | + [self.navigationController pushViewController:detail animated:true]; | |
| 56 | + }; | |
| 57 | + [self.navigationController pushViewController:create animated:true]; | |
| 50 | 58 | } |
| 51 | 59 | |
| 52 | 60 | #pragma mark UITableView Delegate |
| ... | ... | @@ -74,8 +82,16 @@ |
| 74 | 82 | } |
| 75 | 83 | |
| 76 | 84 | #pragma mark UITextField Delegate |
| 85 | +-(BOOL) textFieldShouldReturn:(UITextField *)textField { | |
| 86 | + [self.view endEditing:true]; | |
| 87 | + return true; | |
| 88 | +} | |
| 89 | + | |
| 77 | 90 | -(BOOL) textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { |
| 78 | - [self resetData]; | |
| 91 | + if(timerSearch != nil) { | |
| 92 | + [timerSearch invalidate]; | |
| 93 | + } | |
| 94 | + timerSearch = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(resetData) userInfo:nil repeats:false]; | |
| 79 | 95 | return true; |
| 80 | 96 | } |
| 81 | 97 |
LifeLog/LifeLog/SearchGroupViewController.xib
| ... | ... | @@ -112,7 +112,7 @@ |
| 112 | 112 | <userDefinedRuntimeAttribute type="string" keyPath="localizeKey" value="lifelog.searchGr.bt.createGr"/> |
| 113 | 113 | </userDefinedRuntimeAttributes> |
| 114 | 114 | <connections> |
| 115 | - <action selector="clickCreateGroup:" destination="-1" eventType="touchUpOutside" id="iYI-HB-mhb"/> | |
| 115 | + <action selector="clickCreateGroup:" destination="-1" eventType="touchUpInside" id="J9P-5a-SrT"/> | |
| 116 | 116 | </connections> |
| 117 | 117 | </button> |
| 118 | 118 | <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="none" rowHeight="70" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="yF3-ZN-ebL"> |
LifeLog/LifeLog/ServerAPI.h
| ... | ... | @@ -34,6 +34,8 @@ extern NSString *const kNotificationToken; |
| 34 | 34 | - (void) requestHistoryGraph:(NSString *)token withType:(int)type andMode:(int) mode CompletionHandler:(void (^)(HistoryGraphObject *, NSError *)) completion; |
| 35 | 35 | - (void) requestHistoryList:(NSString *)token withType:(int)type andMode:(int) mode AtPage:(int) page CompletionHandler:(void (^)(NSArray *, NSError *)) completion; |
| 36 | 36 | - (void) requestJoinGroup:(NSString *)token groupID: (int) groupID CompletionHandler:(void (^)(NSError *)) completion; |
| 37 | +-(void) requestCreateGroup:(NSString *)token withGroup:(GroupObject *)group CompletionHandler:(void (^)(GroupObject *, NSError *)) completion; | |
| 38 | +- (void) requestGroupList:(NSString *)token CompletionHandler:(void (^)(NSArray *, NSError *)) completion; | |
| 37 | 39 | |
| 38 | 40 | #pragma mark - SNS Screen Function |
| 39 | 41 | /* |
LifeLog/LifeLog/ServerAPI.m
| ... | ... | @@ -647,6 +647,67 @@ NSURLSessionDataTask * searchTask; |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | 649 | #pragma mark - Group Function |
| 650 | +-(void) requestCreateGroup:(NSString *)token withGroup:(GroupObject *)group CompletionHandler:(void (^)(GroupObject *, NSError *)) completion { | |
| 651 | + NSString *url = [kServerAddress stringByAppendingFormat:@"api/groups/newGroup"]; | |
| 652 | + NSLog(@"requestCreateGroup link %@", url); | |
| 653 | + NSDictionary * dict = @{@"group_name":group.name, | |
| 654 | + @"goal":group.goal, | |
| 655 | + @"walk_mode_active":[NSNumber numberWithBool:group.walkMode], | |
| 656 | + @"run_mode_active":[NSNumber numberWithBool:group.runMode], | |
| 657 | + @"bike_mode_active":[NSNumber numberWithBool:group.bikeMode], | |
| 658 | + @"step_mode_active":[NSNumber numberWithBool:group.stepMode], | |
| 659 | + @"gym_mode_active":[NSNumber numberWithBool:group.gymMode], | |
| 660 | + @"beginer_mode_active":[NSNumber numberWithBool:group.beginMode], | |
| 661 | + @"walk_mode_goal":[NSNumber numberWithBool:group.walkGoal], | |
| 662 | + @"run_mode_goal":[NSNumber numberWithBool:group.runGoal], | |
| 663 | + @"bike_mode_goal":[NSNumber numberWithBool:group.bikeGoal]}; | |
| 664 | + | |
| 665 | + [self _request:url method:@"POST" token:token paras:dict completion:^(NSData *data, NSError *error) { | |
| 666 | + | |
| 667 | + if (completion == NULL) { | |
| 668 | + return ; | |
| 669 | + } | |
| 670 | + | |
| 671 | + if (error == nil) | |
| 672 | + { | |
| 673 | + NSDictionary *dataResult = [NSJSONSerialization JSONObjectWithData:data options: NSJSONReadingAllowFragments error: &error]; | |
| 674 | + NSLog(@"%@", dataResult); | |
| 675 | + int status = [dataResult[@"status"] intValue]; | |
| 676 | + if (status == 1) { // status = 1 success | |
| 677 | + if(dataResult[@"result"] != nil) { | |
| 678 | + NSDictionary * dict = dataResult[@"result"]; | |
| 679 | + group.groupID = [dict[@"group_id"] intValue]; | |
| 680 | + completion(group, nil); | |
| 681 | + } | |
| 682 | + else { | |
| 683 | + NSError *errorObject = [NSError errorWithDomain:@"LifeLog_Domain" code:-1 userInfo:@{@"message":@"Unknown Error"}]; | |
| 684 | + completion(nil, errorObject); | |
| 685 | + } | |
| 686 | + } | |
| 687 | + else { | |
| 688 | + NSString *message = dataResult[@"message"]; | |
| 689 | + if (message == nil) { | |
| 690 | + message = @"Unknown error"; | |
| 691 | + } | |
| 692 | + | |
| 693 | + if ([message isEqualToString:@"Token is invalid"]) { | |
| 694 | + [self performSelectorOnMainThread:@selector(checkToken) withObject:nil waitUntilDone:YES]; | |
| 695 | + NSString *tokenNew = [[NSUserDefaults standardUserDefaults] objectForKey:kToken]; | |
| 696 | + [self requestCreateGroup:tokenNew withGroup:group CompletionHandler:completion]; | |
| 697 | + } | |
| 698 | + else { | |
| 699 | + NSError *errorObject = [NSError errorWithDomain:@"LifeLog_Domain" code:-1 userInfo:@{@"message":message}]; | |
| 700 | + completion(nil, errorObject); | |
| 701 | + } | |
| 702 | + } | |
| 703 | + } | |
| 704 | + else | |
| 705 | + { | |
| 706 | + completion(nil, error); | |
| 707 | + } | |
| 708 | + }]; | |
| 709 | +} | |
| 710 | + | |
| 650 | 711 | - (void) getGroupDetail:(NSString *)token withGroupID:(int)groupID CompletionHandler:(void (^)(GroupObject *, NSError *)) completion { |
| 651 | 712 | NSString *url = [kServerAddress stringByAppendingFormat:@"api/sns/group/detail/%d", groupID]; |
| 652 | 713 | NSLog(@"getGroupDetail link %@", url); |
| ... | ... | @@ -753,8 +814,7 @@ NSURLSessionDataTask * searchTask; |
| 753 | 814 | NSString *url = [kServerAddress stringByAppendingFormat:@"api/sns/group/join"]; |
| 754 | 815 | NSLog(@"requestJoinGroup link %@", url); |
| 755 | 816 | |
| 756 | - searchTask = [self _request:url method:@"POST" token:token paras:@{@"group_id": [NSNumber numberWithInt:groupID]} completion:^(NSData *data, NSError *error) { | |
| 757 | - searchTask = nil; | |
| 817 | + [self _request:url method:@"POST" token:token paras:@{@"group_id": [NSNumber numberWithInt:groupID]} completion:^(NSData *data, NSError *error) { | |
| 758 | 818 | if (completion == NULL) { |
| 759 | 819 | return ; |
| 760 | 820 | } |
| ... | ... | @@ -793,6 +853,58 @@ NSURLSessionDataTask * searchTask; |
| 793 | 853 | }]; |
| 794 | 854 | } |
| 795 | 855 | |
| 856 | +- (void) requestGroupList:(NSString *)token CompletionHandler:(void (^)(NSArray *, NSError *)) completion { | |
| 857 | + NSString *url = [kServerAddress stringByAppendingFormat:@"api/groups/list"]; | |
| 858 | + NSLog(@"requestGroupList link %@", url); | |
| 859 | + | |
| 860 | + [self _request:url method:@"GET" token:token paras:nil completion:^(NSData *data, NSError *error) { | |
| 861 | + if (completion == NULL) { | |
| 862 | + return ; | |
| 863 | + } | |
| 864 | + | |
| 865 | + if (error == nil) | |
| 866 | + { | |
| 867 | + NSDictionary *dataResult = [NSJSONSerialization JSONObjectWithData:data options: NSJSONReadingAllowFragments error: &error]; | |
| 868 | + NSLog(@"%@", dataResult); | |
| 869 | + int status = [dataResult[@"status"] intValue]; | |
| 870 | + if (status == 1) { // status = 1 success | |
| 871 | + if(dataResult[@"result"] != nil) { | |
| 872 | + NSArray * array = dataResult[@"result"]; | |
| 873 | + NSMutableArray * arrayGroup = [[NSMutableArray alloc] init]; | |
| 874 | + for(NSDictionary * dict in array) { | |
| 875 | + GroupObject * object = [[GroupObject alloc] initWithShortData:dict]; | |
| 876 | + [arrayGroup addObject:object]; | |
| 877 | + } | |
| 878 | + completion(arrayGroup, nil); | |
| 879 | + } | |
| 880 | + else { | |
| 881 | + NSError *errorObject = [NSError errorWithDomain:@"LifeLog_Domain" code:-1 userInfo:@{@"message":@"Unknown Error"}]; | |
| 882 | + completion(nil, errorObject); | |
| 883 | + } | |
| 884 | + } | |
| 885 | + else { | |
| 886 | + NSString *message = dataResult[@"message"]; | |
| 887 | + if (message == nil) { | |
| 888 | + message = @"Unknown error"; | |
| 889 | + } | |
| 890 | + | |
| 891 | + if ([message isEqualToString:@"Token is invalid"]) { | |
| 892 | + [self performSelectorOnMainThread:@selector(checkToken) withObject:nil waitUntilDone:YES]; | |
| 893 | + NSString *tokenNew = [[NSUserDefaults standardUserDefaults] objectForKey:kToken]; | |
| 894 | + [self requestGroupList:tokenNew CompletionHandler:completion]; | |
| 895 | + } | |
| 896 | + else { | |
| 897 | + NSError *errorObject = [NSError errorWithDomain:@"LifeLog_Domain" code:-1 userInfo:@{@"message":message}]; | |
| 898 | + completion(nil, errorObject); | |
| 899 | + } | |
| 900 | + } | |
| 901 | + } | |
| 902 | + else | |
| 903 | + { | |
| 904 | + completion(nil, error); | |
| 905 | + } | |
| 906 | + }]; | |
| 907 | +} | |
| 796 | 908 | #pragma mark - Common API |
| 797 | 909 | - (void)refreshToken: (NSString *)userID CompletionHandler:(void (^)(NSString *, NSError *))completion { |
| 798 | 910 | [self _request:[kServerAddress stringByAppendingFormat: @"refreshToken"] method:@"POST" token:@"" paras:@{@"userId":userID} completion:^(NSData *data, NSError *error) { |