SiriKit框架详细解析(九) —— 构建Siri Shortcuts简单示例(三)

版本记录

版本号 时间
V1.0 2018.12.06 星期四

前言

大家都知道随着人工智能的发展,会掀起来另外一个工业革命,而语音识别就是人工智能的初始阶段,但是每个公司做的都不一样,涉及到一系列的语音的采集和算法实现,苹果的Siri就是业界语音识别的代表性的产品。接下来的几篇我们就详细解析一下SiriKit这个框架。感兴趣的可以看下面几篇文章。
1. SiriKit框架详细解析(一)—— 基本概览(一)
2. SiriKit框架详细解析(二)—— 请求授权使用SiriKit和INPreferences类(一)
3. SiriKit框架详细解析(三)—— 创建Intents App扩展(一)
4. SiriKit框架详细解析(四)—— 构建代码以支持App扩展和将意图调度到处理对象(一)
5. SiriKit框架详细解析(五) —— 编程指南之Intents和Intents UI扩展(一)
6. SiriKit框架详细解析(六) —— 编程指南之确认和处理请求、指定自定义词汇表和界面(一)
7. SiriKit框架详细解析(七) —— 构建Siri Shortcuts简单示例(一)
8. SiriKit框架详细解析(八) —— 构建Siri Shortcuts简单示例(二)

源码

1. Swift

首先看一下代码结构

下面看一下源码

1. AppDelegate.swift
import UIKit
import IntentsUI
import ArticleKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
  var window: UIWindow?
  var nav: UINavigationController?
  
  let rootVC = ArticleFeedViewController()
  
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    window = UIWindow(frame: UIScreen.main.bounds)
    nav = UINavigationController(rootViewController: rootVC)
    window?.rootViewController = nav
    window?.makeKeyAndVisible()
    
    ArticleManager.loadArticles()
    return true
  }
  
  func applicationWillResignActive(_ application: UIApplication) {
    ArticleManager.writeArticlesToDisk()
  }
  
  func applicationWillEnterForeground(_ application: UIApplication) {
    ArticleManager.loadArticles()
    rootVC.viewWillAppear(false)
  }
  
  func application(_ application: UIApplication, willContinueUserActivityWithType userActivityType: String) -> Bool {
    if userActivityType == "com.razeware.NewArticle" {
      return true
    }
    
    return false
  }
  
  func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
    guard userActivity.interaction == nil else  {
      ArticleManager.loadArticles()
      rootVC.viewWillAppear(false)
      return false
    }
    
    let vc = NewArticleViewController()
    nav?.pushViewController(vc, animated: false)
    return true
  }
}
2. ArticleFeedViewController.swift
import UIKit
import ArticleKit
import Intents
import CoreSpotlight
import MobileCoreServices

class ArticleFeedViewController: UIViewController {
  let tableView = UITableView(frame: .zero, style: .plain)
  let cellReuseIdentifier = "kArticleCellReuse"
  
  var articles: [Article] = []
  
  @objc func newArticleWasTapped() {
    let vc = NewArticleViewController()
    
    // Create and donate an activity-based Shortcut
    let activity = Article.newArticleShortcut(with: UIImage(named: "notePad.jpg"))
    vc.userActivity = activity
    activity.becomeCurrent()
    
    navigationController?.pushViewController(vc, animated: true)
  }
  
  // MARK: - Initialization
  
  override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
    super.init(nibName: nil, bundle: nil)
    
    tableView.delegate = self
    tableView.dataSource = self
    tableView.register(ArticleTableViewCell.classForCoder(), forCellReuseIdentifier: cellReuseIdentifier)
  }
  
  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }
}

extension ArticleFeedViewController: UITableViewDelegate {
  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    let vc = EditDraftViewController(article: articles[indexPath.row])
    navigationController?.pushViewController(vc, animated: true)
  }
  
  func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
    return true
  }
  
  func remove(article: Article, at indexPath: IndexPath) {
    ArticleManager.remove(article: article)
    articles = ArticleManager.allArticles()
    tableView.deleteRows(at: [indexPath], with: UITableView.RowAnimation.automatic)
    
    INInteraction.delete(with: article.title) { _ in
    }
  }
}
3. NewArticleViewController.swift
import UIKit
import IntentsUI
import ArticleKit

