From fe662f3e13dd195d3a84f61b2e63d59ef1ab31f7 Mon Sep 17 00:00:00 2001 From: Javier Fuchs Date: Mon, 20 Jun 2016 11:30:59 -0300 Subject: [PATCH 1/5] Adding watchos --- SweetAlert.podspec | 1 + 1 file changed, 1 insertion(+) diff --git a/SweetAlert.podspec b/SweetAlert.podspec index d67c285..b890cd6 100644 --- a/SweetAlert.podspec +++ b/SweetAlert.podspec @@ -7,6 +7,7 @@ Pod::Spec.new do |s| s.author = {'codestergit' => 'https://github.com/codestergit/SweetAlert-iOS'} s.source = { :git => 'https://github.com/codestergit/SweetAlert-iOS.git', :tag => "#{s.version}"} s.ios.deployment_target = '8.0' + s.watchos.deployment_target = '2.2' s.source_files = 'SweetAlert/*.swift' s.requires_arc = 'true' end From c72fa36339a9bc541059917355fa2cb7ee439365 Mon Sep 17 00:00:00 2001 From: Javier Fuchs Date: Wed, 27 Jul 2016 00:33:04 -0300 Subject: [PATCH 2/5] Fix warnings on latest swift version --- SweetAlert/SweetAlert.swift | 6 +++--- SweetAlert/ViewController.swift | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/SweetAlert/SweetAlert.swift b/SweetAlert/SweetAlert.swift index 52c18c8..460a43f 100644 --- a/SweetAlert/SweetAlert.swift +++ b/SweetAlert/SweetAlert.swift @@ -130,13 +130,13 @@ public class SweetAlert: UIViewController { } y += kHeightMargin var buttonX = (kContentWidth - totalWidth ) / 2.0 - for var i = 0; i < buttons.count; i++ { + for i in 0 ..< buttons.count { buttons[i].frame = CGRect(x: buttonX, y: y, width: buttonRect[i].size.width + 20.0, height: buttonRect[i].size.height + 10.0) buttonX = buttons[i].frame.origin.x + kWidthMargin + buttonRect[i].size.width + 20.0 buttons[i].layer.cornerRadius = 5.0 self.contentView.addSubview(buttons[i]) - buttons[i].addTarget(self, action: "pressed:", forControlEvents: UIControlEvents.TouchUpInside) + buttons[i].addTarget(self, action: #selector(SweetAlert.pressed(_:)), forControlEvents: UIControlEvents.TouchUpInside) } y += kHeightMargin + buttonRect[0].size.height + 10.0 @@ -284,7 +284,7 @@ public class SweetAlert: UIViewController { let button: UIButton = UIButton(type: UIButtonType.Custom) button.setTitle(otherButtonTitle, forState: UIControlState.Normal) button.backgroundColor = otherButtonColor - button.addTarget(self, action: "pressed:", forControlEvents: UIControlEvents.TouchUpInside) + button.addTarget(self, action: #selector(SweetAlert.pressed(_:)), forControlEvents: UIControlEvents.TouchUpInside) button.tag = 1 buttons.append(button) } diff --git a/SweetAlert/ViewController.swift b/SweetAlert/ViewController.swift index 34ac7d4..72ece1a 100644 --- a/SweetAlert/ViewController.swift +++ b/SweetAlert/ViewController.swift @@ -10,7 +10,6 @@ import UIKit class ViewController: UIViewController { - var alert = SweetAlert() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. From e3e512adfaab7a99bda402d04d8b537462db70f3 Mon Sep 17 00:00:00 2001 From: Javier Fuchs Date: Mon, 29 Aug 2016 09:46:22 -0300 Subject: [PATCH 3/5] Small changes --- SweetAlert/Base.lproj/LaunchScreen.xib | 5 +++-- SweetAlert/Base.lproj/Main.storyboard | 26 ++++++-------------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/SweetAlert/Base.lproj/LaunchScreen.xib b/SweetAlert/Base.lproj/LaunchScreen.xib index db72467..e5074b0 100644 --- a/SweetAlert/Base.lproj/LaunchScreen.xib +++ b/SweetAlert/Base.lproj/LaunchScreen.xib @@ -1,7 +1,8 @@ - + - + + diff --git a/SweetAlert/Base.lproj/Main.storyboard b/SweetAlert/Base.lproj/Main.storyboard index c0dd8bb..1eee2c5 100644 --- a/SweetAlert/Base.lproj/Main.storyboard +++ b/SweetAlert/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - + - + @@ -17,9 +17,8 @@ - - - + + @@ -27,7 +26,6 @@ - - From 909afd85e2997ee3437193d5adbbf3cd2c317d71 Mon Sep 17 00:00:00 2001 From: Javier Fuchs Date: Mon, 29 Aug 2016 11:45:41 -0300 Subject: [PATCH 4/5] A more compatible project / workspace with CocoaPods. Usint pod lib lint SweetAlert.podspec to check the pod Creating the Example folder. --- .gitignore | 96 ++----------- Example/Podfile | 6 + .../SweetAlert}/AppDelegate.swift | 0 .../SweetAlert}/Base.lproj/LaunchScreen.xib | 0 .../SweetAlert}/Base.lproj/Main.storyboard | 0 .../AppIcon.appiconset/Contents.json | 38 +++++ {SweetAlert => Example/SweetAlert}/Info.plist | 0 .../SweetAlert}/SweetAlert.png | Bin .../SweetAlert}/ViewController.swift | 1 + .../SweetAlert}/logo_big.png | Bin .../project.pbxproj | 133 +++++++++++++----- .../contents.xcworkspacedata | 0 .../contents.xcworkspacedata | 10 ++ Example/Tests/Info.plist | 24 ++++ Example/Tests/Tests.swift | 29 ++++ thumb.jpg => Example/thumb.jpg | Bin SweetAlert.podspec | 49 +++++-- .../WorkspaceSettings.xcsettings | 10 -- .../xcschemes/SweetAlert.xcscheme | 120 ---------------- .../xcschemes/xcschememanagement.plist | 27 ---- SweetAlert/Assets/.gitkeep | 0 SweetAlert/Classes/.gitkeep | 0 SweetAlert/{ => Classes}/SweetAlert.swift | 14 +- SweetAlert/Classes/UIColor+SweetAlert.swift | 20 +++ 24 files changed, 275 insertions(+), 302 deletions(-) create mode 100644 Example/Podfile rename {SweetAlert => Example/SweetAlert}/AppDelegate.swift (100%) rename {SweetAlert => Example/SweetAlert}/Base.lproj/LaunchScreen.xib (100%) rename {SweetAlert => Example/SweetAlert}/Base.lproj/Main.storyboard (100%) create mode 100644 Example/SweetAlert/Images.xcassets/AppIcon.appiconset/Contents.json rename {SweetAlert => Example/SweetAlert}/Info.plist (100%) rename {SweetAlert => Example/SweetAlert}/SweetAlert.png (100%) rename {SweetAlert => Example/SweetAlert}/ViewController.swift (99%) rename {SweetAlert => Example/SweetAlert}/logo_big.png (100%) rename {SweetAlert.xcodeproj => Example/SweetAlert_Example.xcodeproj}/project.pbxproj (70%) rename {SweetAlert.xcodeproj => Example/SweetAlert_Example.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (100%) create mode 100644 Example/SweetAlert_Example.xcworkspace/contents.xcworkspacedata create mode 100644 Example/Tests/Info.plist create mode 100644 Example/Tests/Tests.swift rename thumb.jpg => Example/thumb.jpg (100%) delete mode 100644 SweetAlert.xcodeproj/project.xcworkspace/xcuserdata/gndbl.xcuserdatad/WorkspaceSettings.xcsettings delete mode 100644 SweetAlert.xcodeproj/xcuserdata/gndbl.xcuserdatad/xcschemes/SweetAlert.xcscheme delete mode 100644 SweetAlert.xcodeproj/xcuserdata/gndbl.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 SweetAlert/Assets/.gitkeep create mode 100644 SweetAlert/Classes/.gitkeep rename SweetAlert/{ => Classes}/SweetAlert.swift (98%) create mode 100644 SweetAlert/Classes/UIColor+SweetAlert.swift diff --git a/.gitignore b/.gitignore index d610896..30ff568 100644 --- a/.gitignore +++ b/.gitignore @@ -1,90 +1,10 @@ -### Swift template -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other +Pods +node_modules +.DS_Store +.pt *.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build -### Objective-C template -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -#Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# Created by .ignore support plugin (hsz.mobi) +Gemfile.lock +Podfile.lock +DerivedData +Build diff --git a/Example/Podfile b/Example/Podfile new file mode 100644 index 0000000..70c1a04 --- /dev/null +++ b/Example/Podfile @@ -0,0 +1,6 @@ +use_frameworks! + +target 'SweetAlert_Example' do + pod 'SweetAlert', :path => '../' + +end diff --git a/SweetAlert/AppDelegate.swift b/Example/SweetAlert/AppDelegate.swift similarity index 100% rename from SweetAlert/AppDelegate.swift rename to Example/SweetAlert/AppDelegate.swift diff --git a/SweetAlert/Base.lproj/LaunchScreen.xib b/Example/SweetAlert/Base.lproj/LaunchScreen.xib similarity index 100% rename from SweetAlert/Base.lproj/LaunchScreen.xib rename to Example/SweetAlert/Base.lproj/LaunchScreen.xib diff --git a/SweetAlert/Base.lproj/Main.storyboard b/Example/SweetAlert/Base.lproj/Main.storyboard similarity index 100% rename from SweetAlert/Base.lproj/Main.storyboard rename to Example/SweetAlert/Base.lproj/Main.storyboard diff --git a/Example/SweetAlert/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/SweetAlert/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d3942e9 --- /dev/null +++ b/Example/SweetAlert/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/SweetAlert/Info.plist b/Example/SweetAlert/Info.plist similarity index 100% rename from SweetAlert/Info.plist rename to Example/SweetAlert/Info.plist diff --git a/SweetAlert/SweetAlert.png b/Example/SweetAlert/SweetAlert.png similarity index 100% rename from SweetAlert/SweetAlert.png rename to Example/SweetAlert/SweetAlert.png diff --git a/SweetAlert/ViewController.swift b/Example/SweetAlert/ViewController.swift similarity index 99% rename from SweetAlert/ViewController.swift rename to Example/SweetAlert/ViewController.swift index 72ece1a..31be32f 100644 --- a/SweetAlert/ViewController.swift +++ b/Example/SweetAlert/ViewController.swift @@ -7,6 +7,7 @@ // import UIKit +import SweetAlert class ViewController: UIViewController { diff --git a/SweetAlert/logo_big.png b/Example/SweetAlert/logo_big.png similarity index 100% rename from SweetAlert/logo_big.png rename to Example/SweetAlert/logo_big.png diff --git a/SweetAlert.xcodeproj/project.pbxproj b/Example/SweetAlert_Example.xcodeproj/project.pbxproj similarity index 70% rename from SweetAlert.xcodeproj/project.pbxproj rename to Example/SweetAlert_Example.xcodeproj/project.pbxproj index b938371..a300aae 100644 --- a/SweetAlert.xcodeproj/project.pbxproj +++ b/Example/SweetAlert_Example.xcodeproj/project.pbxproj @@ -7,10 +7,9 @@ objects = { /* Begin PBXBuildFile section */ - 784864ED6A0B7AF68C8DE1D8 /* SweetAlert.podspec in Resources */ = {isa = PBXBuildFile; fileRef = 784869A188ADBAB6A90C84DF /* SweetAlert.podspec */; }; - 9B4286E81A0D2F5C00E9913B /* SweetAlert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4286E71A0D2F5C00E9913B /* SweetAlert.swift */; }; + 951A808B1D747DF4000FEF30 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 951A808A1D747DF4000FEF30 /* ViewController.swift */; }; + 99C82A2380BFA3A989CD8CF2 /* Pods_SweetAlert_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 69E2B89D4CDEF0719694AC70 /* Pods_SweetAlert_Example.framework */; }; 9B4286EB1A0D2F7700E9913B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4286E91A0D2F7700E9913B /* AppDelegate.swift */; }; - 9B4286EC1A0D2F7700E9913B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4286EA1A0D2F7700E9913B /* ViewController.swift */; }; 9B4286EE1A0D2FA000E9913B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9B4286ED1A0D2FA000E9913B /* Images.xcassets */; }; 9B4286F31A0D2FAF00E9913B /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9B4286EF1A0D2FAF00E9913B /* LaunchScreen.xib */; }; 9B4286F41A0D2FAF00E9913B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9B4286F11A0D2FAF00E9913B /* Main.storyboard */; }; @@ -21,19 +20,21 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 784869A188ADBAB6A90C84DF /* SweetAlert.podspec */ = {isa = PBXFileReference; lastKnownFileType = file.podspec; path = SweetAlert.podspec; sourceTree = ""; }; - 9B4286E71A0D2F5C00E9913B /* SweetAlert.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SweetAlert.swift; path = SweetAlert/SweetAlert.swift; sourceTree = SOURCE_ROOT; }; + 22C2406019C8DC4D27453217 /* Pods-SweetAlert_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SweetAlert_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SweetAlert_Example/Pods-SweetAlert_Example.debug.xcconfig"; sourceTree = ""; }; + 5F449D00C383589054EF03C2 /* Pods-SweetAlert_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SweetAlert_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SweetAlert_Example/Pods-SweetAlert_Example.release.xcconfig"; sourceTree = ""; }; + 69E2B89D4CDEF0719694AC70 /* Pods_SweetAlert_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SweetAlert_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 951A808A1D747DF4000FEF30 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ViewController.swift; path = SweetAlert/ViewController.swift; sourceTree = SOURCE_ROOT; }; 9B4286E91A0D2F7700E9913B /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = SweetAlert/AppDelegate.swift; sourceTree = SOURCE_ROOT; }; - 9B4286EA1A0D2F7700E9913B /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ViewController.swift; path = SweetAlert/ViewController.swift; sourceTree = SOURCE_ROOT; }; 9B4286ED1A0D2FA000E9913B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SweetAlert/Images.xcassets; sourceTree = SOURCE_ROOT; }; 9B4286F01A0D2FAF00E9913B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = SweetAlert/Base.lproj/LaunchScreen.xib; sourceTree = SOURCE_ROOT; }; 9B4286F21A0D2FAF00E9913B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = SweetAlert/Base.lproj/Main.storyboard; sourceTree = SOURCE_ROOT; }; 9B4286F51A0D2FC500E9913B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SweetAlert/Info.plist; sourceTree = SOURCE_ROOT; }; 9B4286F61A0D2FC500E9913B /* logo_big.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = logo_big.png; path = SweetAlert/logo_big.png; sourceTree = SOURCE_ROOT; }; 9B4286F71A0D2FC500E9913B /* SweetAlert.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = SweetAlert.png; path = SweetAlert/SweetAlert.png; sourceTree = SOURCE_ROOT; }; - 9B4CD1081A06E55200B65DE0 /* SweetAlert.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SweetAlert.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 9B4CD1081A06E55200B65DE0 /* SweetAlert_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SweetAlert_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9B4CD1301A06E9C400B65DE0 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 9BCAC7A41A0E0B3600282753 /* thumb.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = thumb.jpg; sourceTree = SOURCE_ROOT; }; + DFE352FFEBBF084332DFAFA1 /* Pods_SweetAlert.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SweetAlert.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -42,12 +43,31 @@ buildActionMask = 2147483647; files = ( 9B4CD1311A06E9C400B65DE0 /* QuartzCore.framework in Frameworks */, + 99C82A2380BFA3A989CD8CF2 /* Pods_SweetAlert_Example.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 489D30C8BBF06DBAA9E07174 /* Pods */ = { + isa = PBXGroup; + children = ( + 22C2406019C8DC4D27453217 /* Pods-SweetAlert_Example.debug.xcconfig */, + 5F449D00C383589054EF03C2 /* Pods-SweetAlert_Example.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 6F2524AC9DC11C207B769DEE /* Frameworks */ = { + isa = PBXGroup; + children = ( + DFE352FFEBBF084332DFAFA1 /* Pods_SweetAlert.framework */, + 69E2B89D4CDEF0719694AC70 /* Pods_SweetAlert_Example.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 9B4286FB1A0D300300E9913B /* Frameworks */ = { isa = PBXGroup; children = ( @@ -61,14 +81,15 @@ children = ( 9B4CD10A1A06E55200B65DE0 /* SweetAlert */, 9B4CD1091A06E55200B65DE0 /* Products */, - 784869A188ADBAB6A90C84DF /* SweetAlert.podspec */, + 489D30C8BBF06DBAA9E07174 /* Pods */, + 6F2524AC9DC11C207B769DEE /* Frameworks */, ); sourceTree = ""; }; 9B4CD1091A06E55200B65DE0 /* Products */ = { isa = PBXGroup; children = ( - 9B4CD1081A06E55200B65DE0 /* SweetAlert.app */, + 9B4CD1081A06E55200B65DE0 /* SweetAlert_Example.app */, ); name = Products; sourceTree = ""; @@ -76,12 +97,8 @@ 9B4CD10A1A06E55200B65DE0 /* SweetAlert */ = { isa = PBXGroup; children = ( - 9B4CD12D1A06E7EF00B65DE0 /* SweetAlert */, 9B4286E91A0D2F7700E9913B /* AppDelegate.swift */, - 9B4286EA1A0D2F7700E9913B /* ViewController.swift */, - 9B4286EF1A0D2FAF00E9913B /* LaunchScreen.xib */, - 9B4286F11A0D2FAF00E9913B /* Main.storyboard */, - 9B4286ED1A0D2FA000E9913B /* Images.xcassets */, + 951A808A1D747DF4000FEF30 /* ViewController.swift */, 9B4CD10B1A06E55200B65DE0 /* Supporting Files */, ); name = SweetAlert; @@ -91,6 +108,9 @@ 9B4CD10B1A06E55200B65DE0 /* Supporting Files */ = { isa = PBXGroup; children = ( + 9B4286ED1A0D2FA000E9913B /* Images.xcassets */, + 9B4286F11A0D2FAF00E9913B /* Main.storyboard */, + 9B4286EF1A0D2FAF00E9913B /* LaunchScreen.xib */, 9BCAC7A41A0E0B3600282753 /* thumb.jpg */, 9B4286FB1A0D300300E9913B /* Frameworks */, 9B4286F51A0D2FC500E9913B /* Info.plist */, @@ -100,32 +120,27 @@ name = "Supporting Files"; sourceTree = ""; }; - 9B4CD12D1A06E7EF00B65DE0 /* SweetAlert */ = { - isa = PBXGroup; - children = ( - 9B4286E71A0D2F5C00E9913B /* SweetAlert.swift */, - ); - name = SweetAlert; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 9B4CD1071A06E55200B65DE0 /* SweetAlert */ = { + 9B4CD1071A06E55200B65DE0 /* SweetAlert_Example */ = { isa = PBXNativeTarget; - buildConfigurationList = 9B4CD1271A06E55300B65DE0 /* Build configuration list for PBXNativeTarget "SweetAlert" */; + buildConfigurationList = 9B4CD1271A06E55300B65DE0 /* Build configuration list for PBXNativeTarget "SweetAlert_Example" */; buildPhases = ( + 9E2C19A532D3F34A79BF4B35 /* 📦 Check Pods Manifest.lock */, 9B4CD1041A06E55200B65DE0 /* Sources */, 9B4CD1051A06E55200B65DE0 /* Frameworks */, 9B4CD1061A06E55200B65DE0 /* Resources */, + AF00CD7142872EC0C18DCD68 /* 📦 Embed Pods Frameworks */, + C3CDF2FF5B972BC8337C60B2 /* 📦 Copy Pods Resources */, ); buildRules = ( ); dependencies = ( ); - name = SweetAlert; + name = SweetAlert_Example; productName = GNDBLAlert; - productReference = 9B4CD1081A06E55200B65DE0 /* SweetAlert.app */; + productReference = 9B4CD1081A06E55200B65DE0 /* SweetAlert_Example.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -142,7 +157,7 @@ }; }; }; - buildConfigurationList = 9B4CD1031A06E55200B65DE0 /* Build configuration list for PBXProject "SweetAlert" */; + buildConfigurationList = 9B4CD1031A06E55200B65DE0 /* Build configuration list for PBXProject "SweetAlert_Example" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -155,7 +170,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 9B4CD1071A06E55200B65DE0 /* SweetAlert */, + 9B4CD1071A06E55200B65DE0 /* SweetAlert_Example */, ); }; /* End PBXProject section */ @@ -171,20 +186,66 @@ 9B4286F41A0D2FAF00E9913B /* Main.storyboard in Resources */, 9B4286F91A0D2FC500E9913B /* logo_big.png in Resources */, 9BCAC7A51A0E0B3600282753 /* thumb.jpg in Resources */, - 784864ED6A0B7AF68C8DE1D8 /* SweetAlert.podspec in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 9E2C19A532D3F34A79BF4B35 /* 📦 Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + AF00CD7142872EC0C18DCD68 /* 📦 Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SweetAlert_Example/Pods-SweetAlert_Example-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + C3CDF2FF5B972BC8337C60B2 /* 📦 Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SweetAlert_Example/Pods-SweetAlert_Example-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 9B4CD1041A06E55200B65DE0 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9B4286EC1A0D2F7700E9913B /* ViewController.swift in Sources */, + 951A808B1D747DF4000FEF30 /* ViewController.swift in Sources */, 9B4286EB1A0D2F7700E9913B /* AppDelegate.swift in Sources */, - 9B4286E81A0D2F5C00E9913B /* SweetAlert.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -290,30 +351,32 @@ }; 9B4CD1281A06E55300B65DE0 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 22C2406019C8DC4D27453217 /* Pods-SweetAlert_Example.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = SweetAlert/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "GNDBL.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = SweetAlert_Example; }; name = Debug; }; 9B4CD1291A06E55300B65DE0 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 5F449D00C383589054EF03C2 /* Pods-SweetAlert_Example.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = SweetAlert/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "GNDBL.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = SweetAlert_Example; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 9B4CD1031A06E55200B65DE0 /* Build configuration list for PBXProject "SweetAlert" */ = { + 9B4CD1031A06E55200B65DE0 /* Build configuration list for PBXProject "SweetAlert_Example" */ = { isa = XCConfigurationList; buildConfigurations = ( 9B4CD1251A06E55300B65DE0 /* Debug */, @@ -322,7 +385,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 9B4CD1271A06E55300B65DE0 /* Build configuration list for PBXNativeTarget "SweetAlert" */ = { + 9B4CD1271A06E55300B65DE0 /* Build configuration list for PBXNativeTarget "SweetAlert_Example" */ = { isa = XCConfigurationList; buildConfigurations = ( 9B4CD1281A06E55300B65DE0 /* Debug */, diff --git a/SweetAlert.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/SweetAlert_Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from SweetAlert.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Example/SweetAlert_Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Example/SweetAlert_Example.xcworkspace/contents.xcworkspacedata b/Example/SweetAlert_Example.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..89d4cc6 --- /dev/null +++ b/Example/SweetAlert_Example.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Example/Tests/Info.plist b/Example/Tests/Info.plist new file mode 100644 index 0000000..ba72822 --- /dev/null +++ b/Example/Tests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Example/Tests/Tests.swift b/Example/Tests/Tests.swift new file mode 100644 index 0000000..772caac --- /dev/null +++ b/Example/Tests/Tests.swift @@ -0,0 +1,29 @@ +import UIKit +import XCTest +import SweetAlert + +class Tests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + XCTAssert(true, "Pass") + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measureBlock() { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/thumb.jpg b/Example/thumb.jpg similarity index 100% rename from thumb.jpg rename to Example/thumb.jpg diff --git a/SweetAlert.podspec b/SweetAlert.podspec index b890cd6..0ee519d 100644 --- a/SweetAlert.podspec +++ b/SweetAlert.podspec @@ -1,13 +1,44 @@ +# +# Be sure to run `pod lib lint SweetAlert.podspec' to ensure this is a +# valid spec before submitting. +# +# Any lines starting with a # are optional, but their use is encouraged +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# + Pod::Spec.new do |s| - s.name = "SweetAlert" - s.version = "0.1.0" - s.summary = "Thin wrapper around NSURLSession in Swift. Simplifies HTTP requests." - s.homepage = "https://github.com/codestergit/SweetAlert-iOS" - s.license = 'MIT' - s.author = {'codestergit' => 'https://github.com/codestergit/SweetAlert-iOS'} - s.source = { :git => 'https://github.com/codestergit/SweetAlert-iOS.git', :tag => "#{s.version}"} + s.name = 'SweetAlert' + s.version = '0.1.0' + s.summary = 'Beautiful Animated custom Alert View.' + +# This description is used to generate tags and improve search results. +# * Think: What does it do? Why did you write it? What is the focus? +# * Try to keep it short, snappy and to the point. +# * Write the description between the DESC delimiters below. +# * Finally, don't worry about the indent, CocoaPods strips it! + + s.description = <<-DESC +Beautiful Animated custom Alert View inspired from javascript library [SweetAlert](http://tristanedwards.me/sweetalert). +Written in Swift this SweetAlertView can be used in Swift and Objective-C projects. SweetAlertView provides live intutive experience to user actions.It can be used in place of `UIAlertView` and `UIAlertController` + DESC + + s.homepage = 'http://tristanedwards.me/sweetalert' + s.screenshots = 'https://github.com/codestergit/SweetAlert-iOS/blob/master/SweetAlertiOS.gif' + s.license = { :type => 'MIT', :file => 'LICENSE' } + s.author = {'codestergit' => 'https://github.com/codestergit/SweetAlert-iOS'} + s.source = { :git => 'https://github.com/southfox/SweetAlert.git', :tag => s.version.to_s } + # s.social_media_url = 'https://twitter.com/' + s.ios.deployment_target = '8.0' - s.watchos.deployment_target = '2.2' - s.source_files = 'SweetAlert/*.swift' + + s.source_files = 'SweetAlert/Classes/**/*' + + # s.resource_bundles = { + # 'SweetAlert' => ['SweetAlert/Assets/*.png'] + # } + + # s.public_header_files = 'Pod/Classes/**/*.h' + s.frameworks = 'UIKit' + # s.dependency 'AFNetworking', '~> 2.3' s.requires_arc = 'true' end diff --git a/SweetAlert.xcodeproj/project.xcworkspace/xcuserdata/gndbl.xcuserdatad/WorkspaceSettings.xcsettings b/SweetAlert.xcodeproj/project.xcworkspace/xcuserdata/gndbl.xcuserdatad/WorkspaceSettings.xcsettings deleted file mode 100644 index bfffcfe..0000000 --- a/SweetAlert.xcodeproj/project.xcworkspace/xcuserdata/gndbl.xcuserdatad/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,10 +0,0 @@ - - - - - HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges - - SnapshotAutomaticallyBeforeSignificantChanges - - - diff --git a/SweetAlert.xcodeproj/xcuserdata/gndbl.xcuserdatad/xcschemes/SweetAlert.xcscheme b/SweetAlert.xcodeproj/xcuserdata/gndbl.xcuserdatad/xcschemes/SweetAlert.xcscheme deleted file mode 100644 index 97d88ac..0000000 --- a/SweetAlert.xcodeproj/xcuserdata/gndbl.xcuserdatad/xcschemes/SweetAlert.xcscheme +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/SweetAlert.xcodeproj/xcuserdata/gndbl.xcuserdatad/xcschemes/xcschememanagement.plist b/SweetAlert.xcodeproj/xcuserdata/gndbl.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index dc2b51c..0000000 --- a/SweetAlert.xcodeproj/xcuserdata/gndbl.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,27 +0,0 @@ - - - - - SchemeUserState - - SweetAlert.xcscheme - - orderHint - 1 - - - SuppressBuildableAutocreation - - 9B4CD1071A06E55200B65DE0 - - primary - - - 9B4CD11C1A06E55300B65DE0 - - primary - - - - - diff --git a/SweetAlert/Assets/.gitkeep b/SweetAlert/Assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/SweetAlert/Classes/.gitkeep b/SweetAlert/Classes/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/SweetAlert/SweetAlert.swift b/SweetAlert/Classes/SweetAlert.swift similarity index 98% rename from SweetAlert/SweetAlert.swift rename to SweetAlert/Classes/SweetAlert.swift index 460a43f..53702ca 100644 --- a/SweetAlert/SweetAlert.swift +++ b/SweetAlert/Classes/SweetAlert.swift @@ -36,7 +36,7 @@ public class SweetAlert: UIViewController { var userAction:((isOtherButton: Bool) -> Void)? = nil let kFont = "Helvetica" - init() { + public init() { super.init(nibName: nil, bundle: nil) self.view.frame = UIScreen.mainScreen().bounds self.view.autoresizingMask = [UIViewAutoresizing.FlexibleHeight, UIViewAutoresizing.FlexibleWidth] @@ -600,15 +600,3 @@ class SuccessAnimatedView: AnimatableView { } } - -extension UIColor { - class func colorFromRGB(rgbValue: UInt) -> UIColor { - return UIColor( - red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0, - green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0, - blue: CGFloat(rgbValue & 0x0000FF) / 255.0, - alpha: CGFloat(1.0) - ) - } -} - diff --git a/SweetAlert/Classes/UIColor+SweetAlert.swift b/SweetAlert/Classes/UIColor+SweetAlert.swift new file mode 100644 index 0000000..46ed013 --- /dev/null +++ b/SweetAlert/Classes/UIColor+SweetAlert.swift @@ -0,0 +1,20 @@ +// +// UIColor+SweetAlert.swift +// Pods +// +// Created by Javier Fuchs on 8/29/16. +// +// + +import Foundation + +extension UIColor { + public class func colorFromRGB(rgbValue: UInt) -> UIColor { + return UIColor( + red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0, + green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0, + blue: CGFloat(rgbValue & 0x0000FF) / 255.0, + alpha: CGFloat(1.0) + ) + } +} From a174a6b577545e5105b5234280b2d1b0cdd5f365 Mon Sep 17 00:00:00 2001 From: Javier Fuchs Date: Mon, 29 Aug 2016 11:48:36 -0300 Subject: [PATCH 5/5] Bad url. Fix --- SweetAlert.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SweetAlert.podspec b/SweetAlert.podspec index 0ee519d..ad1c8b6 100644 --- a/SweetAlert.podspec +++ b/SweetAlert.podspec @@ -26,7 +26,7 @@ Written in Swift this SweetAlertView can be used in Swift and Objective-C projec s.screenshots = 'https://github.com/codestergit/SweetAlert-iOS/blob/master/SweetAlertiOS.gif' s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = {'codestergit' => 'https://github.com/codestergit/SweetAlert-iOS'} - s.source = { :git => 'https://github.com/southfox/SweetAlert.git', :tag => s.version.to_s } + s.source = { :git => 'https://github.com/codestergit/SweetAlert.git', :tag => s.version.to_s } # s.social_media_url = 'https://twitter.com/' s.ios.deployment_target = '8.0'