diff --git a/Podfile b/Podfile index ebf8d0a..cd3829a 100644 --- a/Podfile +++ b/Podfile @@ -1,8 +1,7 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :osx, '10.10' use_frameworks! -target 'SlackRTMKit' do +target 'SlackKit' do pod 'Starscream' end \ No newline at end of file diff --git a/README.md b/README.md index b1f548b..f691c39 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,41 @@ -# SlackRTMKit -a Swift wrapper of the Slack RTM API +#SlackKit +##iOS/OS X Slack Client Library +###Description +This is a Slack client library for iOS and OS X written in Swift. It's intended to expose all of the functionality of Slack's [Real Time Messaging API](https://api.slack.com/rtm). + +###Installation +####CocoaPods +Add the pod to your podfile: +``` +pod 'SlackKit' +``` +and run +``` +pod install +``` + +To use the library in your project import it: +``` +import SlackKit +``` + +###Usage +To use SlackRTMKit you'll need a bearer token which identifies a single user. You can generate a [full access token or create one using OAuth 2](https://api.slack.com/web). + +Once you have a token, give it to the Client: +```swift +Client.sharedInstance.setAuthToken("YOUR_SLACK_AUTH_TOKEN") +``` +and connect: +```swift +Client.sharedInstance.connect() +``` +Once connected, the client will begin to consume any messages sent by the Slack RTM API. + +###Examples +####Sending a Message: +```swift +Client.sharedInstance.sendMessage(message: "Hello, world!", channelID: "CHANNEL_ID") +``` + + diff --git a/SlackRTMKit/SlackRTMKit.h b/SlackKit.h similarity index 76% rename from SlackRTMKit/SlackRTMKit.h rename to SlackKit.h index e0e91ee..c8a8003 100644 --- a/SlackRTMKit/SlackRTMKit.h +++ b/SlackKit.h @@ -1,5 +1,5 @@ // -// SlackRTMKit.h +// SlackKit.h // // Copyright © 2015 Peter Zignego. All rights reserved. // @@ -23,12 +23,8 @@ #import -//! Project version number for SlackRTMKit. -FOUNDATION_EXPORT double SlackRTMKitVersionNumber; - -//! Project version string for SlackRTMKit. -FOUNDATION_EXPORT const unsigned char SlackRTMKitVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - +//! Project version number for SlackKit. +FOUNDATION_EXPORT double SlackKitVersionNumber; +//! Project version string for SlackKit. +FOUNDATION_EXPORT const unsigned char SlackKitVersionString[]; diff --git a/SlackRTMKit.podspec b/SlackKit.podspec similarity index 63% rename from SlackRTMKit.podspec rename to SlackKit.podspec index 3d45288..843cdd1 100644 --- a/SlackRTMKit.podspec +++ b/SlackKit.podspec @@ -1,16 +1,16 @@ Pod::Spec.new do |s| - s.name = "SlackRTMKit" + s.name = "SlackKit" s.version = "0.9.0" - s.summary = "a Swift wrapper of the Slack RTM API" - s.homepage = "https://github.com/pvzig/SlackRTMKit" + s.summary = "a Slack client library for iOS and OS X written in Swift" + s.homepage = "https://github.com/pvzig/SlackKit" s.license = 'MIT' s.author = { "Peter Zignego" => "peter@launchsoft.co" } - s.source = { :git => "https://github.com/pvzig/SlackRTMKit.git", :tag => s.version.to_s } + s.source = { :git => "https://github.com/pvzig/SlackKit.git", :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/pvzig' s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.9' s.requires_arc = true - s.source_files = 'SlackRTMKit/**/*' + s.source_files = 'SlackKit/**/*' s.frameworks = 'Foundation' s.dependency 'Starscream', '~> 1.0.1' end diff --git a/SlackRTMKit.xcodeproj/project.pbxproj b/SlackKit.xcodeproj/project.pbxproj similarity index 60% rename from SlackRTMKit.xcodeproj/project.pbxproj rename to SlackKit.xcodeproj/project.pbxproj index 866947d..738c72f 100644 --- a/SlackRTMKit.xcodeproj/project.pbxproj +++ b/SlackKit.xcodeproj/project.pbxproj @@ -7,39 +7,38 @@ objects = { /* Begin PBXBuildFile section */ - 26072A381BB48B3B00CD650C /* SlackRTMKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 26072A371BB48B3B00CD650C /* SlackRTMKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 26072A4A1BB48F7600CD650C /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26072A3F1BB48F7600CD650C /* Client.swift */; settings = {ASSET_TAGS = (); }; }; - 26072A4B1BB48F7600CD650C /* Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26072A401BB48F7600CD650C /* Event.swift */; settings = {ASSET_TAGS = (); }; }; - 26072A4C1BB48F7600CD650C /* EventDispatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26072A411BB48F7600CD650C /* EventDispatcher.swift */; settings = {ASSET_TAGS = (); }; }; - 26072A4D1BB48F7600CD650C /* EventHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26072A421BB48F7600CD650C /* EventHandler.swift */; settings = {ASSET_TAGS = (); }; }; - 26072A4E1BB48F7600CD650C /* Types.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26072A431BB48F7600CD650C /* Types.swift */; settings = {ASSET_TAGS = (); }; }; - 26072A4F1BB48F7600CD650C /* Channel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26072A441BB48F7600CD650C /* Channel.swift */; settings = {ASSET_TAGS = (); }; }; - 26072A501BB48F7600CD650C /* Bot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26072A451BB48F7600CD650C /* Bot.swift */; settings = {ASSET_TAGS = (); }; }; - 26072A511BB48F7600CD650C /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26072A461BB48F7600CD650C /* File.swift */; settings = {ASSET_TAGS = (); }; }; - 26072A521BB48F7600CD650C /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26072A471BB48F7600CD650C /* Message.swift */; settings = {ASSET_TAGS = (); }; }; - 26072A531BB48F7600CD650C /* Team.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26072A481BB48F7600CD650C /* Team.swift */; settings = {ASSET_TAGS = (); }; }; - 26072A541BB48F7600CD650C /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26072A491BB48F7600CD650C /* User.swift */; settings = {ASSET_TAGS = (); }; }; - 53B3CE1F797A621E29EC737E /* Pods_SlackRTMKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 035936C333DAAB690C85D0E8 /* Pods_SlackRTMKit.framework */; settings = {ATTRIBUTES = (Required, ); }; }; + 2661A68F1BBF60E60026F67B /* Bot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2661A6821BBF60E60026F67B /* Bot.swift */; settings = {ASSET_TAGS = (); }; }; + 2661A6901BBF60E60026F67B /* Channel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2661A6831BBF60E60026F67B /* Channel.swift */; settings = {ASSET_TAGS = (); }; }; + 2661A6911BBF60E60026F67B /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2661A6841BBF60E60026F67B /* Client.swift */; settings = {ASSET_TAGS = (); }; }; + 2661A6921BBF60E60026F67B /* Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2661A6851BBF60E60026F67B /* Event.swift */; settings = {ASSET_TAGS = (); }; }; + 2661A6931BBF60E60026F67B /* EventDispatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2661A6861BBF60E60026F67B /* EventDispatcher.swift */; settings = {ASSET_TAGS = (); }; }; + 2661A6941BBF60E60026F67B /* EventHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2661A6871BBF60E60026F67B /* EventHandler.swift */; settings = {ASSET_TAGS = (); }; }; + 2661A6951BBF60E60026F67B /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2661A6881BBF60E60026F67B /* File.swift */; settings = {ASSET_TAGS = (); }; }; + 2661A6971BBF60E60026F67B /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2661A68A1BBF60E60026F67B /* Message.swift */; settings = {ASSET_TAGS = (); }; }; + 2661A6991BBF60E60026F67B /* Team.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2661A68C1BBF60E60026F67B /* Team.swift */; settings = {ASSET_TAGS = (); }; }; + 2661A69A1BBF60E60026F67B /* Types.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2661A68D1BBF60E60026F67B /* Types.swift */; settings = {ASSET_TAGS = (); }; }; + 2661A69B1BBF60E60026F67B /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2661A68E1BBF60E60026F67B /* User.swift */; settings = {ASSET_TAGS = (); }; }; + FFE3AC870D1C42EF276CCA2D /* Pods_SlackKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 407A2ABFC0611867E2BE34D0 /* Pods_SlackKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 035936C333DAAB690C85D0E8 /* Pods_SlackRTMKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SlackRTMKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 0B116D26EA6A7261C081F0CA /* Pods-SlackRTMKit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SlackRTMKit.release.xcconfig"; path = "Pods/Target Support Files/Pods-SlackRTMKit/Pods-SlackRTMKit.release.xcconfig"; sourceTree = ""; }; - 26072A341BB48B3A00CD650C /* SlackRTMKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SlackRTMKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 26072A371BB48B3B00CD650C /* SlackRTMKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SlackRTMKit.h; sourceTree = ""; }; - 26072A391BB48B3B00CD650C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 26072A3F1BB48F7600CD650C /* Client.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - 26072A401BB48F7600CD650C /* Event.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Event.swift; sourceTree = ""; }; - 26072A411BB48F7600CD650C /* EventDispatcher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventDispatcher.swift; sourceTree = ""; }; - 26072A421BB48F7600CD650C /* EventHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventHandler.swift; sourceTree = ""; }; - 26072A431BB48F7600CD650C /* Types.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Types.swift; sourceTree = ""; }; - 26072A441BB48F7600CD650C /* Channel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Channel.swift; sourceTree = ""; }; - 26072A451BB48F7600CD650C /* Bot.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Bot.swift; sourceTree = ""; }; - 26072A461BB48F7600CD650C /* File.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; - 26072A471BB48F7600CD650C /* Message.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Message.swift; sourceTree = ""; }; - 26072A481BB48F7600CD650C /* Team.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Team.swift; sourceTree = ""; }; - 26072A491BB48F7600CD650C /* User.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - 9BAD395464A278A7F1476AAC /* Pods-SlackRTMKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SlackRTMKit.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SlackRTMKit/Pods-SlackRTMKit.debug.xcconfig"; sourceTree = ""; }; + 26072A341BB48B3A00CD650C /* SlackKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SlackKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 2661A6821BBF60E60026F67B /* Bot.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Bot.swift; sourceTree = ""; }; + 2661A6831BBF60E60026F67B /* Channel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Channel.swift; sourceTree = ""; }; + 2661A6841BBF60E60026F67B /* Client.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; + 2661A6851BBF60E60026F67B /* Event.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Event.swift; sourceTree = ""; }; + 2661A6861BBF60E60026F67B /* EventDispatcher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventDispatcher.swift; sourceTree = ""; }; + 2661A6871BBF60E60026F67B /* EventHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventHandler.swift; sourceTree = ""; }; + 2661A6881BBF60E60026F67B /* File.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; + 2661A6891BBF60E60026F67B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 2661A68A1BBF60E60026F67B /* Message.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Message.swift; sourceTree = ""; }; + 2661A68C1BBF60E60026F67B /* Team.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Team.swift; sourceTree = ""; }; + 2661A68D1BBF60E60026F67B /* Types.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Types.swift; sourceTree = ""; }; + 2661A68E1BBF60E60026F67B /* User.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + 2661A6A41BBF62FF0026F67B /* SlackKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SlackKit.h; sourceTree = ""; }; + 407A2ABFC0611867E2BE34D0 /* Pods_SlackKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SlackKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 4347F92F3932C96C23B10B2A /* Pods-SlackKit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SlackKit.release.xcconfig"; path = "Pods/Target Support Files/Pods-SlackKit/Pods-SlackKit.release.xcconfig"; sourceTree = ""; }; + F59B6A12F1C4C4E24C58E1BF /* Pods-SlackKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SlackKit.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SlackKit/Pods-SlackKit.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -47,68 +46,68 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 53B3CE1F797A621E29EC737E /* Pods_SlackRTMKit.framework in Frameworks */, + FFE3AC870D1C42EF276CCA2D /* Pods_SlackKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 0C2928E508A686B69F9F0117 /* Pods */ = { + isa = PBXGroup; + children = ( + F59B6A12F1C4C4E24C58E1BF /* Pods-SlackKit.debug.xcconfig */, + 4347F92F3932C96C23B10B2A /* Pods-SlackKit.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; 26072A2A1BB48B3A00CD650C = { isa = PBXGroup; children = ( - 26072A361BB48B3A00CD650C /* SlackRTMKit */, + 2661A6811BBF60E60026F67B /* SlackKit */, 26072A351BB48B3A00CD650C /* Products */, - B8514938A3BEF84AEA389C69 /* Pods */, - 527FDEF0E909025D7B60F7E2 /* Frameworks */, + 0C2928E508A686B69F9F0117 /* Pods */, + CA70A3A1A9A1A259960DFBCF /* Frameworks */, ); sourceTree = ""; }; 26072A351BB48B3A00CD650C /* Products */ = { isa = PBXGroup; children = ( - 26072A341BB48B3A00CD650C /* SlackRTMKit.framework */, + 26072A341BB48B3A00CD650C /* SlackKit.framework */, ); name = Products; sourceTree = ""; }; - 26072A361BB48B3A00CD650C /* SlackRTMKit */ = { + 2661A6811BBF60E60026F67B /* SlackKit */ = { isa = PBXGroup; children = ( - 26072A371BB48B3B00CD650C /* SlackRTMKit.h */, - 26072A3F1BB48F7600CD650C /* Client.swift */, - 26072A401BB48F7600CD650C /* Event.swift */, - 26072A411BB48F7600CD650C /* EventDispatcher.swift */, - 26072A421BB48F7600CD650C /* EventHandler.swift */, - 26072A431BB48F7600CD650C /* Types.swift */, - 26072A441BB48F7600CD650C /* Channel.swift */, - 26072A451BB48F7600CD650C /* Bot.swift */, - 26072A461BB48F7600CD650C /* File.swift */, - 26072A471BB48F7600CD650C /* Message.swift */, - 26072A481BB48F7600CD650C /* Team.swift */, - 26072A491BB48F7600CD650C /* User.swift */, - 26072A391BB48B3B00CD650C /* Info.plist */, + 2661A6821BBF60E60026F67B /* Bot.swift */, + 2661A6831BBF60E60026F67B /* Channel.swift */, + 2661A6841BBF60E60026F67B /* Client.swift */, + 2661A6851BBF60E60026F67B /* Event.swift */, + 2661A6861BBF60E60026F67B /* EventDispatcher.swift */, + 2661A6871BBF60E60026F67B /* EventHandler.swift */, + 2661A6881BBF60E60026F67B /* File.swift */, + 2661A68A1BBF60E60026F67B /* Message.swift */, + 2661A68C1BBF60E60026F67B /* Team.swift */, + 2661A68D1BBF60E60026F67B /* Types.swift */, + 2661A68E1BBF60E60026F67B /* User.swift */, + 2661A6A41BBF62FF0026F67B /* SlackKit.h */, + 2661A6891BBF60E60026F67B /* Info.plist */, ); - path = SlackRTMKit; + path = SlackKit; sourceTree = ""; }; - 527FDEF0E909025D7B60F7E2 /* Frameworks */ = { + CA70A3A1A9A1A259960DFBCF /* Frameworks */ = { isa = PBXGroup; children = ( - 035936C333DAAB690C85D0E8 /* Pods_SlackRTMKit.framework */, + 407A2ABFC0611867E2BE34D0 /* Pods_SlackKit.framework */, ); name = Frameworks; sourceTree = ""; }; - B8514938A3BEF84AEA389C69 /* Pods */ = { - isa = PBXGroup; - children = ( - 9BAD395464A278A7F1476AAC /* Pods-SlackRTMKit.debug.xcconfig */, - 0B116D26EA6A7261C081F0CA /* Pods-SlackRTMKit.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -116,31 +115,30 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 26072A381BB48B3B00CD650C /* SlackRTMKit.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 26072A331BB48B3A00CD650C /* SlackRTMKit */ = { + 26072A331BB48B3A00CD650C /* SlackKit */ = { isa = PBXNativeTarget; - buildConfigurationList = 26072A3C1BB48B3B00CD650C /* Build configuration list for PBXNativeTarget "SlackRTMKit" */; + buildConfigurationList = 26072A3C1BB48B3B00CD650C /* Build configuration list for PBXNativeTarget "SlackKit" */; buildPhases = ( - 4A0A1069DCEED5EE46E27496 /* Check Pods Manifest.lock */, + EBD7A091EB278C5BA34791C5 /* Check Pods Manifest.lock */, 26072A2F1BB48B3A00CD650C /* Sources */, 26072A301BB48B3A00CD650C /* Frameworks */, 26072A311BB48B3A00CD650C /* Headers */, 26072A321BB48B3A00CD650C /* Resources */, - 0383AF48BC606A15D953AA08 /* Copy Pods Resources */, + AC19A945F408269E4B4132CC /* Copy Pods Resources */, ); buildRules = ( ); dependencies = ( ); - name = SlackRTMKit; + name = SlackKit; productName = SlackRTMKit; - productReference = 26072A341BB48B3A00CD650C /* SlackRTMKit.framework */; + productReference = 26072A341BB48B3A00CD650C /* SlackKit.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -151,14 +149,14 @@ attributes = { LastSwiftUpdateCheck = 0700; LastUpgradeCheck = 0700; - ORGANIZATIONNAME = "Skookum Digital Works"; + ORGANIZATIONNAME = "Launch Software LLC"; TargetAttributes = { 26072A331BB48B3A00CD650C = { CreatedOnToolsVersion = 7.0; }; }; }; - buildConfigurationList = 26072A2E1BB48B3A00CD650C /* Build configuration list for PBXProject "SlackRTMKit" */; + buildConfigurationList = 26072A2E1BB48B3A00CD650C /* Build configuration list for PBXProject "SlackKit" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -170,7 +168,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 26072A331BB48B3A00CD650C /* SlackRTMKit */, + 26072A331BB48B3A00CD650C /* SlackKit */, ); }; /* End PBXProject section */ @@ -186,7 +184,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0383AF48BC606A15D953AA08 /* Copy Pods Resources */ = { + AC19A945F408269E4B4132CC /* Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -198,10 +196,10 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SlackRTMKit/Pods-SlackRTMKit-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SlackKit/Pods-SlackKit-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 4A0A1069DCEED5EE46E27496 /* Check Pods Manifest.lock */ = { + EBD7A091EB278C5BA34791C5 /* Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -223,17 +221,17 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 26072A4B1BB48F7600CD650C /* Event.swift in Sources */, - 26072A4F1BB48F7600CD650C /* Channel.swift in Sources */, - 26072A501BB48F7600CD650C /* Bot.swift in Sources */, - 26072A521BB48F7600CD650C /* Message.swift in Sources */, - 26072A4D1BB48F7600CD650C /* EventHandler.swift in Sources */, - 26072A4C1BB48F7600CD650C /* EventDispatcher.swift in Sources */, - 26072A511BB48F7600CD650C /* File.swift in Sources */, - 26072A4E1BB48F7600CD650C /* Types.swift in Sources */, - 26072A531BB48F7600CD650C /* Team.swift in Sources */, - 26072A4A1BB48F7600CD650C /* Client.swift in Sources */, - 26072A541BB48F7600CD650C /* User.swift in Sources */, + 2661A69A1BBF60E60026F67B /* Types.swift in Sources */, + 2661A6901BBF60E60026F67B /* Channel.swift in Sources */, + 2661A6921BBF60E60026F67B /* Event.swift in Sources */, + 2661A6971BBF60E60026F67B /* Message.swift in Sources */, + 2661A6991BBF60E60026F67B /* Team.swift in Sources */, + 2661A69B1BBF60E60026F67B /* User.swift in Sources */, + 2661A6951BBF60E60026F67B /* File.swift in Sources */, + 2661A6931BBF60E60026F67B /* EventDispatcher.swift in Sources */, + 2661A6911BBF60E60026F67B /* Client.swift in Sources */, + 2661A6941BBF60E60026F67B /* EventHandler.swift in Sources */, + 2661A68F1BBF60E60026F67B /* Bot.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -326,7 +324,7 @@ }; 26072A3D1BB48B3B00CD650C /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9BAD395464A278A7F1476AAC /* Pods-SlackRTMKit.debug.xcconfig */; + baseConfigurationReference = F59B6A12F1C4C4E24C58E1BF /* Pods-SlackKit.debug.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; COMBINE_HIDPI_IMAGES = YES; @@ -335,11 +333,11 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - INFOPLIST_FILE = SlackRTMKit/Info.plist; + INFOPLIST_FILE = SlackKit/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.launchsoft.SlackRTMKit; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_BUNDLE_IDENTIFIER = com.launchsoft.SlackKit; + PRODUCT_NAME = SlackKit; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -347,7 +345,7 @@ }; 26072A3E1BB48B3B00CD650C /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 0B116D26EA6A7261C081F0CA /* Pods-SlackRTMKit.release.xcconfig */; + baseConfigurationReference = 4347F92F3932C96C23B10B2A /* Pods-SlackKit.release.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; COMBINE_HIDPI_IMAGES = YES; @@ -356,11 +354,11 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - INFOPLIST_FILE = SlackRTMKit/Info.plist; + INFOPLIST_FILE = SlackKit/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.launchsoft.SlackRTMKit; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_BUNDLE_IDENTIFIER = com.launchsoft.SlackKit; + PRODUCT_NAME = SlackKit; SKIP_INSTALL = YES; }; name = Release; @@ -368,7 +366,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 26072A2E1BB48B3A00CD650C /* Build configuration list for PBXProject "SlackRTMKit" */ = { + 26072A2E1BB48B3A00CD650C /* Build configuration list for PBXProject "SlackKit" */ = { isa = XCConfigurationList; buildConfigurations = ( 26072A3A1BB48B3B00CD650C /* Debug */, @@ -377,7 +375,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 26072A3C1BB48B3B00CD650C /* Build configuration list for PBXNativeTarget "SlackRTMKit" */ = { + 26072A3C1BB48B3B00CD650C /* Build configuration list for PBXNativeTarget "SlackKit" */ = { isa = XCConfigurationList; buildConfigurations = ( 26072A3D1BB48B3B00CD650C /* Debug */, diff --git a/SlackRTMKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SlackKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from SlackRTMKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to SlackKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/SlackRTMKit.xcworkspace/contents.xcworkspacedata b/SlackKit.xcworkspace/contents.xcworkspacedata similarity index 79% rename from SlackRTMKit.xcworkspace/contents.xcworkspacedata rename to SlackKit.xcworkspace/contents.xcworkspacedata index 0a63fc6..cb44998 100644 --- a/SlackRTMKit.xcworkspace/contents.xcworkspacedata +++ b/SlackKit.xcworkspace/contents.xcworkspacedata @@ -2,7 +2,7 @@ + location = "group:SlackKit.xcodeproj"> diff --git a/SlackRTMKit/Bot.swift b/SlackKit/Bot.swift similarity index 100% rename from SlackRTMKit/Bot.swift rename to SlackKit/Bot.swift diff --git a/SlackRTMKit/Channel.swift b/SlackKit/Channel.swift similarity index 100% rename from SlackRTMKit/Channel.swift rename to SlackKit/Channel.swift diff --git a/SlackRTMKit/Client.swift b/SlackKit/Client.swift similarity index 96% rename from SlackRTMKit/Client.swift rename to SlackKit/Client.swift index d41bd59..52329ad 100644 --- a/SlackRTMKit/Client.swift +++ b/SlackKit/Client.swift @@ -166,6 +166,18 @@ public class Client: WebSocketDelegate { } } + // MARK: - Convenience methods + + public func IDForChannelName(name: String) -> String? { + for channel in channels! { + if (channel.1.name == name) { + return channel.1.id! + } + } + return nil + } + + // MARK: - WebSocketDelegate public func websocketDidConnect(socket: WebSocket) { print("Connected.") diff --git a/SlackRTMKit/Event.swift b/SlackKit/Event.swift similarity index 100% rename from SlackRTMKit/Event.swift rename to SlackKit/Event.swift diff --git a/SlackRTMKit/EventDispatcher.swift b/SlackKit/EventDispatcher.swift similarity index 100% rename from SlackRTMKit/EventDispatcher.swift rename to SlackKit/EventDispatcher.swift diff --git a/SlackRTMKit/EventHandler.swift b/SlackKit/EventHandler.swift similarity index 99% rename from SlackRTMKit/EventHandler.swift rename to SlackKit/EventHandler.swift index 3b5fe2d..f2ee0c4 100644 --- a/SlackRTMKit/EventHandler.swift +++ b/SlackKit/EventHandler.swift @@ -21,6 +21,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +import Foundation + internal struct EventHandler { //MARK: - Initial connection diff --git a/SlackRTMKit/File.swift b/SlackKit/File.swift similarity index 100% rename from SlackRTMKit/File.swift rename to SlackKit/File.swift diff --git a/SlackRTMKit/Info.plist b/SlackKit/Info.plist similarity index 100% rename from SlackRTMKit/Info.plist rename to SlackKit/Info.plist diff --git a/SlackRTMKit/Message.swift b/SlackKit/Message.swift similarity index 100% rename from SlackRTMKit/Message.swift rename to SlackKit/Message.swift diff --git a/SlackKit/SlackKit.h b/SlackKit/SlackKit.h new file mode 100644 index 0000000..c8a8003 --- /dev/null +++ b/SlackKit/SlackKit.h @@ -0,0 +1,30 @@ +// +// SlackKit.h +// +// Copyright © 2015 Peter Zignego. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +//! Project version number for SlackKit. +FOUNDATION_EXPORT double SlackKitVersionNumber; + +//! Project version string for SlackKit. +FOUNDATION_EXPORT const unsigned char SlackKitVersionString[]; diff --git a/SlackRTMKit/Team.swift b/SlackKit/Team.swift similarity index 100% rename from SlackRTMKit/Team.swift rename to SlackKit/Team.swift diff --git a/SlackRTMKit/Types.swift b/SlackKit/Types.swift similarity index 100% rename from SlackRTMKit/Types.swift rename to SlackKit/Types.swift diff --git a/SlackRTMKit/User.swift b/SlackKit/User.swift similarity index 100% rename from SlackRTMKit/User.swift rename to SlackKit/User.swift