class NewArticleViewController: UIViewController {
  let titleTextField = UITextField()
  let contentsTextView = UITextView()
  let addShortcutButton = UIButton()
  
  @objc func saveWasTapped() {
    if let title = titleTextField.text, let content = contentsTextView.text {
      let article = Article(title: title, content: content, published: false)
      ArticleManager.add(article: article)
      
      // Donate publish intent
      article.donatePublishIntent()
      navigationController?.popViewController(animated: true)
    }
  }
  
  @objc func addNewArticleShortcutWasTapped() {
    // Open View Controller to Create New Shortcut
    let newArticleActivity = Article.newArticleShortcut(with: UIImage(named: "notePad.jpg"))
    let shortcut = INShortcut(userActivity: newArticleActivity)
    
    let vc = INUIAddVoiceShortcutViewController(shortcut: shortcut)
    vc.delegate = self
    
    present(vc, animated: true, completion: nil)
  }
}

extension NewArticleViewController: INUIAddVoiceShortcutViewControllerDelegate {
  func addVoiceShortcutViewController(_ controller: INUIAddVoiceShortcutViewController,
                                      didFinishWith voiceShortcut: INVoiceShortcut?,
                                      error: Error?) {
    dismiss(animated: true, completion: nil)
  }
  
  func addVoiceShortcutViewControllerDidCancel(_ controller: INUIAddVoiceShortcutViewController) {
    dismiss(animated: true, completion: nil)
  }
}
4. EditDraftViewController.swift
import UIKit
import ArticleKit

class EditDraftViewController: UIViewController {
  let titleTextField = UITextField()
  let contentsTextView = UITextView()
  
  var article: Article
  
  init(article: Article) {
    self.article = article
    super.init(nibName: nil, bundle: nil)
  }
  
  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }
  
  @objc func saveWasTapped() {
    if let title = titleTextField.text, let content = contentsTextView.text {
      article = ArticleManager.update(article: article, title: title, content: content)
      
      navigationController?.popViewController(animated: true)
    }
  }
  
  @objc func publishWasTapped() {
    if let title = titleTextField.text, let content = contentsTextView.text {
      article = ArticleManager.update(article: article, title: title, content: content)
      ArticleManager.publish(article)
      navigationController?.popViewController(animated: true)
    } else {
      // Show alert
      
    }
  }
}
5. ArticleTableViewCell.swift
import UIKit
import ArticleKit

class ArticleTableViewCell: UITableViewCell {
  let titleLabel = UILabel()
  var publishStatusLabel = UILabel()
  
  var article: Article {
    didSet {
      initializeTitleLabel()
      article.published ? showArticleWasPublished() : showArticleIsDraft()
      setNeedsLayout()
    }
  }
  
  override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
    article = Article(title: "placeholder", content: "placeholder", published: false)
    publishStatusLabel = ArticleTableViewCell.statusLabel(title: "")
    
    super.init(style: style, reuseIdentifier: reuseIdentifier)
    
