Skip to content

Commit

Permalink
update version and refactor singleton class name
Browse files Browse the repository at this point in the history
  • Loading branch information
leverdeterre committed Aug 22, 2014
1 parent c13b1d1 commit 9cb3b37
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
12 changes: 6 additions & 6 deletions iAppInfos/iAppInfos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
C29315F91866446B005B65AF /* JMOViewControllerProvisioningDetails.m in Sources */ = {isa = PBXBuildFile; fileRef = C29315F31866446B005B65AF /* JMOViewControllerProvisioningDetails.m */; };
C29315FA1866446B005B65AF /* JMOTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C29315F51866446B005B65AF /* JMOTableViewController.m */; };
C29315FB1866446B005B65AF /* JMOCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C29315F71866446B005B65AF /* JMOCell.m */; };
C29315FE1866448F005B65AF /* AppInformationsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C29315FC1866448F005B65AF /* AppInformationsManager.m */; };
C29315FE1866448F005B65AF /* iAppInfos.m in Sources */ = {isa = PBXBuildFile; fileRef = C29315FC1866448F005B65AF /* iAppInfos.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -83,8 +83,8 @@
C29315F61866446B005B65AF /* JMOTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JMOTableViewController.h; sourceTree = "<group>"; };
C29315F71866446B005B65AF /* JMOCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JMOCell.m; sourceTree = "<group>"; };
C29315F81866446B005B65AF /* JMOCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JMOCell.h; sourceTree = "<group>"; };
C29315FC1866448F005B65AF /* AppInformationsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppInformationsManager.m; sourceTree = "<group>"; };
C29315FD1866448F005B65AF /* AppInformationsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppInformationsManager.h; sourceTree = "<group>"; };
C29315FC1866448F005B65AF /* iAppInfos.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iAppInfos.m; sourceTree = "<group>"; };
C29315FD1866448F005B65AF /* iAppInfos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iAppInfos.h; sourceTree = "<group>"; };
C29315FF18709D4D005B65AF /* JMOLogMacro.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JMOLogMacro.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -238,8 +238,8 @@
isa = PBXGroup;
children = (
C29315FF18709D4D005B65AF /* JMOLogMacro.h */,
C29315FD1866448F005B65AF /* AppInformationsManager.h */,
C29315FC1866448F005B65AF /* AppInformationsManager.m */,
C29315FD1866448F005B65AF /* iAppInfos.h */,
C29315FC1866448F005B65AF /* iAppInfos.m */,
C2209C59191E1F1300C4BA60 /* MobileProvisionning */,
C2209C5A191E1F3400C4BA60 /* DevicePower */,
C2209C5B191E1F4500C4BA60 /* SDKinfos */,
Expand Down Expand Up @@ -357,7 +357,7 @@
C29315F21866445D005B65AF /* UIDevice+iAppInfos.m in Sources */,
C29315F91866446B005B65AF /* JMOViewControllerProvisioningDetails.m in Sources */,
C29315C81866438A005B65AF /* JMOViewController.m in Sources */,
C29315FE1866448F005B65AF /* AppInformationsManager.m in Sources */,
C29315FE1866448F005B65AF /* iAppInfos.m in Sources */,
C29315FA1866446B005B65AF /* JMOTableViewController.m in Sources */,
C29315EF1866445D005B65AF /* JMOMobileProvisionning.m in Sources */,
C29315C21866438A005B65AF /* JMOAppDelegate.m in Sources */,
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions iAppInfos/iAppInfos/DemosViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "DemosViewController.h"
#import "JMOViewController.h"
#import "JMOLogMacro.h"
#import "AppInformationsManager.h"
#import "iAppInfos.h"

@interface DemosViewController ()

Expand All @@ -30,7 +30,7 @@ - (IBAction)demo2Pressed:(id)sender
[self.navigationController pushViewController:vc animated:YES];
*/

JMOLog(@"%@",[AppInformationsManager sharedManager]);
JMOLog(@"%@",[iAppInfos sharedInfo]);
}

@end
16 changes: 8 additions & 8 deletions iAppInfos/iAppInfos/JMOViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import "JMOCell.h"
#import "JMOLogMacro.h"

#import "AppInformationsManager.h"
#import "iAppInfos.h"

#define CustomKey1 @"CustomKey1"

Expand All @@ -29,8 +29,8 @@ - (void)viewDidLoad
// Do any additional setup after loading the view, typically from a nib.
self.title = @"iAppInfos";

[[AppInformationsManager sharedManager] addCustomValue:@"This is a custom value" forCustomKey:CustomKey1];
self.properties = [[AppInformationsManager sharedManager] filteredKeys];
[[iAppInfos sharedInfo] addCustomValue:@"This is a custom value" forCustomKey:CustomKey1];
self.properties = [[iAppInfos sharedInfo] filteredKeys];
self.tableView.dataSource = self;
}

