Skip to content

Commit

Permalink
change to user testMode
Browse files Browse the repository at this point in the history
  • Loading branch information
KarmaGYZ committed Jun 22, 2015
1 parent 26754af commit 8759f14
Show file tree
Hide file tree
Showing 20 changed files with 145 additions and 44 deletions.
Binary file not shown.
24 changes: 2 additions & 22 deletions PKUKendo/PKUKendo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
AVOSCloud.setApplicationId("ql84x2woif2u3xk7p3qoska4i558v3ornikfkfga1l3ad59n", clientKey: "frzrwer3k3demoxounucm0ubfqzlvongad1h30avewweycd9")
AVAnalytics.trackAppOpenedWithLaunchOptions(launchOptions)

application.applicationIconBadgeNumber = 0

// application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: UIUserNotificationType.Badge | UIUserNotificationType.Alert |
// UIUserNotificationType.Sound, categories: nil))
// application.registerForRemoteNotifications()
AVPush.setProductionMode(false)

application.applicationIconBadgeNumber = 0

// ShareSDK.registerApp("7da56fc76f5e")
// ShareSDK.connectWeChatWithAppId("wxc9ddc67127da6ee5", wechatCls: WXApi.self)

// if let launchOpt = launchOptions {
// var notificationPayLoad:NSDictionary = launchOpt[UIApplicationLaunchOptionsRemoteNotificationKey] as! NSDictionary
// //KVNProgress.showErrorWithStatus("输出\(notificationPayLoad)输出")
// println("输出\(notificationPayLoad)输出")
// var message = MessageItem()
// var textDir:NSDictionary = notificationPayLoad.objectForKey("aps")! as! NSDictionary
// var text:String = textDir.objectForKey("alert")! as! String
// message.messageText = text
// message.userName = notificationPayLoad.objectForKey("user")! as! String
// message.userPhoto = UIImage(named: "usrwalker")
// messageList.append(message)
// self.window?.rootViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("TabBar") as! UITabBarController
// (self.window?.rootViewController as! UITabBarController).selectedIndex = 1
// }
application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: UIUserNotificationType.Badge | UIUserNotificationType.Alert |
UIUserNotificationType.Sound, categories: nil))
application.registerForRemoteNotifications()
Expand Down
17 changes: 11 additions & 6 deletions PKUKendo/PKUKendo/ArticleController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,17 @@ class ArticleController: UITableViewController,ArticleEditViewControllerDelegate
likeObj.setObject(self.article!.id, forKey: "article")
likeObj.saveEventually()

var pushQ = AVInstallation.query()
pushQ.whereKey("userId", equalTo: self.article!.userId)
var push = AVPush()
push.setQuery(pushQ)
push.setMessage("您的文章\(self.article!.title)收到一条点赞")
push.sendPushInBackground()
if self.article!.userId != AVUser.currentUser().objectId {

var pushQ = AVInstallation.query()
pushQ.whereKey("userId", equalTo: self.article!.userId)
var push = AVPush()


push.setQuery(pushQ)
push.setMessage("您的文章\(self.article!.title)收到一条点赞")
push.sendPushInBackground()
}

if err == nil {
self.article!.likeNum! += 1
Expand Down
5 changes: 5 additions & 0 deletions PKUKendo/PKUKendo/ArticleListController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ class ArticleListController: UITableViewController {

}
}

override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
self.tableView.deselectRowAtIndexPath(indexPath, animated: true)
}