    addSubview(titleLabel)
    addSubview(publishStatusLabel)
  }
  
  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }
  
  override func layoutSubviews() {
    super.layoutSubviews()
    
    titleLabel.sizeToFit()
    titleLabel.bounds = CGRect(x: 0, y: 0, width: min(titleLabel.bounds.width, 150.0), height: titleLabel.bounds.height)
    titleLabel.center = CGPoint(x: titleLabel.bounds.width/2.0 + 16, y: bounds.height/2.0)
    
    publishStatusLabel.sizeToFit()
    publishStatusLabel.bounds = CGRect(x: 0, y: 0, width: publishStatusLabel.bounds.width + 30, height: publishStatusLabel.bounds.height + 8)
    publishStatusLabel.center = CGPoint(x: bounds.width - publishStatusLabel.bounds.width/2.0 - 16.0, y: bounds.height/2.0)
  }
  
  private func initializeTitleLabel() {
    titleLabel.text = article.title
    titleLabel.font = UIFont.systemFont(ofSize: 24.0)
  }
  
  class func statusLabel(title: String) -> UILabel {
    let label = UILabel()
    
    label.text = title
    label.layer.cornerRadius = 4.0
    label.layer.borderWidth = 1.0
    label.textAlignment = .center;
    return label
  }
  
  func showArticleWasPublished() {
    publishStatusLabel.text = "PUBLISHED"
    
    let green = UIColor(red: 0.0/255.0, green: 104.0/255.0, blue: 55.0/255.0, alpha: 1.0)
    
    publishStatusLabel.textColor = green
    publishStatusLabel.layer.borderColor = green.cgColor
  }
  
  func showArticleIsDraft() {
    publishStatusLabel.text = "DRAFT"
    
    let yellow = UIColor(red: 254.0/255.0, green: 223.0/255.0, blue: 0.0, alpha: 1.0)
    
    publishStatusLabel.textColor = yellow
    publishStatusLabel.layer.borderColor = yellow.cgColor
  }
  
  override func setSelected(_ selected: Bool, animated: Bool) {
    super.setSelected(selected, animated: animated)
  }
}
6. Layouts.swift
import UIKit
import ArticleKit
import Intents

extension ArticleFeedViewController {
  override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    
    articles = ArticleManager.allArticles()
    
    tableView.reloadData()
  }
  
  override func viewDidLoad() {
    super.viewDidLoad()
    
    view.backgroundColor = .white
    navigationItem.title = "Articles"
    navigationItem.rightBarButtonItem = UIBarButtonItem(title: "New Article",
                                                        style: .plain,
                                                        target: self,
                                                        action: #selector(ArticleFeedViewController.newArticleWasTapped))
    tableView.allowsMultipleSelectionDuringEditing = false
    view.addSubview(tableView)
  }
  
  override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    
    tableView.frame = view.bounds
  }
}

extension ArticleFeedViewController: UITableViewDataSource {
  func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return articles.count
  }
  
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: cellReuseIdentifier, for: indexPath) as! ArticleTableViewCell
    cell.article = articles[indexPath.row]
    return cell
  }
  
  func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
    return 100.0
  }

  func tableView(_ tableView: UITableView,
                 commit editingStyle: UITableViewCell.EditingStyle,
                 forRowAt indexPath: IndexPath) {
    if editingStyle == .delete {
      let article = articles[indexPath.row]
      remove(article: article, at: indexPath)
      if articles.count == 0 {
        NSUserActivity.deleteSavedUserActivities(withPersistentIdentifiers: [NSUserActivityPersistentIdentifier(kNewArticleActivityType)]) {
          print("Successfully deleted 'New Article' activity.")
        }
      }
    }
  }
}