Expand All @@ -46,7 +46,7 @@ - (JMOCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPa
static NSString *CellIdentifier = @"JMOCell";
JMOCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NSString *key = [self.properties objectAtIndex:indexPath.row];
id info = [[AppInformationsManager sharedManager] infoForKey:key];
id info = [[iAppInfos sharedInfo] infoForKey:key];

cell.labelKey.text = key;

Expand Down Expand Up @@ -78,7 +78,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
NSString *key = [self.properties objectAtIndex:indexPath.row];

if ([key isEqualToString:AppVersionManagerKeyMobileProvisionning]) {
JMOMobileProvisionning *info = [[AppInformationsManager sharedManager] infoForKey:key];
JMOMobileProvisionning *info = [[iAppInfos sharedInfo] infoForKey:key];

if (info == nil) {
return;
Expand All @@ -92,7 +92,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath

#pragma mark - AppInformationsManagerDatasource

- (NSArray *)desiredKeysForAppVersionManager:(AppInformationsManager *)manager
- (NSArray *)desiredKeysForAppVersionManager:(iAppInfos *)manager
{
return @[AppVersionManagerKeyTargetedVersion,
AppVersionManagerKeyYouriOSVersion,
Expand All @@ -111,13 +111,13 @@ - (NSArray *)desiredKeysForAppVersionManager:(AppInformationsManager *)manager
CustomKey1];
}

- (NSString *)getWSConfigurationForAppVersionManager:(AppInformationsManager *)manager
- (NSString *)getWSConfigurationForAppVersionManager:(iAppInfos *)manager
{
JMOLog(@"Return WS url ? or something to identified your WS configuration");
return @"Dev";
}

- (NSString *)getpushTokenForAppVersionManager:(AppInformationsManager *)manager
- (NSString *)getpushTokenForAppVersionManager:(iAppInfos *)manager
{
JMOLog(@"Are you storing the token somewhere?");
return @"";
Expand Down
4 changes: 2 additions & 2 deletions iAppInfos/iAppInfos/iAppInfos-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>0.1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// AppInformationsManager.h
// iAppInfos.h
// iAppInfos
//
// Created by Jerome Morissard on 11/21/13.
Expand Down Expand Up @@ -29,7 +29,7 @@
#define AppVersionManagerKeyWSConfiguration @"WSConfiguration" //From Datasource
#define AppVersionManagerKeyPushToken @"PushToken" //From Datasource

@interface AppInformationsManager : NSObject
@interface iAppInfos : NSObject

@property (strong, readonly, nonatomic) NSString *targetedVersion;
@property (strong, readonly, nonatomic) NSString *currentOSVersion;
Expand All @@ -50,7 +50,7 @@
@property (strong, nonatomic) NSArray *filteredKeys;


+ (instancetype)sharedManager;
+ (instancetype)sharedInfo;
- (void)addCustomValue:(NSString *)value forCustomKey:(NSString *)key;
- (id)infoForKey:(NSString *)key;
- (NSString *)htmlDescriptionWithKeys:(NSArray *)keys;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//
// AppInformationsManager.m
// iAppInfos.m
// iAppInfos
//
// Created by Jerome Morissard on 11/21/13.
// Copyright (c) 2013 Jerome Morissard. All rights reserved.
//

#import "AppInformationsManager.h"
#import "iAppInfos.h"

#import "UIApplication+iAppInfos.h"
#import "NSDictionary+iAppInfos.h"
Expand All @@ -16,20 +16,20 @@
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#import <CoreTelephony/CTCarrier.h>

@interface AppInformationsManager ()
@interface iAppInfos ()
@property (strong, nonatomic) NSMutableDictionary *customValues;
@end

@implementation AppInformationsManager
@implementation iAppInfos

#define MB (1024*1024)
#define GB (MB*1024)

#pragma mark Singleton Methods

+ (instancetype)sharedManager
+ (instancetype)sharedInfo
{
static AppInformationsManager *sharedMyManager = nil;
static iAppInfos *sharedMyManager = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedMyManager = [[self alloc] init];
Expand All @@ -55,7 +55,7 @@ - (NSString *)description
JMOMobileProvisionning *mobileProvi = nil;
[str appendFormat:@"\n\t#Global infos\n"];
for (NSString *key in keys) {
id info = [[AppInformationsManager sharedManager] infoForKey:key];
id info = [[iAppInfos sharedInfo] infoForKey:key];
if ([key isEqualToString:AppVersionManagerKeyMobileProvisionning]) {
mobileProvi = (JMOMobileProvisionning *)info;
}
Expand Down Expand Up @@ -299,7 +299,7 @@ - (NSString *)htmlDescriptionWithKeys:(NSArray *)keys
[str appendString:@"<TABLE>"];

for (NSString *key in keys) {
id info = [[AppInformationsManager sharedManager] infoForKey:key];
id info = [[iAppInfos sharedInfo] infoForKey:key];
if ([key isEqualToString:AppVersionManagerKeyMobileProvisionning]) {
JMOMobileProvisionning *mobileProvi = (JMOMobileProvisionning *)info;
[str appendFormat:@"<TR><TD>%@</TD><TD>%@</TD></TR>", key, mobileProvi.teamName];
Expand Down

0 comments on commit 9cb3b37

Please sign in to comment.