diff --git a/librx.xcodeproj/project.pbxproj b/librx.xcodeproj/project.pbxproj index 4b2ff48..6b26b36 100644 --- a/librx.xcodeproj/project.pbxproj +++ b/librx.xcodeproj/project.pbxproj @@ -43,6 +43,11 @@ 45681F2E1B7F781E00D1E096 /* Replyable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45681F2D1B7F781E00D1E096 /* Replyable.swift */; }; 45681F301B7F79AF00D1E096 /* Shareable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45681F2F1B7F79AF00D1E096 /* Shareable.swift */; }; 45681F341B7F7C8A00D1E096 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45681F331B7F7C8A00D1E096 /* User.swift */; }; + 456A68191BE39C76001B3096 /* ShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 456A68181BE39C76001B3096 /* ShareViewController.swift */; }; + 456A681C1BE39C76001B3096 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 456A681A1BE39C76001B3096 /* MainInterface.storyboard */; }; + 456A68201BE39C76001B3096 /* libxShareExt.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 456A68161BE39C76001B3096 /* libxShareExt.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 456A68251BE3A853001B3096 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 45B11CD71B6FD12A008D6049 /* Images.xcassets */; }; + 456A68271BE3A893001B3096 /* LibrExtensionJavaScript.js in Resources */ = {isa = PBXBuildFile; fileRef = 456A68261BE3A893001B3096 /* LibrExtensionJavaScript.js */; }; 456CEF471BAC4F3E00E090BA /* Bootstrap.css in Resources */ = {isa = PBXBuildFile; fileRef = 456CEF461BAC4F3E00E090BA /* Bootstrap.css */; }; 456F1A171B6FD3D6007F9ACF /* MenuTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 456F1A161B6FD3D6007F9ACF /* MenuTableViewController.swift */; }; 456F1A1E1B6FD4D0007F9ACF /* MenuTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 456F1A1D1B6FD4D0007F9ACF /* MenuTableViewCell.swift */; }; @@ -97,9 +102,27 @@ remoteGlobalIDString = 452DC1121B6287E600847691; remoteInfo = librx; }; + 456A681E1BE39C76001B3096 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 452DC10B1B6287E600847691 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 456A68151BE39C76001B3096; + remoteInfo = libxShareExt; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + 456A68241BE39C77001B3096 /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 456A68201BE39C76001B3096 /* libxShareExt.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; 458B42A41B8A064B0050FEEC /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -168,6 +191,11 @@ 45681F2D1B7F781E00D1E096 /* Replyable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Replyable.swift; sourceTree = ""; }; 45681F2F1B7F79AF00D1E096 /* Shareable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Shareable.swift; sourceTree = ""; }; 45681F331B7F7C8A00D1E096 /* User.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + 456A68161BE39C76001B3096 /* libxShareExt.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = libxShareExt.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 456A68181BE39C76001B3096 /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = ""; }; + 456A681B1BE39C76001B3096 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; + 456A681D1BE39C76001B3096 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 456A68261BE3A893001B3096 /* LibrExtensionJavaScript.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = LibrExtensionJavaScript.js; sourceTree = ""; }; 456CEF461BAC4F3E00E090BA /* Bootstrap.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = Bootstrap.css; sourceTree = ""; }; 456F1A161B6FD3D6007F9ACF /* MenuTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuTableViewController.swift; sourceTree = ""; }; 456F1A1D1B6FD4D0007F9ACF /* MenuTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuTableViewCell.swift; sourceTree = ""; }; @@ -269,6 +297,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 456A68131BE39C76001B3096 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -278,6 +313,7 @@ 453BAB3A1B8B559800BA7DF7 /* frameworks */, 452DC1151B6287E600847691 /* librx */, 452DC12E1B6287E600847691 /* librxTests */, + 456A68171BE39C76001B3096 /* libxShareExt */, 452DC1141B6287E600847691 /* Products */, D6ECB170457345CE1B131906 /* Pods */, C80B41AD075A63EC90F9F7B5 /* Frameworks */, @@ -289,6 +325,7 @@ children = ( 452DC1131B6287E600847691 /* librx.app */, 452DC12B1B6287E600847691 /* librxTests.xctest */, + 456A68161BE39C76001B3096 /* libxShareExt.appex */, ); name = Products; sourceTree = ""; @@ -397,6 +434,17 @@ path = SinaSSO; sourceTree = ""; }; + 456A68171BE39C76001B3096 /* libxShareExt */ = { + isa = PBXGroup; + children = ( + 456A68181BE39C76001B3096 /* ShareViewController.swift */, + 456A681A1BE39C76001B3096 /* MainInterface.storyboard */, + 456A681D1BE39C76001B3096 /* Info.plist */, + 456A68261BE3A893001B3096 /* LibrExtensionJavaScript.js */, + ); + path = libxShareExt; + sourceTree = ""; + }; 456CEF451BAC4F0E00E090BA /* asserts */ = { isa = PBXGroup; children = ( @@ -599,10 +647,12 @@ 458B42A41B8A064B0050FEEC /* Embed Frameworks */, 5565530DF81768CE3443FED0 /* Embed Pods Frameworks */, 2EBDCAED66950FBEDE778D6C /* Copy Pods Resources */, + 456A68241BE39C77001B3096 /* Embed App Extensions */, ); buildRules = ( ); dependencies = ( + 456A681F1BE39C76001B3096 /* PBXTargetDependency */, ); name = librx; productName = librx; @@ -627,6 +677,23 @@ productReference = 452DC12B1B6287E600847691 /* librxTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + 456A68151BE39C76001B3096 /* libxShareExt */ = { + isa = PBXNativeTarget; + buildConfigurationList = 456A68231BE39C77001B3096 /* Build configuration list for PBXNativeTarget "libxShareExt" */; + buildPhases = ( + 456A68121BE39C76001B3096 /* Sources */, + 456A68131BE39C76001B3096 /* Frameworks */, + 456A68141BE39C76001B3096 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = libxShareExt; + productName = libxShareExt; + productReference = 456A68161BE39C76001B3096 /* libxShareExt.appex */; + productType = "com.apple.product-type.app-extension"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -645,6 +712,10 @@ CreatedOnToolsVersion = 6.3.1; TestTargetID = 452DC1121B6287E600847691; }; + 456A68151BE39C76001B3096 = { + CreatedOnToolsVersion = 7.1; + DevelopmentTeam = 25X8QKQ2XY; + }; }; }; buildConfigurationList = 452DC10E1B6287E600847691 /* Build configuration list for PBXProject "librx" */; @@ -663,6 +734,7 @@ targets = ( 452DC1121B6287E600847691 /* librx */, 452DC12A1B6287E600847691 /* librxTests */, + 456A68151BE39C76001B3096 /* libxShareExt */, ); }; /* End PBXProject section */ @@ -698,6 +770,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 456A68141BE39C76001B3096 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 456A68251BE3A853001B3096 /* Images.xcassets in Resources */, + 456A681C1BE39C76001B3096 /* MainInterface.storyboard in Resources */, + 456A68271BE3A893001B3096 /* LibrExtensionJavaScript.js in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -804,6 +886,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 456A68121BE39C76001B3096 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 456A68191BE39C76001B3096 /* ShareViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -812,6 +902,11 @@ target = 452DC1121B6287E600847691 /* librx */; targetProxy = 452DC12C1B6287E600847691 /* PBXContainerItemProxy */; }; + 456A681F1BE39C76001B3096 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 456A68151BE39C76001B3096 /* libxShareExt */; + targetProxy = 456A681E1BE39C76001B3096 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -831,6 +926,14 @@ name = LaunchScreen.xib; sourceTree = ""; }; + 456A681A1BE39C76001B3096 /* MainInterface.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 456A681B1BE39C76001B3096 /* Base */, + ); + name = MainInterface.storyboard; + sourceTree = ""; + }; 45EA2FC61BCA7A19004E6960 /* UMSocialLocalizable.strings */ = { isa = PBXVariantGroup; children = ( @@ -938,6 +1041,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -971,6 +1075,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1033,6 +1138,39 @@ }; name = Release; }; + 456A68211BE39C77001B3096 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = BrandAsset; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEBUG_INFORMATION_FORMAT = dwarf; + INFOPLIST_FILE = libxShareExt/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.librme.libr.libxShareExt; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 456A68221BE39C77001B3096 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = BrandAsset; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + INFOPLIST_FILE = libxShareExt/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.librme.libr.libxShareExt; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1063,6 +1201,14 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 456A68231BE39C77001B3096 /* Build configuration list for PBXNativeTarget "libxShareExt" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 456A68211BE39C77001B3096 /* Debug */, + 456A68221BE39C77001B3096 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; /* End XCConfigurationList section */ /* Begin XCVersionGroup section */ diff --git a/librx.xcodeproj/xcuserdata/ylzheng.xcuserdatad/xcschemes/xcschememanagement.plist b/librx.xcodeproj/xcuserdata/ylzheng.xcuserdatad/xcschemes/xcschememanagement.plist index 48fab34..529d25f 100644 --- a/librx.xcodeproj/xcuserdata/ylzheng.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/librx.xcodeproj/xcuserdata/ylzheng.xcuserdatad/xcschemes/xcschememanagement.plist @@ -9,6 +9,11 @@ orderHint 0 + libxShareExt.xcscheme + + orderHint + 12 + SuppressBuildableAutocreation @@ -22,6 +27,11 @@ primary + 456A68151BE39C76001B3096 + + primary + + diff --git a/librx/Base.lproj/LaunchScreen.xib b/librx/Base.lproj/LaunchScreen.xib index f7250d6..0d4c6c4 100644 --- a/librx/Base.lproj/LaunchScreen.xib +++ b/librx/Base.lproj/LaunchScreen.xib @@ -31,6 +31,9 @@ + + + @@ -40,6 +43,8 @@ + + @@ -49,5 +54,6 @@ + diff --git a/librx/Images.xcassets/AppIcon-2.appiconset/Contents.json b/librx/Images.xcassets/AppIcon-2.appiconset/Contents.json new file mode 100644 index 0000000..24e7ad1 --- /dev/null +++ b/librx/Images.xcassets/AppIcon-2.appiconset/Contents.json @@ -0,0 +1,42 @@ +{ + "images" : [ + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-40@2x.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-60@2x.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-Small@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-Small@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/librx/Images.xcassets/AppIcon-2.appiconset/Icon-40@2x.png b/librx/Images.xcassets/AppIcon-2.appiconset/Icon-40@2x.png new file mode 100644 index 0000000..613658b Binary files /dev/null and b/librx/Images.xcassets/AppIcon-2.appiconset/Icon-40@2x.png differ diff --git a/librx/Images.xcassets/AppIcon-2.appiconset/Icon-60@2x.png b/librx/Images.xcassets/AppIcon-2.appiconset/Icon-60@2x.png new file mode 100644 index 0000000..a89e9c3 Binary files /dev/null and b/librx/Images.xcassets/AppIcon-2.appiconset/Icon-60@2x.png differ diff --git a/librx/Images.xcassets/AppIcon-2.appiconset/Icon-Small@2x.png b/librx/Images.xcassets/AppIcon-2.appiconset/Icon-Small@2x.png new file mode 100644 index 0000000..f9d00d0 Binary files /dev/null and b/librx/Images.xcassets/AppIcon-2.appiconset/Icon-Small@2x.png differ diff --git a/librx/Images.xcassets/AppIcon-2.appiconset/Icon-Small@3x.png b/librx/Images.xcassets/AppIcon-2.appiconset/Icon-Small@3x.png new file mode 100644 index 0000000..65cc9ca Binary files /dev/null and b/librx/Images.xcassets/AppIcon-2.appiconset/Icon-Small@3x.png differ diff --git a/librx/Images.xcassets/BrandAsset.launchimage/Contents.json b/librx/Images.xcassets/BrandAsset.launchimage/Contents.json new file mode 100644 index 0000000..e37b649 --- /dev/null +++ b/librx/Images.xcassets/BrandAsset.launchimage/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "minimum-system-version" : "7.0", + "subtype" : "retina4", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/librx/StorysTableViewController.swift b/librx/StorysTableViewController.swift index a5a29db..83e1875 100644 --- a/librx/StorysTableViewController.swift +++ b/librx/StorysTableViewController.swift @@ -210,7 +210,7 @@ class StorysTableViewController: UITableViewController { print("refresh Content from default api") loadPosts() - timer = NSTimer.scheduledTimerWithTimeInterval(4.0, target: self, selector: "endOfWork", userInfo: nil, repeats: true) + timer = NSTimer.scheduledTimerWithTimeInterval(3.0, target: self, selector: "endOfWork", userInfo: nil, repeats: true) } func loadMore(sender:UIButton) { diff --git a/libxShareExt/Base.lproj/MainInterface.storyboard b/libxShareExt/Base.lproj/MainInterface.storyboard new file mode 100644 index 0000000..13790df --- /dev/null +++ b/libxShareExt/Base.lproj/MainInterface.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libxShareExt/Info.plist b/libxShareExt/Info.plist new file mode 100644 index 0000000..965f458 --- /dev/null +++ b/libxShareExt/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + Librme + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIcons~ipad + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + XPC! + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSExtension + + NSExtensionAttributes + + NSExtensionActivationRule + + NSExtensionActivationSupportsWebPageWithMaxCount + 1 + + + NSExtensionMainStoryboard + MainInterface + NSExtensionPointIdentifier + com.apple.share-services + + + diff --git a/libxShareExt/LibrExtensionJavaScript.js b/libxShareExt/LibrExtensionJavaScript.js new file mode 100644 index 0000000..cc60621 --- /dev/null +++ b/libxShareExt/LibrExtensionJavaScript.js @@ -0,0 +1,9 @@ +var LibrmeExtension = function() {}; + +LibrmeExtension.prototype = { +run: function(arguments) { + arguments.completionFunction({"baseURI" : document.baseURI}); +} +} + +var ExtensionPreprocessingJS = new LibrmeExtension; \ No newline at end of file diff --git a/libxShareExt/ShareViewController.swift b/libxShareExt/ShareViewController.swift new file mode 100644 index 0000000..f1c21ea --- /dev/null +++ b/libxShareExt/ShareViewController.swift @@ -0,0 +1,33 @@ +// +// ShareViewController.swift +// libxShareExt +// +// Created by Yunlong Zheng on 15/10/30. +// Copyright © 2015年 librx. All rights reserved. +// + +import UIKit +import Social + +class ShareViewController: SLComposeServiceViewController { + + override func isContentValid() -> Bool { + // Do validation of contentText and/or NSExtensionContext attachments here + return true + } + + override func didSelectPost() { + // This is called after the user selects Post. Do the upload of contentText and/or NSExtensionContext attachments. + + // Inform the host that we're done, so it un-blocks its UI. Note: Alternatively you could call super's -didSelectPost, which will similarly complete the extension context. + print("didSelectPost: \(contentText)") + + self.extensionContext!.completeRequestReturningItems([], completionHandler: nil) + } + + override func configurationItems() -> [AnyObject]! { + // To add configuration options via table cells at the bottom of the sheet, return an array of SLComposeSheetConfigurationItem here. + return [] + } + +}