Skip to content

Commit

Permalink
表情键盘布局完成,时间线内存控制优化
Browse files Browse the repository at this point in the history
  • Loading branch information
cache0928 committed Feb 24, 2016
1 parent d5bd68c commit 8960362
Show file tree
Hide file tree
Showing 322 changed files with 2,792 additions and 35 deletions.
36 changes: 36 additions & 0 deletions CCWeibo/CCWeibo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
C9C925F71C7960F80011AECF /* NewTextPostViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9C925F61C7960F80011AECF /* NewTextPostViewController.swift */; };
C9CA60201C66E7FB00A9F999 /* UserAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9CA601F1C66E7FB00A9F999 /* UserAccount.swift */; };
C9CA60221C670DD000A9F999 /* String+FilePath.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9CA60211C670DD000A9F999 /* String+FilePath.swift */; };
C9CA824B1C7B573D0013BA64 /* Emoticons.bundle in Resources */ = {isa = PBXBuildFile; fileRef = C9CA824A1C7B573D0013BA64 /* Emoticons.bundle */; };
C9D833731C7C4B0A0026471B /* EmoticonInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D833721C7C4B0A0026471B /* EmoticonInfo.swift */; };
C9D833751C7C4B7C0026471B /* EmoticonGroupInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D833741C7C4B7C0026471B /* EmoticonGroupInfo.swift */; };
C9D833791C7C85E80026471B /* String+Emoticons.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D833781C7C85E80026471B /* String+Emoticons.swift */; };
C9E11DB11C73021100F6DA41 /* MagicMoveTransion.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E11DAF1C73021100F6DA41 /* MagicMoveTransion.swift */; };
C9E11DB41C73082100F6DA41 /* MagicMoveSegue.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E11DB31C73082100F6DA41 /* MagicMoveSegue.swift */; };
C9E11DB61C731AF300F6DA41 /* MagicMovePopTransion.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E11DB51C731AF300F6DA41 /* MagicMovePopTransion.swift */; };
Expand All @@ -60,6 +64,7 @@
C9E3B6EE1C6B2B4400D1E98A /* Status.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E3B6ED1C6B2B4400D1E98A /* Status.swift */; };
C9E3B6F01C6B38D000D1E98A /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E3B6EF1C6B38D000D1E98A /* User.swift */; };
C9E3B6F31C6B49E600D1E98A /* TimeLineCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E3B6F21C6B49E600D1E98A /* TimeLineCell.swift */; };
C9E76ECF1C7BE36100CA9CD9 /* EmoticonsKBViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E76ECE1C7BE36100CA9CD9 /* EmoticonsKBViewController.swift */; };
C9F9C75B1C64D311001E43D1 /* QRCodeCardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9F9C75A1C64D311001E43D1 /* QRCodeCardViewController.swift */; };
C9F9C75E1C66169B001E43D1 /* OAuthViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9F9C75D1C66169B001E43D1 /* OAuthViewController.swift */; };
C9F9C7601C6616BF001E43D1 /* WBKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9F9C75F1C6616BF001E43D1 /* WBKeys.swift */; };
Expand Down Expand Up @@ -139,6 +144,10 @@
C9C925F61C7960F80011AECF /* NewTextPostViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NewTextPostViewController.swift; sourceTree = "<group>"; };
C9CA601F1C66E7FB00A9F999 /* UserAccount.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAccount.swift; sourceTree = "<group>"; };
C9CA60211C670DD000A9F999 /* String+FilePath.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+FilePath.swift"; sourceTree = "<group>"; };
C9CA824A1C7B573D0013BA64 /* Emoticons.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Emoticons.bundle; path = ../../../Emoticons.bundle; sourceTree = "<group>"; };
C9D833721C7C4B0A0026471B /* EmoticonInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmoticonInfo.swift; sourceTree = "<group>"; };
C9D833741C7C4B7C0026471B /* EmoticonGroupInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmoticonGroupInfo.swift; sourceTree = "<group>"; };
C9D833781C7C85E80026471B /* String+Emoticons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Emoticons.swift"; sourceTree = "<group>"; };
C9E11DAF1C73021100F6DA41 /* MagicMoveTransion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MagicMoveTransion.swift; sourceTree = "<group>"; };
C9E11DB31C73082100F6DA41 /* MagicMoveSegue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MagicMoveSegue.swift; sourceTree = "<group>"; };
C9E11DB51C731AF300F6DA41 /* MagicMovePopTransion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MagicMovePopTransion.swift; sourceTree = "<group>"; };
Expand All @@ -147,6 +156,7 @@
C9E3B6ED1C6B2B4400D1E98A /* Status.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Status.swift; sourceTree = "<group>"; };
C9E3B6EF1C6B38D000D1E98A /* User.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = "<group>"; };
C9E3B6F21C6B49E600D1E98A /* TimeLineCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TimeLineCell.swift; sourceTree = "<group>"; };
C9E76ECE1C7BE36100CA9CD9 /* EmoticonsKBViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmoticonsKBViewController.swift; sourceTree = "<group>"; };
C9F9C75A1C64D311001E43D1 /* QRCodeCardViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QRCodeCardViewController.swift; sourceTree = "<group>"; };
C9F9C75D1C66169B001E43D1 /* OAuthViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OAuthViewController.swift; sourceTree = "<group>"; };
C9F9C75F1C6616BF001E43D1 /* WBKeys.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WBKeys.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -218,6 +228,7 @@
C93CB9281C75E94200CF7EDC /* NewPost */ = {
isa = PBXGroup;
children = (
C9E76ECD1C7BE33B00CA9CD9 /* EmoticonsKB */,
C9C925F41C795F8C0011AECF /* NewTextPost.storyboard */,
C93CB9291C75E95600CF7EDC /* NewPostTabView.xib */,
C93CB92B1C75EF8100CF7EDC /* NewPostTabView.swift */,
Expand Down Expand Up @@ -399,6 +410,15 @@
path = Utils;
sourceTree = "<group>";
};
C9D833711C7C4AE70026471B /* EmoticonModel */ = {
isa = PBXGroup;
children = (
C9D833721C7C4B0A0026471B /* EmoticonInfo.swift */,
C9D833741C7C4B7C0026471B /* EmoticonGroupInfo.swift */,
);
path = EmoticonModel;
sourceTree = "<group>";
};
C9E3B6EC1C6B2AFD00D1E98A /* Models */ = {
isa = PBXGroup;
children = (
Expand All @@ -417,6 +437,17 @@
path = Cells;
sourceTree = "<group>";
};
C9E76ECD1C7BE33B00CA9CD9 /* EmoticonsKB */ = {
isa = PBXGroup;
children = (
C9D833711C7C4AE70026471B /* EmoticonModel */,
C9CA824A1C7B573D0013BA64 /* Emoticons.bundle */,
C9E76ECE1C7BE36100CA9CD9 /* EmoticonsKBViewController.swift */,
C9D833781C7C85E80026471B /* String+Emoticons.swift */,
);
path = EmoticonsKB;
sourceTree = "<group>";
};
C9F9C75C1C661674001E43D1 /* OAuth */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -564,6 +595,7 @@
C9C925F51C795F8C0011AECF /* NewTextPost.storyboard in Resources */,
C9B3E1741C60D1510006D44B /* Main.storyboard in Resources */,
C9B3E1B41C618CDB0006D44B /* Message.storyboard in Resources */,
C9CA824B1C7B573D0013BA64 /* Emoticons.bundle in Resources */,
C9B3E1AF1C618C970006D44B /* Home.storyboard in Resources */,
C9E3B6EB1C6A2E4F00D1E98A /* Discover.storyboard in Resources */,
C93CB92A1C75E95600CF7EDC /* NewPostTabView.xib in Resources */,
Expand Down Expand Up @@ -725,6 +757,7 @@
C9099C0A1C6363B100E7A630 /* PopoverViewController.swift in Sources */,
C9888F101C678A440043C276 /* DelayUtil.swift in Sources */,
C98F4F011C69A8FC0024A931 /* ApplicationInfo.swift in Sources */,
C9D833751C7C4B7C0026471B /* EmoticonGroupInfo.swift in Sources */,
C9CA60201C66E7FB00A9F999 /* UserAccount.swift in Sources */,
C9E3B6EE1C6B2B4400D1E98A /* Status.swift in Sources */,
C998F6BC1C6EE14F00B900F7 /* RetweetTimeLineCell.swift in Sources */,
Expand All @@ -735,9 +768,12 @@
C9099C0E1C6365C600E7A630 /* PopoverPresentationController.swift in Sources */,
C998F6BE1C6F174D00B900F7 /* HomeRefreshControl.swift in Sources */,
C9F9C75B1C64D311001E43D1 /* QRCodeCardViewController.swift in Sources */,
C9D833731C7C4B0A0026471B /* EmoticonInfo.swift in Sources */,
C948B9FD1C663A9B004FD9F6 /* WBRouter.swift in Sources */,
C9D833791C7C85E80026471B /* String+Emoticons.swift in Sources */,
C9099BFE1C61C5EE00E7A630 /* BaseTableViewController.swift in Sources */,
C9099C051C62DF4C00E7A630 /* TitleButton.swift in Sources */,
C9E76ECF1C7BE36100CA9CD9 /* EmoticonsKBViewController.swift in Sources */,
C98AB0D71C64408B0021387E /* Notifications.swift in Sources */,
C93CB92C1C75EF8100CF7EDC /* NewPostTabView.swift in Sources */,
C98DA5AF1C6E152800A60886 /* UIButton+Extension.swift in Sources */,
Expand Down
6 changes: 6 additions & 0 deletions CCWeibo/CCWeibo/Assets.xcassets/Emoticon/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"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.
2 changes: 1 addition & 1 deletion CCWeibo/CCWeibo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10109" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="WSQ-9H-O2R">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10112" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="WSQ-9H-O2R">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10083"/>
</dependencies>
Expand Down
27 changes: 15 additions & 12 deletions CCWeibo/CCWeibo/Classes/Home/Cells/TimeLineCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,11 @@ class TimeLineCell: UITableViewCell {
@IBOutlet weak var picListHeightCons: NSLayoutConstraint!
@IBOutlet weak var picListBottomCons: NSLayoutConstraint!

private var retrieveImageTasks: [RetrieveImageTask] = []

func cancelRetrieveTasks() {
for task in retrieveImageTasks {
task.cancel()
// KingfisherManager.sharedManager.cache.clearMemoryCache()
for cell in picturesCollectionView.visibleCells() as! [PictureCollectionViewCell] {
cell.imageURL = nil
}
retrieveImageTasks.removeAll()
KingfisherManager.sharedManager.cache.clearDiskCache()
}

// 图片列表中图片之间的间隙
Expand Down Expand Up @@ -168,8 +165,7 @@ extension TimeLineCell: UICollectionViewDelegate, UICollectionViewDataSource {
} else {
cell.gifLabel.hidden = true
}
let task = cell.setImage(imageURL)
retrieveImageTasks.append(task)
cell.imageURL = imageURL
return cell
}
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
Expand All @@ -194,6 +190,17 @@ extension TimeLineCell: UICollectionViewDelegate, UICollectionViewDataSource {

// MARK: - 图片集合单元格
class PictureCollectionViewCell: UICollectionViewCell {
var imageURL: NSURL? {
didSet {
guard imageURL != nil else {
imageView.kf_cancelDownloadTask()
KingfisherManager.sharedManager.cache.removeImageForKey(oldValue!.absoluteString)
return
}
imageView.kf_showIndicatorWhenLoading = true
imageView.kf_setImageWithURL(imageURL!)
}
}
private var gifLabel: UILabel = {
let label = UILabel()
label.backgroundColor = UIColor.orangeColor()
Expand All @@ -212,10 +219,6 @@ class PictureCollectionViewCell: UICollectionViewCell {
}
}

func setImage(imageURL: NSURL) -> RetrieveImageTask {
imageView.kf_showIndicatorWhenLoading = true
return imageView.kf_setImageWithURL(imageURL)
}
}


14 changes: 8 additions & 6 deletions CCWeibo/CCWeibo/Classes/Home/HomeTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class HomeTableViewController: BaseTableViewController {
var selectedImageCollection: UICollectionView?

@IBAction func leftBarItemClick(sender: UIButton) {
print(__FUNCTION__)
print(#function)
}
@IBOutlet weak var activityIndicatorView: UIActivityIndicatorView!
// 行高缓存,如用手动行高需要开启下一行代码
Expand Down Expand Up @@ -47,14 +47,14 @@ class HomeTableViewController: BaseTableViewController {
// 自动行高,如用手动行高,注释掉下一行代码
tableView.rowHeight = UITableViewAutomaticDimension
refreshControl = HomeRefreshControl(frame: CGRect(x: 0, y: 0, width: view.bounds.width, height: 60))
refreshControl?.addTarget(self, action: "refreshTimeLine", forControlEvents: .ValueChanged)
refreshControl?.addTarget(self, action: #selector(HomeTableViewController.refreshTimeLine), forControlEvents: .ValueChanged)

self.navigationController?.navigationBar.insertSubview(self.newStatuesCountLabel, atIndex: 0)
self.newStatuesCountLabel.frame = CGRect(x: 0, y: 0, width: self.view.bounds.width, height: 30)

NSNotificationCenter.defaultCenter().addObserver(self, selector: "changeTitleArrow", name: HomeNotifications.TitleViewWillHide, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "changeTitleArrow", name: HomeNotifications.TitleViewWillShow, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "didClickImage:", name: HomeNotifications.DidSelectCollectionImage, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(HomeTableViewController.changeTitleArrow), name: HomeNotifications.TitleViewWillHide, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(HomeTableViewController.changeTitleArrow), name: HomeNotifications.TitleViewWillShow, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(HomeTableViewController.didClickImage(_:)), name: HomeNotifications.DidSelectCollectionImage, object: nil)
refreshControl?.beginRefreshing()
refreshTimeLine()
}
Expand All @@ -63,6 +63,7 @@ class HomeTableViewController: BaseTableViewController {
func refreshTimeLine() {
let sinceId = statuses.first?.id
Status.loadStatuses(sinceId, maxId: nil) {
[unowned self]
statuses in
self.refreshControl?.endRefreshing()
if statuses.count > 0 {
Expand All @@ -79,6 +80,7 @@ class HomeTableViewController: BaseTableViewController {
let maxId = statuses.last!.id - 1
activityIndicatorView.startAnimating()
Status.loadStatuses(nil, maxId: maxId) {
[unowned self]
statuses in
if statuses.count > 0 {
self.statuses.insertContentsOf(statuses, at: self.statuses.count)
Expand Down Expand Up @@ -125,7 +127,7 @@ class HomeTableViewController: BaseTableViewController {
titleBtn.setTitle("\(UserInfo.loadUserInfo()!.screenName) ", forState: .Normal)
titleBtn.setImage(UIImage(named: "navigationbar_arrow_down"), forState: .Normal)
titleBtn.setImage(UIImage(named: "navigationbar_arrow_up"), forState: .Selected)
titleBtn.addTarget(self, action: "titleBtnClick:", forControlEvents: .TouchUpInside)
titleBtn.addTarget(self, action: #selector(HomeTableViewController.titleBtnClick(_:)), forControlEvents: .TouchUpInside)
titleBtn.setTitleColor(UIColor.darkGrayColor(), forState: .Normal)
navigationItem.titleView = titleBtn
titleBtn.sizeToFit()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ImageBrowserCell: UICollectionViewCell {
imageScrollView.delegate = self
imageScrollView.maximumZoomScale = 2
imageScrollView.minimumZoomScale = 1
let tap = UITapGestureRecognizer(target: self, action: "close")
let tap = UITapGestureRecognizer(target: self, action: #selector(ImageBrowserCell.close))
imageScrollView.addGestureRecognizer(tap)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ImageBrowserViewController: UIViewController {
}
@IBAction func save(sender: UIButton) {
let cell = imageCollectionView.visibleCells().last as! ImageBrowserCell
UIImageWriteToSavedPhotosAlbum(cell.imageView.image!, self, "image:didFinishSavingWithError:contextInfo:", nil)
UIImageWriteToSavedPhotosAlbum(cell.imageView.image!, self, #selector(ImageBrowserViewController.image(_:didFinishSavingWithError:contextInfo:)), nil)
}
func image(image:UIImage, didFinishSavingWithError error:NSError?, contextInfo: AnyObject) {
guard error == nil else {
Expand Down Expand Up @@ -66,7 +66,7 @@ class ImageBrowserViewController: UIViewController {
super.viewDidLoad()
let layout = imageCollectionView.collectionViewLayout as! UICollectionViewFlowLayout
layout.itemSize = view.bounds.size
NSNotificationCenter.defaultCenter().addObserver(self, selector: "close", name: ImageBrowserNotifications.TapToClose, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ImageBrowserViewController.close), name: ImageBrowserNotifications.TapToClose, object: nil)
}
deinit {
// 清理内存里的gif缓存
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class MagicMovePopTransion: NSObject, UIViewControllerAnimatedTransitioning {
toVC.selectedImageCell = toCell
toVC.selectedImageCell!.imageView.hidden = true
// 利用新建imageview来进行遮罩
let snapshotView = UIImageView(image: toVC.selectedImageCell?.imageView.image)
let snapshotImage = toVC.selectedImageCell!.imageView.image
let snapshotView = UIImageView(image: snapshotImage)
snapshotView.contentMode = .ScaleAspectFill
snapshotView.clipsToBounds = true
snapshotView.frame = container!.convertRect(fromImageView.frame, fromView: fromImageView.superview!)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import Kingfisher

class MagicMoveTransion: NSObject, UIViewControllerAnimatedTransitioning {
func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval {
Expand All @@ -19,7 +20,9 @@ class MagicMoveTransion: NSObject, UIViewControllerAnimatedTransitioning {
let toVC = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey) as! ImageBrowserViewController
let container = transitionContext.containerView()

let snapshotView = UIImageView(image: fromVC.selectedImageCell?.imageView.image)
let snapshotImage = fromVC.selectedImageCell!.imageView.image
// let snapshotImage = KingfisherManager.sharedManager.cache.retrieveImageInMemoryCacheForKey(fromVC.selectedImageCell!.)
let snapshotView = UIImageView(image: snapshotImage)
snapshotView.contentMode = .ScaleAspectFill
snapshotView.clipsToBounds = true
snapshotView.frame = container!.convertRect(fromVC.selectedImageCell!.imageView.frame, fromView: fromVC.selectedImageCell!)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PopoverPresentationController: UIPresentationController {
view.frame = UIScreen.mainScreen().bounds

// 2.添加监听
let tap = UITapGestureRecognizer(target: self, action: "close")
let tap = UITapGestureRecognizer(target: self, action: #selector(PopoverPresentationController.close))
view.addGestureRecognizer(tap)
return view
}()
Expand Down
Loading

0 comments on commit 8960362

Please sign in to comment.