override func viewDidLoad() {
super.viewDidLoad()

Expand Down
43 changes: 30 additions & 13 deletions PKUKendo/PKUKendo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@
</tabBar>
<connections>
<segue destination="3Gc-bi-7Po" kind="relationship" relationship="viewControllers" id="oxN-Jn-Tol"/>
<segue destination="QH1-dz-MRV" kind="relationship" relationship="viewControllers" id="cP7-eD-VIV"/>
<segue destination="WDg-ob-4gT" kind="relationship" relationship="viewControllers" id="B4T-4w-z8s"/>
<segue destination="0SK-bn-v3N" kind="relationship" relationship="viewControllers" id="tBe-I1-MBO"/>
<segue destination="QH1-dz-MRV" kind="relationship" relationship="viewControllers" id="cP7-eD-VIV"/>
</connections>
</tabBarController>
<placeholder placeholderIdentifier="IBFirstResponder" id="fGX-0h-9cW" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand Down Expand Up @@ -781,7 +781,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="eventCell" rowHeight="100" id="Rzw-Sq-Cr7">
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="eventCell" rowHeight="100" id="Rzw-Sq-Cr7">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Rzw-Sq-Cr7" id="wCM-tL-mDX">
<autoresizingMask key="autoresizingMask"/>
Expand Down Expand Up @@ -1260,18 +1260,34 @@
<scene sceneID="c0m-HQ-CUT">
<objects>
<tableViewController id="IhC-qU-r1K" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="RNg-yD-0WO">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="RNg-yD-0WO">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="LOJ-1i-bhc">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="LOJ-1i-bhc" id="oLz-Zg-LU2">
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
<sections>
<tableViewSection id="h28-S0-qEH">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="LOJ-1i-bhc">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="LOJ-1i-bhc" id="oLz-Zg-LU2">
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="dVU-XA-JIr">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="dVU-XA-JIr" id="KLH-RQ-20q">
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="Omc-Ws-PiR">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Omc-Ws-PiR" id="3I2-67-t5f">
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="IhC-qU-r1K" id="DgK-8k-NAL"/>
<outlet property="delegate" destination="IhC-qU-r1K" id="LdP-ea-X5W"/>
Expand Down Expand Up @@ -2242,11 +2258,11 @@
</objects>
<point key="canvasLocation" x="-3395" y="478"/>
</scene>
<!--Navigation Controller-->
<!--日志-->
<scene sceneID="g5v-Ar-4vi">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="3Gc-bi-7Po" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" systemItem="recents" id="ebS-Yt-I6X"/>
<tabBarItem key="tabBarItem" title="日志" image="jian" id="ebS-Yt-I6X"/>
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Frl-uK-ccQ">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
Expand Down Expand Up @@ -2375,6 +2391,7 @@
<image name="Like Filled-100" width="100" height="100"/>
<image name="Like-100" width="100" height="100"/>
<image name="User Male4-50" width="60" height="62"/>
<image name="jian" width="75" height="75"/>
<image name="kendobck" width="1008" height="567"/>
<image name="password_icon" width="21" height="31"/>
<image name="red-blue" width="1920" height="1080"/>
Expand Down
2 changes: 1 addition & 1 deletion PKUKendo/PKUKendo/CommentEditController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CommentEditController: UIViewController {
}
KVNProgress.dismiss()
KVNProgress.showSuccessWithStatus("发表成功")
if self.is_article == true{
if self.is_article == true && self.userId! != AVUser.currentUser().objectId{
var pushQ = AVInstallation.query()
pushQ.whereKey("userId", equalTo: self.userId!)
var push = AVPush()
Expand Down
4 changes: 4 additions & 0 deletions PKUKendo/PKUKendo/ContactsListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ class ContactsListViewController: UITableViewController {
}
*/

override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
self.tableView.deselectRowAtIndexPath(indexPath, animated: true)
}

/*
// Override to support rearranging the table view.
override func tableView(tableView: UITableView, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) {
Expand Down
22 changes: 22 additions & 0 deletions PKUKendo/PKUKendo/Images.xcassets/jian.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "Sketch210182339-1.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "Sketch210182339.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions PKUKendo/PKUKendo/Images.xcassets/jianbw.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "Sketch210182347-1.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "Sketch210182347.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions PKUKendo/PKUKendo/Images.xcassets/man.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "man.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "man-1.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions PKUKendo/PKUKendo/Images.xcassets/manbw.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "Sketch2101729aa59.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "Sketch2101729aa59-1.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions PKUKendo/PKUKendo/TabBarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ class TabBarViewController: UITabBarController {
super.viewDidLoad()

let items = self.tabBar.items as! [UITabBarItem]
items[1].selectedImage = UIImage(named: "123")!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
items[1].image = UIImage(named: "123")!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
items[3].selectedImage = UIImage(named: "man")!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
items[3].image = UIImage(named: "manbw")!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
items[0].selectedImage = UIImage(named: "jian")!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
items[0].image = UIImage(named: "jianbw")!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
// self.tabBarController?.tabBar.selectedItem?.image = UIImage(named: "123")!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
// // self.tabBarController?.tabBarItem.
// self.tabBarController?.tabBar.selectedItem?.selectedImage = UIImage(named: "123")!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
Expand Down

0 comments on commit 8759f14

Please sign in to comment.