extension NewArticleViewController {
  override func viewDidLoad() {
    super.viewDidLoad()
    
    view.backgroundColor = .white
    
    // Shortcuts Button
    addShortcutButton.setTitle("Add Shortcut to Siri", for: .normal)
    addShortcutButton.addTarget(self, action: #selector(NewArticleViewController.addNewArticleShortcutWasTapped), for: .touchUpInside)
    addShortcutButton.setTitleColor(.blue, for: .normal)
    
    // Navbar
    navigationItem.title = "New Article"
    navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Save Draft",
                                                        style: .plain,
                                                        target: self,
                                                        action: #selector(NewArticleViewController.saveWasTapped))
    
    // Text Fields
    titleTextField.placeholder = "Title"
    titleTextField.delegate = self
    
    contentsTextView.layer.cornerRadius = 4.0
    contentsTextView.layer.borderColor = UIColor.black.cgColor
    contentsTextView.layer.borderWidth = 1.0
    contentsTextView.delegate = self
    
    view.addSubview(addShortcutButton)
    view.addSubview(titleTextField)
    view.addSubview(contentsTextView)
  }
  
  override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    
    let navbarHeight: CGFloat = 44.0
    var topPadding: CGFloat = 20.0
    var bottomPadding: CGFloat = 20.0
    let paddingBetween: CGFloat = 20.0
    
    if let topInset = UIApplication.shared.keyWindow?.safeAreaInsets.top {
      topPadding += topInset
    }
    if let bottomInset = UIApplication.shared.keyWindow?.safeAreaInsets.bottom {
      bottomPadding += bottomInset
    }
    
    addShortcutButton.bounds = CGRect(x: 0, y: 0, width: view.bounds.width, height: 44.0)
    addShortcutButton.center = CGPoint(x: view.bounds.width/2.0, y: titleTextField.bounds.height/2.0 + topPadding + navbarHeight)
    
    titleTextField.bounds = CGRect(x: 0, y: 0, width: view.bounds.width - 32.0, height: 44.0)
    titleTextField.center = CGPoint(x: titleTextField.bounds.width/2.0 + 16.0, y: titleTextField.bounds.height/2.0 + addShortcutButton.center.y + addShortcutButton.bounds.height/2.0)
    
    let contentsTextViewYOrigin = titleTextField.bounds.height + titleTextField.frame.origin.y + 20.0
    let height = view.bounds.height - (titleTextField.center.y + titleTextField.bounds.height/2.0) - paddingBetween - bottomPadding
    contentsTextView.frame = CGRect(x: 16.0, y: contentsTextViewYOrigin, width: view.bounds.width - 32.0, height: height)
  }
  
  override func updateUserActivityState(_ activity: NSUserActivity) {
    guard let title = titleTextField.text, let content = contentsTextView.text else { return }
    
    activity.addUserInfoEntries(from: ["title": title, "content": content])
    
    super.updateUserActivityState(activity)
  }
}

// Since your user activity supports hand-off, updating its user info dictionary means you can easily continue writing your article on another device if you'd like to. Make sure to call needs save so updateUserActivityState(activity:) can be called periodically instead of at each change.

extension NewArticleViewController: UITextFieldDelegate {
  func textFieldDidEndEditing(_ textField: UITextField) {
    userActivity?.needsSave = true
  }
  
  func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
    userActivity?.needsSave = true
    
    return true
  }
}

extension NewArticleViewController: UITextViewDelegate {
  func textViewDidChange(_ textView: UITextView) {
    userActivity?.needsSave = true
  }
}

