- Fix Vari

This commit is contained in:
giuseppenuc committed 2016-01-26 00:29:37 +01:00
1 parent f569c8545c
commit 7e5a6149a8
28 files changed
+1162 -862

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="whP-gf-Uak">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="whP-gf-Uak">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
+33 -6
View File
@@ -9,6 +9,7 @@
#import "PNObjectAppDelegate.h"
#import "PNObject.h"
#import "PNUser.h"
#import "PNAddress.h"
@implementation PNObjectAppDelegate
@@ -27,14 +28,40 @@
//[PNObject get];*/
PNUser *user = [PNUser currentUser];
[user setFirstName:@"peppe"];
[user setLastName:@"nucifora"];
[user setUsername:@"giuseppe.nucifora"];
[user setPassword:@"giuseppe.nucifora.password"];
PNUser *object = [user saveLocally];
NSLog(@"User : %@",[object getObject]);
NSLog(@"asd");
/*[user setFirstName:@"Giuseppe"];
[user setLastName:@"Nucifora"];
[user setHasAcceptedNewsletter:YES];
[user setHasAcceptedPrivacy:YES];
[user setUsername:@"giuseppe.nucifora"];
[user setPassword:@"giuseppe.nucifora.password"];
[user setPhone:@"+393485904995"];
[user saveLocally];
*/
//NSLog(@"%@",[user getObject]);
/*
PNAddress *address1 = [[PNAddress alloc] init];
[address1 setZip:@"95014"];
[address1 setCountry:@"Italy"];
[address1 setCity:@"Giarre"];
[address1 setProvince:@"Catania"];
NSLog(@"%@",[address1 saveLocally]);
PNAddress *address2 = [[PNAddress alloc] init];
[address2 setZip:@"95014"];
[address2 setCountry:@"Italy"];
[address2 setCity:@"Giarre"];
[address2 setProvince:@"Catania"];
NSLog(@"%@",[address2 saveLocally]);*/
return YES;
}
+4 -4
View File
@@ -25,7 +25,7 @@ PODS:
- FBSnapshotTestCase/SwiftSupport (2.0.7):
- FBSnapshotTestCase/Core
- NSDate_Utils (0.1.0)
- NSString-Helper (1.0.1)
- NSString-Helper (1.0.2)
- nv-ios-http-status (0.0.1)
- PEAR-FileManager-iOS (1.3.1)
- PNObject (0.1.0):
@@ -38,7 +38,7 @@ PODS:
- UIDevice-Utils
- Specta (1.0.5)
- StrongestPasswordValidator (0.1.1)
- UIDevice-Utils (0.1.2)
- UIDevice-Utils (0.1.4)
DEPENDENCIES:
- AFNetworking
@@ -66,13 +66,13 @@ SPEC CHECKSUMS:
Expecta+Snapshots: 29b38dd695bc72a0ed2bea833937d78df41943ba
FBSnapshotTestCase: 7e85180d0d141a0cf472352edda7e80d7eaeb547
NSDate_Utils: 4a57f91094123d5b7600c7de8c9ad9e1d43306a3
NSString-Helper: e26909c87694add9be022ca24e856e3b6148fe89
NSString-Helper: 0ee74919829a332f9838fa87b28cb2d1d991e92c
nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f
PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3
PNObject: b71ba455c15aedd1233cdf02bcf65d348d96da72
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2
StrongestPasswordValidator: 554de9038705e18904f0337903dfd3b85a6b271b
UIDevice-Utils: 14362004e88f8cc05d8ec68369724a5972faadec
UIDevice-Utils: 0beb5f9d2bd256a3efe05c1e43a2a8b8702199c4
PODFILE CHECKSUM: 3d7d9ec922a37131d59224a7700af30168ea90b1
+4 -4
View File
@@ -25,7 +25,7 @@ PODS:
- FBSnapshotTestCase/SwiftSupport (2.0.7):
- FBSnapshotTestCase/Core
- NSDate_Utils (0.1.0)
- NSString-Helper (1.0.1)
- NSString-Helper (1.0.2)
- nv-ios-http-status (0.0.1)
- PEAR-FileManager-iOS (1.3.1)
- PNObject (0.1.0):
@@ -38,7 +38,7 @@ PODS:
- UIDevice-Utils
- Specta (1.0.5)
- StrongestPasswordValidator (0.1.1)
- UIDevice-Utils (0.1.2)
- UIDevice-Utils (0.1.4)
DEPENDENCIES:
- AFNetworking
@@ -66,13 +66,13 @@ SPEC CHECKSUMS:
Expecta+Snapshots: 29b38dd695bc72a0ed2bea833937d78df41943ba
FBSnapshotTestCase: 7e85180d0d141a0cf472352edda7e80d7eaeb547
NSDate_Utils: 4a57f91094123d5b7600c7de8c9ad9e1d43306a3
NSString-Helper: e26909c87694add9be022ca24e856e3b6148fe89
NSString-Helper: 0ee74919829a332f9838fa87b28cb2d1d991e92c
nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f
PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3
PNObject: b71ba455c15aedd1233cdf02bcf65d348d96da72
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2
StrongestPasswordValidator: 554de9038705e18904f0337903dfd3b85a6b271b
UIDevice-Utils: 14362004e88f8cc05d8ec68369724a5972faadec
UIDevice-Utils: 0beb5f9d2bd256a3efe05c1e43a2a8b8702199c4
PODFILE CHECKSUM: 3d7d9ec922a37131d59224a7700af30168ea90b1
@@ -14,6 +14,8 @@
- (BOOL) isNumeric;
- (BOOL) isValidPhoneNumber;
- (BOOL) isValidUrl;
- (BOOL) isValidTaxCode;
@@ -28,6 +28,22 @@
return isValid;
}
- (BOOL) isValidPhoneNumber {
NSError *error = NULL;
NSDataDetector *detector = [NSDataDetector dataDetectorWithTypes:NSTextCheckingTypePhoneNumber error:&error];
NSArray *matches = [detector matchesInString:self options:0 range:NSMakeRange(0, [self length])];
if (matches != nil) {
for (NSTextCheckingResult *match in matches) {
if ([match resultType] == NSTextCheckingTypePhoneNumber) {
return YES;
}
}
}
return NO;
}
- (BOOL) isValidUrl {
NSString *urlRegEx =
@"(http|https)://((\\w)*|([0-9]*)|([-|_])*)+([\\.|/]((\\w)*|([0-9]*)|([-|_])*))+";
+5 -4
View File
@@ -17,19 +17,20 @@ NSString-Helper is available through [CocoaPods](http://cocoapods.org). To insta
it, simply add the following line to your Podfile:
```ruby
pod 'NSString-Helper' , :git => 'https://github.com/giuseppenucifora/NSString-Helper.git'
OR
pod 'NSString-Helper'
```
##Usage
```ruby
#import <NSString-Helper/NSString+Helper.h>
NSString *str = @"testCode";
NSLog(@"%@",[NSNumber numberWithBool:[str isNumeric]]);
NSLog(@"%@",[NSNumber numberWithBool:[str isValidPhoneNumber]]);
NSLog(@"%@",[NSNumber numberWithBool:[str isValidEmail]]);
NSLog(@"%@",[NSNumber numberWithBool:[str isValidUrl]]);
File diff suppressed because it is too large. Load diff
@@ -14,7 +14,7 @@
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = 'primary'
BlueprintIdentifier = 'ECB7C6AA04CE9C3E543F286B'
BlueprintIdentifier = '4FB4437C636DCECA1396EC4C'
BlueprintName = 'PNObject'
ReferencedContainer = 'container:Pods.xcodeproj'
BuildableName = 'PNObject.framework'>
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.1</string>
<string>1.0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
@@ -13,7 +13,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.1</string>
<string>1.0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
@@ -1,5 +1,7 @@
#import <UIKit/UIKit.h>
#import "PNObject+PNObjectConnection.h"
#import "PNObject+Protected.h"
#import "PNObject.h"
#import "PNObjectConfig.h"
#import "PNObjectConstants.h"
+1 -1
View File
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.1.2</string>
<string>0.1.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
@@ -13,7 +13,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.2</string>
<string>0.1.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
@@ -73,6 +73,13 @@ typedef NS_ENUM(NSUInteger, UIDeviceModelInches) {
UIDeviceModelInches79,
UIDeviceModelInches97,
UIDeviceModelInches129,
UIDeviceSimulatorModelInches35 = UIDeviceModelInches35,
UIDeviceSimulatorModelInches4 = UIDeviceModelInches4,
UIDeviceSimulatorModelInches47 = UIDeviceModelInches47,
UIDeviceSimulatorModelInches55 = UIDeviceModelInches55,
UIDeviceSimulatorModelInches79 = UIDeviceModelInches79,
UIDeviceSimulatorModelInches97 = UIDeviceModelInches97,
UIDeviceSimulatorModelInches129 = UIDeviceModelInches129,
UIDeviceModelInchesUnKnown
};
+57 -7
View File
@@ -171,6 +171,8 @@
if ([modelIdentifier isEqualToString:@"iPad4,2"]) return UIDeviceGenerationModeliPadAir;
if ([modelIdentifier isEqualToString:@"iPad5,3"]) return UIDeviceGenerationModeliPadAir2;
if ([modelIdentifier isEqualToString:@"iPad5,4"]) return UIDeviceGenerationModeliPadAir2;
if ([modelIdentifier isEqualToString:@"iPad6,7"]) return UIDeviceGenerationModeliPadPro;
if ([modelIdentifier isEqualToString:@"iPad6,8"]) return UIDeviceGenerationModeliPadPro;
// iPad Mini http://theiphonewiki.com/wiki/IPad_mini
@@ -203,8 +205,14 @@
if ([modelIdentifier hasSuffix:@"86"] || [modelIdentifier isEqual:@"x86_64"])
{
BOOL smallerScreen = ([[UIScreen mainScreen] bounds].size.width < 768.0);
return (smallerScreen ? UIDeviceGenerationModeliPhoneSimulator : UIDeviceGenerationModeliPadSimulator);
BOOL iPhoneScreen = ([[UIScreen mainScreen] bounds].size.width < 768.0);
BOOL iPadScreen = !iPhoneScreen;
if (iPadScreen) {
return UIDeviceGenerationModeliPadSimulator;
}
else {
return UIDeviceGenerationModeliPhoneSimulator;
}
}
return UIDeviceGenerationModelUnknown;
}
@@ -250,6 +258,9 @@
if ([modelIdentifier isEqualToString:@"iPad5,3"]) return @"iPad Air 2 (Wi-Fi)";
if ([modelIdentifier isEqualToString:@"iPad5,4"]) return @"iPad Air 2 (Cellular)";
if ([modelIdentifier isEqualToString:@"iPad6,7"]) return @"iPad Pro (Wi-Fi)";
if ([modelIdentifier isEqualToString:@"iPad6,8"]) return @"iPad Pro (Cellular)";
// iPad Mini http://theiphonewiki.com/wiki/IPad_mini
if ([modelIdentifier isEqualToString:@"iPad2,5"]) return @"iPad mini 1G (Wi-Fi)";
@@ -320,23 +331,62 @@
case UIDeviceGenerationModeliPad4:
case UIDeviceGenerationModeliPadAir:
case UIDeviceGenerationModeliPadAir2:{
return UIDeviceModelInches97;
}
break;
case UIDeviceGenerationModeliPadMini1:
case UIDeviceGenerationModeliPadMini2:
case UIDeviceGenerationModeliPadMini3:
case UIDeviceGenerationModeliPadMini4:
{
case UIDeviceGenerationModeliPadMini4:{
return UIDeviceModelInches79;
}
break;
case UIDeviceGenerationModeliPadPro:{
return UIDeviceModelInches129;
}
default:
break;
}
case UIDeviceGenerationModeliPadSimulator:
case UIDeviceGenerationModeliPhoneSimulator:{
CGRect screenRect = [[UIScreen mainScreen] bounds];
NSInteger screenHeight = ((NSInteger)screenRect.size.height > (NSInteger)screenRect.size.width) ? (NSInteger)screenRect.size.height : (NSInteger)screenRect.size.width;
switch (screenHeight) {
case 480:{
return UIDeviceSimulatorModelInches35;
}
break;
case 568:{
return UIDeviceSimulatorModelInches4;
break;
}
case 667:{
return UIDeviceSimulatorModelInches47;
break;
}
case 736:{
return UIDeviceSimulatorModelInches55;
break;
}
case 1024:{
return UIDeviceModelInches97;
break;
}
case 1366:{
return UIDeviceSimulatorModelInches129;
break;
}
default:{
return UIDeviceModelInchesUnKnown;
break;
}
}
break;
}
default: {
return UIDeviceModelInchesUnKnown;
break;
}
}
return UIDeviceModelInchesUnKnown;
}
-4
View File
@@ -17,10 +17,6 @@ UIDevice-Utils is available through [CocoaPods](http://cocoapods.org). To instal
it, simply add the following line to your Podfile:
```ruby
pod "UIDevice-Utils" , :git => 'https://github.com/giuseppenucifora/UIDevice-Utils.git'
or
pod "UIDevice-Utils"
```