Skip to content

Commit

Permalink
adding first extension
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonL committed Jul 11, 2019
1 parent 89f44b3 commit 0b3e64b
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 11 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion TymateSwiftExtensions.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
5B6AA39F467E0BF2D262468F /* Pods_TymateSwiftExtensions.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6685F60706721708C67C8CF6 /* Pods_TymateSwiftExtensions.framework */; };
F464DAE522D39F2C002413BD /* TymateSwiftExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = F464DAE322D39F2C002413BD /* TymateSwiftExtensions.h */; settings = {ATTRIBUTES = (Public, ); }; };
F464DB1322D730A5002413BD /* StringExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F464DB1222D730A5002413BD /* StringExtensions.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -18,6 +19,7 @@
F464DAE022D39F2C002413BD /* TymateSwiftExtensions.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TymateSwiftExtensions.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F464DAE322D39F2C002413BD /* TymateSwiftExtensions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TymateSwiftExtensions.h; sourceTree = "<group>"; };
F464DAE422D39F2C002413BD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F464DB1222D730A5002413BD /* StringExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringExtensions.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -38,7 +40,6 @@
00955484756FD6B2C4E60979 /* Pods-TymateSwiftExtensions.debug.xcconfig */,
78A9AA7B809D409F49089628 /* Pods-TymateSwiftExtensions.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -73,6 +74,7 @@
children = (
F464DAE322D39F2C002413BD /* TymateSwiftExtensions.h */,
F464DAE422D39F2C002413BD /* Info.plist */,
F464DB1222D730A5002413BD /* StringExtensions.swift */,
);
path = TymateSwiftExtensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -121,6 +123,7 @@
TargetAttributes = {
F464DADF22D39F2C002413BD = {
CreatedOnToolsVersion = 10.2;
LastSwiftMigration = 1020;
};
};
};
Expand Down Expand Up @@ -181,6 +184,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F464DB1322D730A5002413BD /* StringExtensions.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -313,6 +317,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 00955484756FD6B2C4E60979 /* Pods-TymateSwiftExtensions.debug.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
Expand All @@ -329,6 +334,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.tymate.TymateSwiftExtensions;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -338,6 +344,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 78A9AA7B809D409F49089628 /* Pods-TymateSwiftExtensions.release.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>TymateSwiftExtensions.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>2</integer>
</dict>
</dict>
</dict>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
19 changes: 19 additions & 0 deletions TymateSwiftExtensions/StringExtensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// StringExtensions.swift
// TymateSwiftExtensions
//
// Created by Simon on 11/07/2019.
// Copyright © 2019 Tymate. All rights reserved.
//

import Foundation

public extension String {
func isValidEmail() -> Bool {
// print("validate calendar: \(testStr)")
let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"

let emailTest = NSPredicate(format: "SELF MATCHES %@", emailRegEx)
return emailTest.evaluate(with: self)
}
}

0 comments on commit 0b3e64b

Please sign in to comment.