extension EditDraftViewController {
  override func viewDidLoad() {
    super.viewDidLoad()
    
    view.backgroundColor = .white
    
    // Navbar
    navigationItem.title = "Edit Draft"
    navigationItem.rightBarButtonItems = [UIBarButtonItem(title: "Publish",
                                                          style: .plain,
                                                          target: self,
                                                          action: #selector(EditDraftViewController.publishWasTapped)),
                                          UIBarButtonItem(title: "Save",
                                                          style: .plain,
                                                          target: self,
                                                          action: #selector(EditDraftViewController.saveWasTapped))]
    
    // Text Fields
    titleTextField.placeholder = "Title"
    titleTextField.text = article.title
    
    contentsTextView.layer.cornerRadius = 4.0
    contentsTextView.layer.borderColor = UIColor.black.cgColor
    contentsTextView.layer.borderWidth = 1.0
    contentsTextView.text = article.content
    
    view.addSubview(titleTextField)
    view.addSubview(contentsTextView)
  }
  
  override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    
    let navbarHeight: CGFloat = 44.0
    var topPadding: CGFloat = 20.0
    var bottomPadding: CGFloat = 20.0
    
    if let topInset = UIApplication.shared.keyWindow?.safeAreaInsets.top {
      topPadding += topInset
    }
    if let bottomInset = UIApplication.shared.keyWindow?.safeAreaInsets.bottom {
      bottomPadding += bottomInset
    }
    
    titleTextField.bounds = CGRect(x: 0, y: 0, width: view.bounds.width - 32.0, height: 44.0)
    titleTextField.center = CGPoint(x: titleTextField.bounds.width/2.0 + 16.0, y: titleTextField.bounds.height/2.0 + topPadding + navbarHeight)
    
    let contentsTextViewYOrigin = titleTextField.bounds.height + titleTextField.frame.origin.y + 20.0
    let height = view.bounds.height - navbarHeight - titleTextField.bounds.height - 20 - 20 - bottomPadding
    contentsTextView.frame = CGRect(x: 16.0, y: contentsTextViewYOrigin, width: view.bounds.width - 32.0, height: height)
  }
}
7. IntentHandler.swift
import Intents

class IntentHandler: INExtension {
  override func handler(for intent: INIntent) -> Any {
    return PostArticleIntentHandler()
  }
}
8. PostArticleIntentHandler.swift
import UIKit
import ArticleKit

class PostArticleIntentHandler: NSObject, PostArticleIntentHandling {
  func confirm(intent: PostArticleIntent, completion: @escaping (PostArticleIntentResponse) -> Void) {
    completion(PostArticleIntentResponse(code: PostArticleIntentResponseCode.ready,
                                         userActivity: nil))
  }
  
  func handle(intent: PostArticleIntent, completion: @escaping (PostArticleIntentResponse) -> Void) {
    guard
      let title = intent.article?.identifier,
      let article = ArticleManager.findArticle(with: title)
      else {
        completion(PostArticleIntentResponse.failure(failureReason: "Your article was not found."))
        return
    }
    guard !article.published else {
      completion(PostArticleIntentResponse.failure(failureReason: "This article has already been published."))
      return
    }
    
    ArticleManager.publish(article)
    completion(PostArticleIntentResponse.success(title: article.title, publishDate: article.formattedDate()))
  }
}
9. ArticleKit.h
#import <UIKit/UIKit.h>

//! Project version number for ArticleKit.
FOUNDATION_EXPORT double ArticleKitVersionNumber;

//! Project version string for ArticleKit.
FOUNDATION_EXPORT const unsigned char ArticleKitVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <ArticleKit/PublicHeader.h>
10. Article.swift
import UIKit
import Intents
import CoreSpotlight
import MobileCoreServices

public let kNewArticleActivityType = "com.razeware.NewArticle"

public class Article {
  public let title: String
  public let content: String
  public let published: Bool
  
  public static func newArticleShortcut(with thumbnail: UIImage?) -> NSUserActivity {
    let activity = NSUserActivity(activityType: kNewArticleActivityType)
    activity.persistentIdentifier = NSUserActivityPersistentIdentifier(kNewArticleActivityType)
    
    activity.isEligibleForSearch = true
    activity.isEligibleForPrediction = true
    
    let attributes = CSSearchableItemAttributeSet(itemContentType: kUTTypeItem as String)
    
    // Title
    activity.title = "Write a new article"
    
    // Subtitle
    attributes.contentDescription = "Get those creative juices flowing!"
    
    // Thumbnail
    attributes.thumbnailData = thumbnail?.jpegData(compressionQuality: 1.0)
    
    // Suggested Phrase
    activity.suggestedInvocationPhrase = "Time to write!"
    
    activity.contentAttributeSet = attributes
    return activity
  }
  
  // Create an intent for publishing articles
  public func donatePublishIntent() {
    let intent = PostArticleIntent()
    intent.article = INObject(identifier: self.title, display: self.title)
    intent.publishDate = formattedDate()
    
    let interaction = INInteraction(intent: intent, response: nil)
    
    interaction.donate { error in
      if let error = error {
        print("Donating intent failed with error \(error)")
      }
    }
  }
  
  // MARK: - Init
  public init(title: String, content: String, published: Bool) {
    self.title = title
    self.content = content
    self.published = published
  }
  
  // MARK: - Helpers
  public func toData() -> Data? {
    let dict = ["title": title, "content": content, "published": published] as [String: Any]
    let data = try? NSKeyedArchiver.archivedData(withRootObject: dict, requiringSecureCoding: false)
    return data
  }
  
  public func formattedDate() -> String {
    let date = Date()
    let formatter = DateFormatter()
    
    formatter.dateFormat = "MM/dd/yyyy"
    let result = formatter.string(from: date)
    
    return result
  }
}
11. ArticleManager.swift
import UIKit

public class ArticleManager: NSObject {
  private static var articles: [Article] = []
  private static let groupIdentifier = "group.com.razeware.Writing"
  
  private static var articlesDir: String  {
    let groupURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: groupIdentifier)
    if groupURL == nil {
      let documentsDir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
      return documentsDir.path + "/Articles"
    } else {
      return groupURL!.path + "/Articles"
    }
  }

  public static func update(article: Article, title: String, content: String) -> Article {
    let newArticle = Article(title: title, content: content, published: false)
    remove(article: article)
    add(article: newArticle)
    return newArticle
  }
  
  public static func findArticle(with title: String) -> Article? {
    loadArticles()
    return articles.first { $0.title == title }
  }
  
  public static func allArticles() -> [Article] {
    return articles
  }
  
  public static func publish(_ article: Article) {
    let publishedArticle = Article(title: article.title, content: article.content, published: true)
    
    ArticleManager.remove(article: article)
    ArticleManager.add(article: publishedArticle)
    ArticleManager.writeArticlesToDisk()
  }
  
  public static func writeArticlesToDisk() {
    do {
      if !FileManager.default.fileExists(atPath: articlesDir) {
        try FileManager.default.createDirectory(atPath: articlesDir, withIntermediateDirectories: false, attributes: nil)
      }
      
      // Delete all old articles
      let articlePaths = try FileManager.default.contentsOfDirectory(atPath: articlesDir)
      for articlePath in articlePaths  {
        let fullPath = articlesDir + "/\(articlePath)"
        try FileManager.default.removeItem(atPath: fullPath)
        print("Deleted \(articlePath)")
      }
    } catch let e {
      print(e)
    }
    
    for (i, article) in articles.enumerated() {
      let path = articlesDir + "/\(i + 1).article"
      let url = URL(fileURLWithPath: path)
      if let data = article.toData() {
        try? data.write(to: url)
        print("Wrote article \(article.title) published? \(article.published) to \(articlesDir)")
      }
    }
  }
  
  public static func loadArticles() {
    var savedArticles: [Article] = []
    
    do {
      if !FileManager.default.fileExists(atPath: articlesDir) {
        try FileManager.default.createDirectory(atPath: articlesDir, withIntermediateDirectories: false, attributes: nil)
      }
      
      let articlePaths = try FileManager.default.contentsOfDirectory(atPath: articlesDir)
      for articlePath in articlePaths  {
        let fullPath = articlesDir + "/\(articlePath)"
        if let articleData = FileManager.default.contents(atPath: fullPath),
          let articleDict = try NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(articleData) as? [String: Any],
          let title = articleDict["title"] as? String,
          let content = articleDict["content"] as? String,
          let published = articleDict["published"] as? Bool {
          let article = Article(title: title, content: content, published: published)
          savedArticles.append(article)
        }
      }
    } catch let e {
      print(e)
    }
    
    articles = savedArticles
  }
  
  public static func add(article: Article) {
    articles.append(article)
  }
  
  public static func remove(article articleToDelete: Article) {
    articles.removeAll { article -> Bool in
      article.title == articleToDelete.title && article.content == articleToDelete.content
    }
  }
}

后记

本篇主要介绍了构建Siri Shortcuts简单示例,感兴趣的给个赞或者关注~~~

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 225,165评论 6 523
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 96,476评论 3 405
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 172,446评论 0 368
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 61,157评论 1 301
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 70,164评论 6 400
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 53,615评论 1 316
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 41,969评论 3 430
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 40,959评论 0 279
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 47,495评论 1 324
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 39,529评论 3 347
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 41,641评论 1 355
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 37,233评论 5 351
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 42,976评论 3 340
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 33,407评论 0 25
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 34,552评论 1 277
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 50,218评论 3 381
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 46,715评论 2 366

推荐阅读更多精彩内容