├── .DS_Store ├── main ├── .DS_Store └── controllers │ └── .DS_Store ├── ExampleImages ├── 1.PNG ├── 2.PNG ├── 3.PNG ├── 4.PNG ├── 5.PNG └── .DS_Store ├── LiuqsEmotions ├── 静态表情 │ ├── [1].png │ ├── [2].png │ ├── [3].png │ ├── [4].png │ ├── [5].png │ ├── [6].png │ ├── [7].png │ ├── [8].png │ ├── [9].png │ ├── [10].png │ ├── [11].png │ ├── [12].png │ ├── [13].png │ ├── [14].png │ ├── [15].png │ ├── [16].png │ ├── [17].png │ ├── [18].png │ ├── [19].png │ ├── [20].png │ ├── [21].png │ ├── [22].png │ ├── [23].png │ ├── [24].png │ ├── [25].png │ ├── [26].png │ ├── [27].png │ ├── [28].png │ ├── [29].png │ ├── [30].png │ ├── [31].png │ ├── [32].png │ ├── [33].png │ ├── [34].png │ ├── [35].png │ ├── [36].png │ ├── [37].png │ ├── [38].png │ ├── [39].png │ ├── [40].png │ ├── [41].png │ ├── [42].png │ ├── [43].png │ ├── [44].png │ ├── [45].png │ ├── [46].png │ ├── [47].png │ ├── [48].png │ ├── [49].png │ ├── [50].png │ ├── [51].png │ ├── [52].png │ ├── [53].png │ ├── [54].png │ ├── [55].png │ ├── [56].png │ ├── [57].png │ ├── [58].png │ ├── [59].png │ ├── [60].png │ ├── [61].png │ ├── [62].png │ ├── [63].png │ ├── [64].png │ ├── [65].png │ ├── [66].png │ ├── [67].png │ ├── [68].png │ ├── [69].png │ ├── [70].png │ ├── [71].png │ ├── [72].png │ ├── [73].png │ ├── [74].png │ ├── [75].png │ ├── [76].png │ ├── [77].png │ ├── LiuqsTextAttachment.h │ └── LiuqsTextAttachment.m ├── gif超清 │ ├── 2_1.gif │ ├── 2_10.gif │ ├── 2_11.gif │ ├── 2_12.gif │ ├── 2_13.gif │ ├── 2_14.gif │ ├── 2_15.gif │ ├── 2_16.gif │ ├── 2_17.gif │ ├── 2_18.gif │ ├── 2_2.gif │ ├── 2_3.gif │ ├── 2_4.gif │ ├── 2_5.gif │ ├── 2_6.gif │ ├── 2_7.gif │ ├── 2_8.gif │ ├── 2_9.gif │ └── LiuqsToolBarView.swift ├── Face_gif │ ├── [61].gif │ ├── [62].gif │ ├── [63].gif │ ├── [64].gif │ ├── [65].gif │ ├── [66].gif │ ├── [67].gif │ ├── [68].gif │ ├── [69].gif │ ├── [70].gif │ ├── [71].gif │ └── [72].gif ├── LiuqsGifEmoji.plist ├── LiuqsTextAttachment.swift ├── LiuqsEmotionTags.plist ├── LiuqsEmoji.plist ├── LiuqsChageEmotionStrTool.swift └── LiuqsEmotionKeyBoard.swift ├── LiuqsChatEmotionSwift ├── .DS_Store ├── Assets.xcassets │ ├── Contents.json │ ├── chat │ │ ├── Contents.json │ │ ├── chat_receive_nor.imageset │ │ │ ├── Dialog.png │ │ │ ├── Dialog@2x.png │ │ │ ├── Dialog@3x.png │ │ │ └── Contents.json │ │ ├── chat_send_p.imageset │ │ │ ├── chat_send_pre.png │ │ │ ├── chat_send_pre@2x.png │ │ │ ├── chat_send_pre@3x.png │ │ │ └── Contents.json │ │ ├── chat_send_nor.imageset │ │ │ ├── chat_send_nor.png │ │ │ ├── chat_send_nor@2x.png │ │ │ ├── chat_send_nor@3x.png │ │ │ └── Contents.json │ │ ├── chat_receive_p.imageset │ │ │ ├── chat_receive_nor_p.png │ │ │ ├── chat_receive_nor_p@2x.png │ │ │ ├── chat_receive_nor_p@3x.png │ │ │ └── Contents.json │ │ ├── emotionBtn_se.imageset │ │ │ ├── group_topic_keyboard.png │ │ │ ├── group_topic_keyboard@2x.png │ │ │ ├── group_topic_keyboard@3x.png │ │ │ └── Contents.json │ │ ├── emotionBtn_no.imageset │ │ │ ├── group_topic_expression.png │ │ │ ├── group_topic_expression@2x.png │ │ │ ├── group_topic_expression@3x.png │ │ │ └── Contents.json │ │ ├── navigationbar_back_highlighted.imageset │ │ │ ├── navigationbar_back_highlighted@2x.png │ │ │ ├── navigationbar_back_highlighted@3x.png │ │ │ └── Contents.json │ │ ├── compose_emoticonbutton_background.imageset │ │ │ ├── compose_emoticonbutton_background@2x.png │ │ │ ├── compose_emoticonbutton_background@3x.png │ │ │ └── Contents.json │ │ └── compose_emoticonbutton_background_highlighted.imageset │ │ │ ├── compose_emoticonbutton_background_highlighted@2x.png │ │ │ ├── compose_emoticonbutton_background_highlighted@3x.png │ │ │ └── Contents.json │ ├── TabBar │ │ ├── Contents.json │ │ ├── 4.imageset │ │ │ ├── 4.png │ │ │ └── Contents.json │ │ ├── tabbar_home.imageset │ │ │ ├── tabbar_home.png │ │ │ ├── tabbar_home@2x.png │ │ │ ├── tabbar_home@3x.png │ │ │ └── Contents.json │ │ ├── tabbar_discover.imageset │ │ │ ├── tabbar_discover.png │ │ │ ├── tabbar_discover@2x.png │ │ │ ├── tabbar_discover@3x.png │ │ │ └── Contents.json │ │ ├── tabbar_profile.imageset │ │ │ ├── tabbar_profile.png │ │ │ ├── tabbar_profile@2x.png │ │ │ ├── tabbar_profile@3x.png │ │ │ └── Contents.json │ │ ├── tabbar_background.imageset │ │ │ ├── tabbar_background@2x.png │ │ │ └── Contents.json │ │ ├── tabbar_message_center.imageset │ │ │ ├── tabbar_message_center.png │ │ │ ├── tabbar_message_center@2x.png │ │ │ ├── tabbar_message_center@3x.png │ │ │ └── Contents.json │ │ ├── tabbar_compose_button.imageset │ │ │ ├── tabbar_compose_button@2x.png │ │ │ ├── tabbar_compose_button@3x.png │ │ │ └── Contents.json │ │ ├── tabbar_home_highlighted.imageset │ │ │ ├── tabbar_home_highlighted.png │ │ │ ├── tabbar_home_highlighted@2x.png │ │ │ ├── tabbar_home_highlighted@3x.png │ │ │ └── Contents.json │ │ ├── tabbar_compose_icon_add.imageset │ │ │ ├── tabbar_compose_icon_add@2x.png │ │ │ ├── tabbar_compose_icon_add@3x.png │ │ │ └── Contents.json │ │ ├── tabbar_profile_highlighted.imageset │ │ │ ├── tabbar_profile_highlighted.png │ │ │ ├── tabbar_profile_highlighted@2x.png │ │ │ ├── tabbar_profile_highlighted@3x.png │ │ │ └── Contents.json │ │ ├── tabbar_discover_highlighted.imageset │ │ │ ├── tabbar_discover_highlighted.png │ │ │ ├── tabbar_discover_highlighted@2x.png │ │ │ ├── tabbar_discover_highlighted@3x.png │ │ │ └── Contents.json │ │ ├── tabbar_message_center_highlighted.imageset │ │ │ ├── tabbar_message_center_highlighted.png │ │ │ ├── tabbar_message_center_highlighted@2x.png │ │ │ ├── tabbar_message_center_highlighted@3x.png │ │ │ └── Contents.json │ │ ├── tabbar_compose_button_highlighted.imageset │ │ │ ├── tabbar_compose_button_highlighted@2x.png │ │ │ ├── tabbar_compose_button_highlighted@3x.png │ │ │ └── Contents.json │ │ └── tabbar_compose_icon_add_highlighted.imageset │ │ │ ├── tabbar_compose_icon_add_highlighted@2x.png │ │ │ ├── tabbar_compose_icon_add_highlighted@3x.png │ │ │ └── Contents.json │ ├── emoji │ │ ├── Contents.json │ │ ├── backDelete.imageset │ │ │ ├── expression_delete.png │ │ │ ├── expression_delete@2x.png │ │ │ ├── expression_delete@3x.png │ │ │ └── Contents.json │ │ └── default_expression.imageset │ │ │ ├── default_expression.png │ │ │ ├── default_expression@2x.png │ │ │ ├── default_expression@3x.png │ │ │ └── Contents.json │ ├── iconImage │ │ ├── Contents.json │ │ ├── 1.imageset │ │ │ ├── 1.png │ │ │ └── Contents.json │ │ └── 2.imageset │ │ │ ├── 2.jpg │ │ │ └── Contents.json │ ├── LaunchImage.launchimage │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── Base.lproj │ └── LaunchScreen.storyboard ├── AppDelegate.swift ├── LiuqsPushTransition.swift ├── LiuqsPopTransition.swift └── tabBarController.swift ├── LiuqsChatEmotionSwift.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── Liuqs.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Liuqs.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── xcschememanagement.plist │ └── LiuqsChatEmotionSwift.xcscheme ├── README.md ├── 我 ├── HomeTableViewController.swift ├── PersonalViewController.swift ├── DiscoverTableViewController.swift ├── AddViewController.swift └── PresentViewController.swift ├── chat ├── views │ ├── LiuqsChatMessage.swift │ ├── LiuqsChatCellFrame.swift │ ├── ChatListViewCell.swift │ └── LiuqsChatMessageCell.swift └── controllers │ ├── ChatViewController.swift │ └── ChatDetailViewController.swift ├── LiuqsChatEmotionSwiftTests ├── Info.plist └── LiuqsChatEmotionSwiftTests.swift ├── LiuqsChatEmotionSwiftUITests ├── Info.plist └── LiuqsChatEmotionSwiftUITests.swift ├── other └── LiuqsDefines.swift └── category ├── UIView+Extension.swift └── UIImage+Extension.swift /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/.DS_Store -------------------------------------------------------------------------------- /main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/main/.DS_Store -------------------------------------------------------------------------------- /ExampleImages/1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/ExampleImages/1.PNG -------------------------------------------------------------------------------- /ExampleImages/2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/ExampleImages/2.PNG -------------------------------------------------------------------------------- /ExampleImages/3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/ExampleImages/3.PNG -------------------------------------------------------------------------------- /ExampleImages/4.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/ExampleImages/4.PNG -------------------------------------------------------------------------------- /ExampleImages/5.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/ExampleImages/5.PNG -------------------------------------------------------------------------------- /ExampleImages/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/ExampleImages/.DS_Store -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[1].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[1].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[2].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[2].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[3].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[3].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[4].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[4].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[5].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[5].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[6].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[6].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[7].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[7].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[8].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[8].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[9].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[9].png -------------------------------------------------------------------------------- /main/controllers/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/main/controllers/.DS_Store -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_1.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_10.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_11.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_12.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_13.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_14.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_15.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_16.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_17.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_18.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_2.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_3.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_4.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_5.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_6.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_7.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_8.gif -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/2_9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/gif超清/2_9.gif -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[10].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[10].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[11].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[11].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[12].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[12].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[13].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[13].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[14].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[14].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[15].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[15].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[16].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[16].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[17].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[17].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[18].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[18].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[19].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[19].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[20].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[20].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[21].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[21].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[22].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[22].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[23].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[23].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[24].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[24].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[25].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[25].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[26].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[26].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[27].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[27].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[28].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[28].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[29].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[29].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[30].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[30].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[31].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[31].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[32].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[32].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[33].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[33].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[34].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[34].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[35].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[35].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[36].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[36].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[37].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[37].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[38].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[38].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[39].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[39].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[40].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[40].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[41].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[41].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[42].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[42].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[43].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[43].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[44].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[44].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[45].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[45].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[46].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[46].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[47].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[47].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[48].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[48].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[49].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[49].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[50].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[50].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[51].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[51].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[52].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[52].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[53].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[53].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[54].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[54].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[55].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[55].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[56].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[56].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[57].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[57].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[58].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[58].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[59].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[59].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[60].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[60].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[61].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[61].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[62].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[62].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[63].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[63].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[64].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[64].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[65].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[65].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[66].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[66].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[67].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[67].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[68].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[68].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[69].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[69].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[70].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[70].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[71].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[71].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[72].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[72].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[73].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[73].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[74].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[74].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[75].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[75].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[76].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[76].png -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/[77].png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/静态表情/[77].png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/.DS_Store -------------------------------------------------------------------------------- /LiuqsEmotions/Face_gif/[61].gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/Face_gif/[61].gif -------------------------------------------------------------------------------- /LiuqsEmotions/Face_gif/[62].gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/Face_gif/[62].gif -------------------------------------------------------------------------------- /LiuqsEmotions/Face_gif/[63].gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/Face_gif/[63].gif -------------------------------------------------------------------------------- /LiuqsEmotions/Face_gif/[64].gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/Face_gif/[64].gif -------------------------------------------------------------------------------- /LiuqsEmotions/Face_gif/[65].gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/Face_gif/[65].gif -------------------------------------------------------------------------------- /LiuqsEmotions/Face_gif/[66].gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/Face_gif/[66].gif -------------------------------------------------------------------------------- /LiuqsEmotions/Face_gif/[67].gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/Face_gif/[67].gif -------------------------------------------------------------------------------- /LiuqsEmotions/Face_gif/[68].gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/Face_gif/[68].gif -------------------------------------------------------------------------------- /LiuqsEmotions/Face_gif/[69].gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/Face_gif/[69].gif -------------------------------------------------------------------------------- /LiuqsEmotions/Face_gif/[70].gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/Face_gif/[70].gif -------------------------------------------------------------------------------- /LiuqsEmotions/Face_gif/[71].gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/Face_gif/[71].gif -------------------------------------------------------------------------------- /LiuqsEmotions/Face_gif/[72].gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsEmotions/Face_gif/[72].gif -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/emoji/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/iconImage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/4.imageset/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/4.imageset/4.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/iconImage/1.imageset/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/iconImage/1.imageset/1.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/iconImage/2.imageset/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/iconImage/2.imageset/2.jpg -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_receive_nor.imageset/Dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_receive_nor.imageset/Dialog.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_home.imageset/tabbar_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_home.imageset/tabbar_home.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_send_p.imageset/chat_send_pre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_send_p.imageset/chat_send_pre.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_home.imageset/tabbar_home@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_home.imageset/tabbar_home@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_home.imageset/tabbar_home@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_home.imageset/tabbar_home@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_receive_nor.imageset/Dialog@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_receive_nor.imageset/Dialog@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_receive_nor.imageset/Dialog@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_receive_nor.imageset/Dialog@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_send_nor.imageset/chat_send_nor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_send_nor.imageset/chat_send_nor.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_send_p.imageset/chat_send_pre@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_send_p.imageset/chat_send_pre@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_send_p.imageset/chat_send_pre@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_send_p.imageset/chat_send_pre@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_send_nor.imageset/chat_send_nor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_send_nor.imageset/chat_send_nor@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_send_nor.imageset/chat_send_nor@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_send_nor.imageset/chat_send_nor@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/emoji/backDelete.imageset/expression_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/emoji/backDelete.imageset/expression_delete.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_discover.imageset/tabbar_discover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_discover.imageset/tabbar_discover.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_profile.imageset/tabbar_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_profile.imageset/tabbar_profile.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_receive_p.imageset/chat_receive_nor_p.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_receive_p.imageset/chat_receive_nor_p.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/emoji/backDelete.imageset/expression_delete@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/emoji/backDelete.imageset/expression_delete@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/emoji/backDelete.imageset/expression_delete@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/emoji/backDelete.imageset/expression_delete@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_profile.imageset/tabbar_profile@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_profile.imageset/tabbar_profile@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_profile.imageset/tabbar_profile@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_profile.imageset/tabbar_profile@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/emotionBtn_se.imageset/group_topic_keyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/emotionBtn_se.imageset/group_topic_keyboard.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_discover.imageset/tabbar_discover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_discover.imageset/tabbar_discover@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_discover.imageset/tabbar_discover@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_discover.imageset/tabbar_discover@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_receive_p.imageset/chat_receive_nor_p@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_receive_p.imageset/chat_receive_nor_p@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_receive_p.imageset/chat_receive_nor_p@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_receive_p.imageset/chat_receive_nor_p@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/emotionBtn_no.imageset/group_topic_expression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/emotionBtn_no.imageset/group_topic_expression.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/emotionBtn_se.imageset/group_topic_keyboard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/emotionBtn_se.imageset/group_topic_keyboard@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/emotionBtn_se.imageset/group_topic_keyboard@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/emotionBtn_se.imageset/group_topic_keyboard@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/emoji/default_expression.imageset/default_expression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/emoji/default_expression.imageset/default_expression.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_background.imageset/tabbar_background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_background.imageset/tabbar_background@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/emotionBtn_no.imageset/group_topic_expression@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/emotionBtn_no.imageset/group_topic_expression@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/emotionBtn_no.imageset/group_topic_expression@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/emotionBtn_no.imageset/group_topic_expression@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/emoji/default_expression.imageset/default_expression@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/emoji/default_expression.imageset/default_expression@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/emoji/default_expression.imageset/default_expression@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/emoji/default_expression.imageset/default_expression@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_message_center.imageset/tabbar_message_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_message_center.imageset/tabbar_message_center.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_button.imageset/tabbar_compose_button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_button.imageset/tabbar_compose_button@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_button.imageset/tabbar_compose_button@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_button.imageset/tabbar_compose_button@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_message_center.imageset/tabbar_message_center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_message_center.imageset/tabbar_message_center@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_message_center.imageset/tabbar_message_center@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_message_center.imageset/tabbar_message_center@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_home_highlighted.imageset/tabbar_home_highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_home_highlighted.imageset/tabbar_home_highlighted.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_icon_add.imageset/tabbar_compose_icon_add@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_icon_add.imageset/tabbar_compose_icon_add@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_icon_add.imageset/tabbar_compose_icon_add@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_icon_add.imageset/tabbar_compose_icon_add@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_home_highlighted.imageset/tabbar_home_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_home_highlighted.imageset/tabbar_home_highlighted@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_home_highlighted.imageset/tabbar_home_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_home_highlighted.imageset/tabbar_home_highlighted@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift.xcodeproj/project.xcworkspace/xcuserdata/Liuqs.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift.xcodeproj/project.xcworkspace/xcuserdata/Liuqs.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_profile_highlighted.imageset/tabbar_profile_highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_profile_highlighted.imageset/tabbar_profile_highlighted.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_discover_highlighted.imageset/tabbar_discover_highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_discover_highlighted.imageset/tabbar_discover_highlighted.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_profile_highlighted.imageset/tabbar_profile_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_profile_highlighted.imageset/tabbar_profile_highlighted@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_profile_highlighted.imageset/tabbar_profile_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_profile_highlighted.imageset/tabbar_profile_highlighted@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_discover_highlighted.imageset/tabbar_discover_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_discover_highlighted.imageset/tabbar_discover_highlighted@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_discover_highlighted.imageset/tabbar_discover_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_discover_highlighted.imageset/tabbar_discover_highlighted@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/navigationbar_back_highlighted.imageset/navigationbar_back_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/navigationbar_back_highlighted.imageset/navigationbar_back_highlighted@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/navigationbar_back_highlighted.imageset/navigationbar_back_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/navigationbar_back_highlighted.imageset/navigationbar_back_highlighted@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_message_center_highlighted.imageset/tabbar_message_center_highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_message_center_highlighted.imageset/tabbar_message_center_highlighted.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/compose_emoticonbutton_background.imageset/compose_emoticonbutton_background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/compose_emoticonbutton_background.imageset/compose_emoticonbutton_background@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/compose_emoticonbutton_background.imageset/compose_emoticonbutton_background@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/compose_emoticonbutton_background.imageset/compose_emoticonbutton_background@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_button_highlighted.imageset/tabbar_compose_button_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_button_highlighted.imageset/tabbar_compose_button_highlighted@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_button_highlighted.imageset/tabbar_compose_button_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_button_highlighted.imageset/tabbar_compose_button_highlighted@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_message_center_highlighted.imageset/tabbar_message_center_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_message_center_highlighted.imageset/tabbar_message_center_highlighted@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_message_center_highlighted.imageset/tabbar_message_center_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_message_center_highlighted.imageset/tabbar_message_center_highlighted@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_icon_add_highlighted.imageset/tabbar_compose_icon_add_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_icon_add_highlighted.imageset/tabbar_compose_icon_add_highlighted@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_icon_add_highlighted.imageset/tabbar_compose_icon_add_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_icon_add_highlighted.imageset/tabbar_compose_icon_add_highlighted@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/compose_emoticonbutton_background_highlighted.imageset/compose_emoticonbutton_background_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/compose_emoticonbutton_background_highlighted.imageset/compose_emoticonbutton_background_highlighted@2x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/compose_emoticonbutton_background_highlighted.imageset/compose_emoticonbutton_background_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Liuqs-MrPotato/LiuqsChatSwift/HEAD/LiuqsChatEmotionSwift/Assets.xcassets/chat/compose_emoticonbutton_background_highlighted.imageset/compose_emoticonbutton_background_highlighted@3x.png -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "4.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/iconImage/1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/iconImage/2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "2.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 效果图: 2 | 3 | ![image](https://github.com/LMMIsGood/LiuqsChatSwift/blob/master/ExampleImages/1.PNG) 4 | ![image](https://github.com/LMMIsGood/LiuqsChatSwift/blob/master/ExampleImages/2.PNG) 5 | ![image](https://github.com/LMMIsGood/LiuqsChatSwift/blob/master/ExampleImages/3.PNG) 6 | ![image](https://github.com/LMMIsGood/LiuqsChatSwift/blob/master/ExampleImages/4.PNG) 7 | ![image](https://github.com/LMMIsGood/LiuqsChatSwift/blob/master/ExampleImages/5.PNG) 8 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_background@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /我/HomeTableViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HomeTableViewController.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/8. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class HomeTableViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | initSomething() 17 | } 18 | 19 | func initSomething() { 20 | 21 | self.view.backgroundColor = UIColor.white; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /我/PersonalViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PersonalViewController.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/8. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class PersonalViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | initSomething() 17 | } 18 | 19 | func initSomething() { 20 | 21 | self.view.backgroundColor = UIColor.white 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_button.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_compose_button@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "tabbar_compose_button@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_receive_nor.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Dialog.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Dialog@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "Dialog@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_icon_add.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_compose_icon_add@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "tabbar_compose_icon_add@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_home.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "tabbar_home.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "tabbar_home@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "tabbar_home@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_send_nor.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chat_send_nor.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chat_send_nor@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "chat_send_nor@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_send_p.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chat_send_pre.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chat_send_pre@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "chat_send_pre@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_profile.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "tabbar_profile.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "tabbar_profile@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "tabbar_profile@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/navigationbar_back_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "navigationbar_back_highlighted@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "navigationbar_back_highlighted@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_discover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "tabbar_discover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "tabbar_discover@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "tabbar_discover@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/emoji/backDelete.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "expression_delete.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "expression_delete@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "expression_delete@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_button_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_compose_button_highlighted@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "tabbar_compose_button_highlighted@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/chat_receive_p.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chat_receive_nor_p.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chat_receive_nor_p@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "chat_receive_nor_p@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/compose_emoticonbutton_background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "compose_emoticonbutton_background@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "compose_emoticonbutton_background@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/emotionBtn_se.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "group_topic_keyboard.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "group_topic_keyboard@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "group_topic_keyboard@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/emoji/default_expression.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "default_expression.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "default_expression@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "default_expression@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_compose_icon_add_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_compose_icon_add_highlighted@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "tabbar_compose_icon_add_highlighted@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/emotionBtn_no.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "group_topic_expression.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "group_topic_expression@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "group_topic_expression@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_message_center.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "tabbar_message_center.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "tabbar_message_center@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "tabbar_message_center@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_home_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "tabbar_home_highlighted.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "tabbar_home_highlighted@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "tabbar_home_highlighted@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/chat/compose_emoticonbutton_background_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "compose_emoticonbutton_background_highlighted@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "compose_emoticonbutton_background_highlighted@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_profile_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "tabbar_profile_highlighted.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "tabbar_profile_highlighted@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "tabbar_profile_highlighted@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_discover_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "tabbar_discover_highlighted.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "tabbar_discover_highlighted@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "tabbar_discover_highlighted@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift.xcodeproj/xcuserdata/Liuqs.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/TabBar/tabbar_message_center_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "tabbar_message_center_highlighted.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "tabbar_message_center_highlighted@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "tabbar_message_center_highlighted@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /chat/views/LiuqsChatMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LiuqsChatMessage.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/23. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | enum userType { 12 | 13 | case me 14 | 15 | case other 16 | } 17 | 18 | 19 | class LiuqsChatMessage: NSObject { 20 | 21 | var userName:String = String() 22 | 23 | var message:String = String() 24 | 25 | var gifName:String = String() 26 | 27 | var attMessage = NSMutableAttributedString() 28 | 29 | var currentUserType = userType.me 30 | 31 | var messageType:Int = 0 32 | 33 | } 34 | -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/LiuqsTextAttachment.h: -------------------------------------------------------------------------------- 1 | // 2 | // LiuqsTextAttachment.h 3 | // chatWithEmotion 4 | // 5 | // Created by 刘全水 on 16/7/25. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum : NSUInteger { 12 | //gif 13 | LiuqsEmotionTypeGif, 14 | //静态图 15 | LiuqsEmotionTypePng, 16 | 17 | } LiuqsEmotionType; 18 | 19 | @interface LiuqsTextAttachment : NSTextAttachment 20 | 21 | @property(nonatomic, copy) NSString *imageName; 22 | 23 | @property(nonatomic, strong) NSString *emojiTag; 24 | 25 | @property(nonatomic, assign) CGSize emojiSize; 26 | 27 | @property(nonatomic, assign) CGRect emotionRect; 28 | 29 | @property(nonatomic, assign) LiuqsEmotionType emotionType; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /LiuqsEmotions/静态表情/LiuqsTextAttachment.m: -------------------------------------------------------------------------------- 1 | // 2 | // LiuqsTextAttachment.m 3 | // chatWithEmotion 4 | // 5 | // Created by 刘全水 on 16/7/25. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | #import "LiuqsTextAttachment.h" 10 | 11 | #define emotionRate 1.0 12 | 13 | @implementation LiuqsTextAttachment 14 | 15 | - (CGRect)attachmentBoundsForTextContainer:(NSTextContainer *)textContainer proposedLineFragment:(CGRect)lineFrag glyphPosition:(CGPoint)position characterIndex:(NSUInteger)charIndex { 16 | 17 | self.emotionRect = CGRectMake(position.x, position.y + 0.5, _emojiSize.width * emotionRate, _emojiSize.height * emotionRate); 18 | 19 | return CGRectMake(0, -4, _emojiSize.width * emotionRate, _emojiSize.height * emotionRate); 20 | } 21 | 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwiftTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwiftUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift.xcodeproj/xcuserdata/Liuqs.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LiuqsChatEmotionSwift.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 7320DC541D5811FE007383DB 16 | 17 | primary 18 | 19 | 20 | 7320DC681D5811FE007383DB 21 | 22 | primary 23 | 24 | 25 | 7320DC731D5811FE007383DB 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /LiuqsEmotions/LiuqsGifEmoji.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 1 6 | 害羞 7 | 10 8 | 疑问 9 | 11 10 | 11 | 12 12 | 鄙视 13 | 13 14 | 15 | 14 16 | 17 | 15 18 | 大哭 19 | 16 20 | 擦汗 21 | 17 22 | 晕了 23 | 18 24 | 嘲笑 25 | 2 26 | 吐舌 27 | 3 28 | 可怜 29 | 4 30 | 31 | 5 32 | 敲打 33 | 6 34 | 微笑 35 | 7 36 | 坏笑 37 | 8 38 | 抠鼻 39 | 9 40 | 发火 41 | 42 | 43 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwiftTests/LiuqsChatEmotionSwiftTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LiuqsChatEmotionSwiftTests.swift 3 | // LiuqsChatEmotionSwiftTests 4 | // 5 | // Created by 刘全水 on 16/8/8. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import LiuqsChatEmotionSwift 11 | 12 | class LiuqsChatEmotionSwiftTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwiftUITests/LiuqsChatEmotionSwiftUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LiuqsChatEmotionSwiftUITests.swift 3 | // LiuqsChatEmotionSwiftUITests 4 | // 5 | // Created by 刘全水 on 16/8/8. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class LiuqsChatEmotionSwiftUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "orientation" : "portrait", 11 | "idiom" : "iphone", 12 | "extent" : "full-screen", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "orientation" : "portrait", 17 | "idiom" : "iphone", 18 | "extent" : "full-screen", 19 | "subtype" : "retina4", 20 | "scale" : "2x" 21 | }, 22 | { 23 | "orientation" : "portrait", 24 | "idiom" : "iphone", 25 | "extent" : "full-screen", 26 | "minimum-system-version" : "8.0", 27 | "subtype" : "736h", 28 | "scale" : "3x" 29 | }, 30 | { 31 | "orientation" : "portrait", 32 | "idiom" : "iphone", 33 | "extent" : "full-screen", 34 | "minimum-system-version" : "8.0", 35 | "subtype" : "667h", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "orientation" : "portrait", 40 | "idiom" : "iphone", 41 | "extent" : "full-screen", 42 | "minimum-system-version" : "7.0", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "orientation" : "portrait", 47 | "idiom" : "iphone", 48 | "extent" : "full-screen", 49 | "minimum-system-version" : "7.0", 50 | "subtype" : "retina4", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UIStatusBarHidden 30 | 31 | UIStatusBarStyle 32 | UIStatusBarStyleLightContent 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /LiuqsEmotions/LiuqsTextAttachment.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LiuqsTextAttachment.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/22. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class LiuqsTextAttachment: NSTextAttachment { 12 | 13 | var emojiTag:String = String() 14 | 15 | var emojiSize:CGSize = CGSize() 16 | 17 | override func attachmentBounds(for textContainer: NSTextContainer?, proposedLineFragment lineFrag: CGRect, glyphPosition position: CGPoint, characterIndex charIndex: Int) -> CGRect { 18 | 19 | return CGRect.init(x: 0, y: -4, width: emojiSize.width, height: emojiSize.height) 20 | } 21 | 22 | } 23 | 24 | extension NSAttributedString { 25 | 26 | 27 | func getPlainString() -> String { 28 | 29 | let plainString = NSMutableString.init(string: self.string) 30 | 31 | var base:Int = 0 32 | 33 | self .enumerateAttribute(NSAttachmentAttributeName, in: NSRange.init(location: 0, length: self.length), options: []) { (value, range:NSRange, stop) in 34 | 35 | if (value != nil) { 36 | 37 | let emoji:LiuqsTextAttachment = value as! LiuqsTextAttachment 38 | 39 | print(base,emoji.emojiTag) 40 | 41 | plainString.replaceCharacters(in: NSRange.init(location: range.location + base, length: range.length), with: emoji.emojiTag) 42 | 43 | base = base + Int(emoji.emojiTag.characters.count - 1) 44 | } 45 | } 46 | 47 | return plainString as String 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /other/LiuqsDefines.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LiuqsDefines.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/8. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public let screenW = UIScreen.main.bounds.size.width 12 | 13 | public let screenH = UIScreen.main.bounds.size.height 14 | 15 | public let EMOJI_KEYBOARD_HEIGHT = (4 * screenW * 0.0875 + (3 + 1) * ((screenW - 7 * screenW * 0.0875 ) / 8) + 20) 16 | 17 | public let BLUE_Color = UIColor(red: 22.0 / 255.0, green: 128.0 / 255.0, blue: 250.0 / 255.0, alpha: 1.0) 18 | 19 | public let BACKGROUND_Color = UIColor(red: 235.0 / 255.0, green: 235.0 / 255.0, blue: 235.0 / 255.0, alpha: 1.0) 20 | 21 | public let navColor = UIColor.init(red: 57 / 255, green: 56 / 255, blue: 54 / 255, alpha: 1.0) 22 | 23 | 24 | ///toolbar 25 | public let toobarH = screenW * 44 / 320 26 | 27 | public let TextViewW = screenW - (screenW * 55 / 320) 28 | 29 | public let TextViewH = screenW * 34 / 320 30 | 31 | public let emotionBtnW = screenW * 34 / 320 32 | 33 | public let emotionBtnH = screenW * 34 / 320 34 | 35 | public let emotionBtnX = screenW - (screenW * 40 / 320) 36 | 37 | public let toolBarFrameDown = CGRect(x:0, y:screenH - toobarH, width:screenW, height:toobarH) 38 | 39 | public let toolBarFrameUPBaseEmotion = CGRect(x:0, y:screenH - toobarH - EMOJI_KEYBOARD_HEIGHT, width:screenW, height:toobarH) 40 | 41 | public let Vgap = screenW * 5 / 320 42 | 43 | public let Lgap = screenW * 10 / 320 44 | 45 | ///emotionView 46 | public let emotionUpFrame = CGRect.init(x: 0, y: screenH - (EMOJI_KEYBOARD_HEIGHT), width: screenW, height: EMOJI_KEYBOARD_HEIGHT) 47 | 48 | public let emotionDownFrame = CGRect.init(x: 0, y: screenH, width: screenW, height: EMOJI_KEYBOARD_HEIGHT) 49 | 50 | public let emotionTipTime = 0.25 51 | 52 | 53 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /我/DiscoverTableViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DiscoverTableViewController.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/8. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class DiscoverTableViewController: UIViewController, UINavigationControllerDelegate{ 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | initSomething() 17 | } 18 | 19 | func initSomething() { 20 | 21 | self.view.backgroundColor = UIColor.white; 22 | } 23 | 24 | override func viewWillAppear(_ animated: Bool) { 25 | 26 | self.navigationController?.delegate = self 27 | 28 | } 29 | 30 | override func viewDidAppear(_ animated: Bool) { 31 | 32 | self.navigationController?.navigationBar.isHidden = false 33 | 34 | self.tabBarController?.tabBar.isHidden = false 35 | } 36 | 37 | override func touchesBegan(_ touches: Set, with event: UIEvent?) { 38 | 39 | let addVC = PresentViewController() 40 | 41 | self.tabBarController?.tabBar.isHidden = true 42 | 43 | self.navigationController?.pushViewController(addVC, animated: true) 44 | 45 | } 46 | 47 | func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { 48 | 49 | if operation == UINavigationControllerOperation.push { 50 | 51 | let pushTran:LiuqsPushTransition = LiuqsPushTransition() 52 | 53 | pushTran.btnRect = CGRect.init(x: (screenW - 44) * 0.5, y: screenH - 44, width: 44, height: 44) 54 | 55 | return pushTran 56 | 57 | }else {return nil} 58 | 59 | } 60 | 61 | 62 | 63 | 64 | 65 | 66 | } 67 | -------------------------------------------------------------------------------- /LiuqsEmotions/LiuqsEmotionTags.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | [微笑] 6 | [玫瑰] 7 | [强] 8 | [握手] 9 | [拥抱] 10 | [咖啡] 11 | [抱拳] 12 | [OK] 13 | [鼓掌] 14 | [疑问] 15 | [嘘] 16 | [憨笑] 17 | [偷笑] 18 | [调皮] 19 | [呲牙] 20 | [流泪] 21 | [奋斗] 22 | [饭] 23 | [爱心] 24 | [拳头] 25 | [难过] 26 | [愉快] 27 | [亲亲] 28 | [色] 29 | [得意] 30 | [害羞] 31 | [再见] 32 | [坏笑] 33 | [太阳] 34 | [月亮] 35 | [礼物] 36 | [蛋糕] 37 | [西瓜] 38 | [啤酒] 39 | [乒乓] 40 | [篮球] 41 | [足球] 42 | [嘴唇] 43 | [心碎] 44 | [胜利] 45 | [NO] 46 | [撇嘴] 47 | [发呆] 48 | [左哼哼] 49 | [右哼哼] 50 | [哈欠] 51 | [鄙视] 52 | [委屈] 53 | [快哭了] 54 | [阴险] 55 | [闭嘴] 56 | [吓] 57 | [可怜] 58 | [睡] 59 | [大哭] 60 | [尴尬] 61 | [惊讶] 62 | [冷汗] 63 | [抓狂] 64 | [吐] 65 | [g吐舌] 66 | [g拜拜] 67 | [g敲打] 68 | [g大哭] 69 | [g快哭了] 70 | [g抓狂] 71 | [g愉快] 72 | [g色] 73 | [g害羞] 74 | [g尴尬] 75 | [g傻笑] 76 | [g楞] 77 | 78 | 79 | -------------------------------------------------------------------------------- /LiuqsEmotions/gif超清/LiuqsToolBarView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LiuqsToolBarView.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/16. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol LiuqsToolBarDelegate { 12 | 13 | func ToolbarEmotionBtnDidClicked(emotionBtn:UIButton) 14 | } 15 | 16 | class LiuqsToolBarView: UIImageView { 17 | 18 | var delegate:LiuqsToolBarDelegate? 19 | 20 | lazy var textView:UITextView = { 21 | 22 | let textView = UITextView.init(frame: CGRect.init(x: Lgap, y: Vgap, width: TextViewW, height: TextViewH)) 23 | 24 | textView.backgroundColor = UIColor.white 25 | 26 | textView.returnKeyType = UIReturnKeyType.send 27 | 28 | textView.layer.cornerRadius = 8 29 | 30 | textView.layer.borderWidth = 0.5 31 | 32 | textView.isScrollEnabled = true 33 | 34 | textView.layer.borderColor = UIColor.lightGray.cgColor; 35 | 36 | return textView; 37 | }() 38 | 39 | 40 | lazy var toolBarEmotionBtn:UIButton = { 41 | 42 | let emotionBtn = UIButton.init(frame: CGRect.init(x: emotionBtnX, y: Vgap, width: emotionBtnW, height: emotionBtnH)) 43 | 44 | emotionBtn.setImage(UIImage.init(named: "emotionBtn_no"), for: UIControlState.normal) 45 | 46 | emotionBtn.setImage(UIImage.init(named: "emotionBtn_se"), for: UIControlState.selected) 47 | 48 | emotionBtn.addTarget(self, action: #selector(emotionBtnDidClicked(btn:)), for: UIControlEvents.touchUpInside) 49 | 50 | return emotionBtn; 51 | }() 52 | 53 | override init(frame: CGRect) { 54 | super.init(frame: frame) 55 | 56 | self.frame = toolBarFrameDown 57 | 58 | self.initSomeThing() 59 | 60 | addSubview(self.textView) 61 | 62 | addSubview(self.toolBarEmotionBtn) 63 | } 64 | 65 | func initSomeThing() { 66 | 67 | self.isUserInteractionEnabled = true 68 | 69 | let line:UIView = UIView.init(frame: CGRect.init(x: 0, y: 0, width: screenW, height: 0.5)) 70 | 71 | line.backgroundColor = UIColor.lightGray 72 | 73 | self.addSubview(line) 74 | 75 | self.backgroundColor = BACKGROUND_Color 76 | } 77 | 78 | required init?(coder aDecoder: NSCoder) { 79 | 80 | fatalError("初始化失败") 81 | } 82 | 83 | func emotionBtnDidClicked(btn:UIButton) { 84 | 85 | self.delegate?.ToolbarEmotionBtnDidClicked(emotionBtn: btn) 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/8. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 17 | 18 | UINavigationBar.appearance().tintColor = UIColor.white 19 | 20 | UITabBar.appearance().tintColor = UIColor.orange 21 | 22 | window = UIWindow(frame: UIScreen.main.bounds) 23 | 24 | window?.backgroundColor = BACKGROUND_Color 25 | 26 | window?.rootViewController = tabBarController() 27 | 28 | window?.makeKeyAndVisible() 29 | 30 | return true 31 | } 32 | 33 | func applicationWillResignActive(_ application: UIApplication) { 34 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 35 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 36 | } 37 | 38 | func applicationDidEnterBackground(_ application: UIApplication) { 39 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 40 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 41 | } 42 | 43 | func applicationWillEnterForeground(_ application: UIApplication) { 44 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 45 | } 46 | 47 | func applicationDidBecomeActive(_ application: UIApplication) { 48 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 49 | } 50 | 51 | func applicationWillTerminate(_ application: UIApplication) { 52 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 53 | } 54 | 55 | 56 | } 57 | 58 | -------------------------------------------------------------------------------- /chat/views/LiuqsChatCellFrame.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LiuqsChatCellFrame.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/23. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class LiuqsChatCellFrame: NSObject { 12 | 13 | var iconFrame = CGRect() 14 | 15 | var nameFrame = CGRect() 16 | 17 | var textFrame = CGRect() 18 | 19 | var imageViewFrame = CGRect() 20 | 21 | var cellHeight = CGFloat() 22 | 23 | private let iconW:CGFloat = 50.0 24 | 25 | private let padding:CGFloat = 10.0 26 | 27 | private let iconH:CGFloat = 50.0 28 | 29 | var message:LiuqsChatMessage? { 30 | 31 | didSet {computeFrames()} 32 | } 33 | 34 | //计算frame 35 | func computeFrames() { 36 | 37 | let type:Bool = message?.currentUserType == userType.me 38 | //头像 39 | let iconFrameX:CGFloat = type ? padding : screenW - padding - iconW 40 | let iconFrameY:CGFloat = padding 41 | let iconFrameW:CGFloat = iconW 42 | let iconFrameH:CGFloat = iconH 43 | iconFrame = CGRect.init(x: iconFrameX, y: iconFrameY, width: iconFrameW, height: iconFrameH) 44 | 45 | //名字 46 | nameFrame = type ? CGRect.init(x: iconFrame.maxX + padding, y: iconFrameY, width: 100, height: 25) : CGRect.init(x: screenW - padding * 2 - iconFrameW - 100, y: iconFrameY, width: 100, height: 25) 47 | 48 | if message?.messageType == 0 { 49 | 50 | //message 51 | let str:String = (message?.message)! 52 | let textAtt = LiuqsChageEmotionStrTool.changeStr(string: str, font: UIFont.systemFont(ofSize: 17.0), textColor: UIColor.black) 53 | message?.attMessage = textAtt 54 | let maxsize:CGSize = CGSize.init(width: Int(screenW - (iconFrameW + padding * 3) * 2), height: 1000) 55 | let textSize:CGSize = textAtt.boundingRect(with: maxsize, options: .usesLineFragmentOrigin, context: nil).size 56 | let emojiSize:CGSize = CGSize.init(width: textSize.width + padding * 2, height: textSize.height + padding * 2) 57 | textFrame = type ? CGRect.init(x: padding * 2 + iconFrameW, y: iconFrameY + iconFrameH * 0.5, width: emojiSize.width, height: emojiSize.height) : CGRect.init(x: screenW - padding * 2 - iconFrameW - emojiSize.width, y: iconFrameY + iconFrameH * 0.5, width: emojiSize.width, height: emojiSize.height) 58 | cellHeight = textFrame.maxY + padding; 59 | }else if message?.messageType == 1 { 60 | 61 | imageViewFrame = type ? CGRect.init(x: padding * 2 + iconFrameW, y: iconFrameY + iconFrameH * 0.5, width: 100, height: 100) : CGRect.init(x: screenW - padding * 2 - iconFrameW - 100, y: iconFrameY + iconFrameH * 0.5, width: 100, height: 100); 62 | 63 | cellHeight = imageViewFrame.maxY + padding; 64 | 65 | }else { 66 | 67 | 68 | } 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /chat/controllers/ChatViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChatViewController.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/8. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | class ChatViewController: UIViewController, UITableViewDataSource, UITableViewDelegate{ 13 | 14 | var chatList:UITableView? 15 | 16 | var rows = 10 17 | 18 | override func viewDidLoad() { 19 | super.viewDidLoad() 20 | 21 | self.createTableView() 22 | 23 | self.initSomething() 24 | 25 | } 26 | 27 | func initSomething() { 28 | 29 | self.view.backgroundColor = BACKGROUND_Color 30 | 31 | self.automaticallyAdjustsScrollViewInsets = false 32 | } 33 | 34 | 35 | func createTableView(){ 36 | 37 | chatList = UITableView.init(frame: CGRect(x:0,y:64,width:screenW,height:screenH - 108), style: UITableViewStyle.plain) 38 | 39 | chatList?.dataSource = self; 40 | 41 | chatList?.backgroundColor = BACKGROUND_Color 42 | 43 | chatList?.delegate = self; 44 | 45 | chatList?.showsHorizontalScrollIndicator = false 46 | 47 | chatList?.showsVerticalScrollIndicator = false; 48 | 49 | chatList?.register(ChatListViewCell.self, forCellReuseIdentifier: "listCell") 50 | 51 | chatList?.tableFooterView = UIView() 52 | 53 | self.view.addSubview((chatList)!) 54 | } 55 | 56 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 57 | 58 | return rows 59 | } 60 | 61 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 62 | 63 | let cell = tableView.dequeueReusableCell(withIdentifier: "listCell", for: indexPath) as! ChatListViewCell 64 | 65 | return cell 66 | } 67 | 68 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 69 | 70 | tableView.deselectRow(at: indexPath, animated: true) 71 | 72 | let chatVC = ChatDetailViewController() 73 | 74 | chatVC.hidesBottomBarWhenPushed = true 75 | 76 | self.navigationController?.pushViewController(chatVC, animated: true) 77 | } 78 | 79 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 80 | 81 | return 80; 82 | } 83 | 84 | func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { 85 | 86 | cell.separatorInset = UIEdgeInsets.zero; 87 | } 88 | 89 | func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? { 90 | 91 | let deleteAction:UITableViewRowAction = UITableViewRowAction.init(style: UITableViewRowActionStyle.default, title: "删除") { (deleteAction, IndexPath) in 92 | 93 | self.rows -= 1 94 | 95 | tableView.deleteRows(at: [indexPath], with: UITableViewRowAnimation.automatic) 96 | } 97 | 98 | return [deleteAction] 99 | } 100 | 101 | } 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /我/AddViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AddViewController.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/14. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class AddViewController: UIViewController,UINavigationControllerDelegate { 12 | 13 | var CancelBtn:UIButton = UIButton.init() 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | 18 | initSomething() 19 | createCancelBtn() 20 | createNotiLabel() 21 | 22 | } 23 | 24 | override func viewWillAppear(_ animated: Bool) { 25 | super.viewWillAppear(true) 26 | 27 | addtransAnimation() 28 | 29 | self.navigationController?.navigationBar.isHidden = true; 30 | 31 | } 32 | 33 | override var preferredStatusBarStyle: UIStatusBarStyle { 34 | 35 | return UIStatusBarStyle.lightContent 36 | } 37 | 38 | func createNotiLabel() { 39 | 40 | let label = UILabel.init(frame: CGRect.init(x: 0, y: 20, width: screenW, height: screenH - 64)) 41 | 42 | label.text = "这是一个控制器\nhttps://github.com/LMMIsGood/LiuqsChatSwift" 43 | 44 | label.font = UIFont.systemFont(ofSize: 40) 45 | 46 | label.numberOfLines = 0 47 | 48 | label.textColor = UIColor.white 49 | 50 | label.textAlignment = NSTextAlignment.center 51 | 52 | self.view.addSubview(label) 53 | } 54 | 55 | func initSomething() { 56 | 57 | self.view.backgroundColor = BLUE_Color 58 | 59 | } 60 | 61 | func creatEffectView() { 62 | 63 | let lightBlur = UIBlurEffect(style: UIBlurEffectStyle.light) 64 | 65 | let blurView = UIVisualEffectView(effect: lightBlur) 66 | 67 | blurView.frame = self.view.bounds 68 | 69 | self.view.addSubview(blurView) 70 | 71 | } 72 | 73 | func createCancelBtn() { 74 | 75 | let X:CGFloat = (screenW - 44) * 0.5 76 | 77 | let Y:CGFloat = screenH - 44 78 | 79 | let btn:UIButton = UIButton.init(frame: CGRect.init(x: X, y: Y, width: 44, height: 44)) 80 | 81 | btn.backgroundColor = UIColor.clear 82 | 83 | CancelBtn = btn 84 | 85 | btn.layer.cornerRadius = 22; 86 | 87 | btn.addTarget(self, action: #selector(self.cancelBtnClick), for: UIControlEvents.touchUpInside) 88 | 89 | btn.setImage(UIImage.init(named: "tabbar_compose_icon_add"), for: UIControlState.normal) 90 | 91 | self.view.addSubview(btn) 92 | 93 | } 94 | 95 | func addtransAnimation() { 96 | 97 | UIView.animate(withDuration: 0.4) { 98 | 99 | self.CancelBtn.transform = CGAffineTransform(rotationAngle: CGFloat(M_PI_2 * 0.5)); 100 | } 101 | } 102 | 103 | func addFtransAnimation() { 104 | 105 | UIView.animate(withDuration: 0.4) { 106 | 107 | self.CancelBtn.transform = CGAffineTransform(rotationAngle: CGFloat(-M_PI_2 * 0.5)); 108 | } 109 | 110 | } 111 | 112 | func cancelBtnClick(btn:UIButton) { 113 | 114 | self.dismiss(animated: true, completion: nil) 115 | 116 | addFtransAnimation() 117 | 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /我/PresentViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PresentViewController.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/9/8. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class PresentViewController: UIViewController, UINavigationControllerDelegate{ 12 | 13 | var CancelBtn:UIButton = UIButton.init() 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | 18 | initSomething() 19 | createCancelBtn() 20 | 21 | } 22 | 23 | override func viewWillAppear(_ animated: Bool) { 24 | super.viewWillAppear(true) 25 | 26 | addtransAnimation() 27 | 28 | self.navigationController?.delegate = self 29 | 30 | self.navigationController?.navigationBar.isHidden = true; 31 | 32 | } 33 | 34 | override var preferredStatusBarStyle: UIStatusBarStyle { 35 | 36 | return UIStatusBarStyle.lightContent 37 | } 38 | 39 | 40 | func initSomething() { 41 | 42 | self.view.backgroundColor = BLUE_Color 43 | 44 | } 45 | 46 | func creatEffectView() { 47 | 48 | let lightBlur = UIBlurEffect(style: UIBlurEffectStyle.light) 49 | 50 | let blurView = UIVisualEffectView(effect: lightBlur) 51 | 52 | blurView.frame = self.view.bounds 53 | 54 | self.view.addSubview(blurView) 55 | 56 | } 57 | 58 | func createCancelBtn() { 59 | 60 | let X:CGFloat = (screenW - 44) * 0.5 61 | 62 | let Y:CGFloat = screenH - 44 63 | 64 | let btn:UIButton = UIButton.init(frame: CGRect.init(x: X, y: Y, width: 44, height: 44)) 65 | 66 | btn.backgroundColor = UIColor.clear 67 | 68 | CancelBtn = btn 69 | 70 | btn.layer.cornerRadius = 22; 71 | 72 | btn.addTarget(self, action: #selector(self.cancelBtnClick), for: UIControlEvents.touchUpInside) 73 | 74 | btn.setImage(UIImage.init(named: "tabbar_compose_icon_add"), for: UIControlState.normal) 75 | 76 | self.view.addSubview(btn) 77 | 78 | } 79 | 80 | func addtransAnimation() { 81 | 82 | UIView.animate(withDuration: 0.4) { 83 | 84 | self.CancelBtn.transform = CGAffineTransform(rotationAngle: CGFloat(M_PI_2 * 0.5)); 85 | } 86 | } 87 | 88 | func addFtransAnimation() { 89 | 90 | UIView.animate(withDuration: 0.4) { 91 | 92 | self.CancelBtn.transform = CGAffineTransform(rotationAngle: CGFloat(-M_PI_2 * 0.5)); 93 | } 94 | 95 | } 96 | 97 | func cancelBtnClick(btn:UIButton) { 98 | 99 | self.navigationController?.popViewController(animated: true) 100 | 101 | addFtransAnimation() 102 | 103 | } 104 | 105 | func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { 106 | 107 | let pushTran:LiuqsPopTransition = LiuqsPopTransition() 108 | 109 | pushTran.btnRect = CGRect.init(x: (screenW - 44) * 0.5, y: screenH - 44, width: 44, height: 44) 110 | 111 | return pushTran 112 | } 113 | 114 | } 115 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/LiuqsPushTransition.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LiuqsPushTransition.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/14. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class LiuqsPushTransition: NSObject,UIViewControllerAnimatedTransitioning,CAAnimationDelegate { 12 | 13 | var btnRect:CGRect = CGRect.init() 14 | 15 | var TransitionContext: UIViewControllerContextTransitioning?; 16 | 17 | func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { 18 | 19 | return 0.4; 20 | 21 | } 22 | 23 | func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { 24 | 25 | TransitionContext = transitionContext 26 | 27 | let fromVC:UIViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from)! 28 | 29 | let toVC:UIViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to)! 30 | 31 | let containerView:UIView = transitionContext.containerView 32 | 33 | containerView.addSubview(fromVC.view) 34 | 35 | containerView.addSubview(toVC.view) 36 | 37 | let button:UIButton = UIButton.init(frame: btnRect) 38 | 39 | let finalPath:UIBezierPath = UIBezierPath.init(ovalIn: btnRect) 40 | 41 | let finalPoint:CGPoint; 42 | 43 | //判断触发点在哪个象限 44 | if(btnRect.origin.x > (toVC.view.bounds.size.width / 2)){ 45 | if (btnRect.origin.y < (toVC.view.bounds.size.height / 2)) { 46 | //第一象限 47 | finalPoint = CGPoint.init(x: button.center.x - 0, y: button.center.y - toVC.view.bounds.maxY + 30) 48 | 49 | }else{ 50 | //第四象限 51 | finalPoint = CGPoint.init(x: button.center.x - 0, y: button.center.y - 0) 52 | } 53 | }else{ 54 | if (btnRect.origin.y < (toVC.view.bounds.size.height / 2)) { 55 | //第二象限 56 | finalPoint = CGPoint.init(x: button.center.x - toVC.view.bounds.maxX, y: button.center.y - toVC.view.bounds.maxY+30) 57 | }else{ 58 | //第三象限 59 | finalPoint = CGPoint.init(x: button.center.x - toVC.view.bounds.maxX, y: button.center.y - 0) 60 | } 61 | } 62 | 63 | let radius:CGFloat = sqrt(finalPoint.x * finalPoint.x + finalPoint.y * finalPoint.y) 64 | 65 | let startPath:UIBezierPath = UIBezierPath.init(ovalIn:btnRect.insetBy(dx: -radius, dy: -radius)) 66 | 67 | let maskLayer:CAShapeLayer = CAShapeLayer() 68 | 69 | maskLayer.path = startPath.cgPath 70 | 71 | toVC.view.layer.mask = maskLayer; 72 | 73 | let pushAnimation:CABasicAnimation = CABasicAnimation.init(keyPath: "path") 74 | 75 | pushAnimation.fromValue = finalPath.cgPath 76 | 77 | pushAnimation.toValue = startPath.cgPath 78 | 79 | pushAnimation.duration = self.transitionDuration(using: transitionContext) 80 | 81 | pushAnimation.timingFunction = CAMediaTimingFunction.init(name: kCAMediaTimingFunctionEaseInEaseOut) 82 | 83 | pushAnimation.delegate = self 84 | 85 | maskLayer.add(pushAnimation, forKey: "animation") 86 | 87 | } 88 | 89 | func animationDidStop(_ anim: CAAnimation, finished flag: Bool) { 90 | 91 | TransitionContext?.completeTransition(!(TransitionContext?.transitionWasCancelled)!) 92 | TransitionContext?.viewController(forKey: UITransitionContextViewControllerKey.from)?.view.layer.mask = nil 93 | TransitionContext?.viewController(forKey: UITransitionContextViewControllerKey.to)?.view.layer.mask = nil; 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /LiuqsEmotions/LiuqsEmoji.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | [NO] 6 | [41] 7 | [OK] 8 | [8] 9 | [乒乓] 10 | [35] 11 | [亲亲] 12 | [23] 13 | [偷笑] 14 | [13] 15 | [再见] 16 | [27] 17 | [冷汗] 18 | [58] 19 | [发呆] 20 | [43] 21 | [可怜] 22 | [53] 23 | [右哼哼] 24 | [45] 25 | [吐] 26 | [60] 27 | [吓] 28 | [52] 29 | [呲牙] 30 | [15] 31 | [咖啡] 32 | [6] 33 | [哈欠] 34 | [46] 35 | [啤酒] 36 | [34] 37 | [嘘] 38 | [11] 39 | [嘴唇] 40 | [38] 41 | [坏笑] 42 | [28] 43 | [大哭] 44 | [55] 45 | [太阳] 46 | [29] 47 | [奋斗] 48 | [17] 49 | [委屈] 50 | [48] 51 | [害羞] 52 | [26] 53 | [尴尬] 54 | [56] 55 | [左哼哼] 56 | [44] 57 | [强] 58 | [3] 59 | [得意] 60 | [25] 61 | [微笑] 62 | [1] 63 | [心碎] 64 | [39] 65 | [快哭了] 66 | [49] 67 | [惊讶] 68 | [57] 69 | [愉快] 70 | [22] 71 | [憨笑] 72 | [12] 73 | [抱拳] 74 | [7] 75 | [拥抱] 76 | [5] 77 | [拳头] 78 | [20] 79 | [握手] 80 | [4] 81 | [撇嘴] 82 | [42] 83 | [月亮] 84 | [30] 85 | [流泪] 86 | [16] 87 | [爱心] 88 | [19] 89 | [玫瑰] 90 | [2] 91 | [疑问] 92 | [10] 93 | [睡] 94 | [54] 95 | [礼物] 96 | [31] 97 | [篮球] 98 | [36] 99 | [胜利] 100 | [40] 101 | [色] 102 | [24] 103 | [蛋糕] 104 | [32] 105 | [西瓜] 106 | [33] 107 | [调皮] 108 | [14] 109 | [足球] 110 | [37] 111 | [鄙视] 112 | [47] 113 | [酷] 114 | [76] 115 | [闭嘴] 116 | [51] 117 | [阴险] 118 | [50] 119 | [难过] 120 | [21] 121 | [饭] 122 | [18] 123 | [鼓掌] 124 | [9] 125 | [抓狂] 126 | [59] 127 | [g吐舌] 128 | [61] 129 | [g拜拜] 130 | [62] 131 | [g敲打] 132 | [63] 133 | [g大哭] 134 | [64] 135 | [g快哭了] 136 | [65] 137 | [g抓狂] 138 | [66] 139 | [g愉快] 140 | [67] 141 | [g色] 142 | [68] 143 | [g害羞] 144 | [69] 145 | [g尴尬] 146 | [70] 147 | [g傻笑] 148 | [71] 149 | [g楞] 150 | [72] 151 | 152 | 153 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/LiuqsPopTransition.swift: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // LiuqsPopTransition.swift 4 | // LiuqsChatEmotionSwift 5 | // 6 | // Created by 刘全水 on 16/8/14. 7 | // Copyright © 2016年 刘全水. All rights reserved. 8 | // 9 | 10 | import UIKit 11 | 12 | class LiuqsPopTransition: NSObject,UIViewControllerAnimatedTransitioning,CAAnimationDelegate { 13 | 14 | var btnRect:CGRect = CGRect.init() 15 | 16 | var TransitionContext: UIViewControllerContextTransitioning?; 17 | 18 | func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { 19 | 20 | return 0.4; 21 | 22 | } 23 | 24 | func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { 25 | 26 | TransitionContext = transitionContext 27 | 28 | let fromVC:UIViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from)! 29 | 30 | let toVC:UIViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to)! 31 | 32 | let containerView:UIView = transitionContext.containerView 33 | 34 | containerView.addSubview(toVC.view) 35 | 36 | containerView.addSubview(fromVC.view) 37 | 38 | let button:UIButton = UIButton.init(frame: btnRect) 39 | 40 | let finalPath:UIBezierPath = UIBezierPath.init(ovalIn: btnRect) 41 | 42 | let finalPoint:CGPoint; 43 | 44 | //判断触发点在那个象限 45 | if(btnRect.origin.x > (toVC.view.bounds.size.width / 2)){ 46 | if (btnRect.origin.y < (toVC.view.bounds.size.height / 2)) { 47 | //第一象限 48 | finalPoint = CGPoint.init(x: button.center.x - 0, y: button.center.y - toVC.view.bounds.maxY + 30) 49 | 50 | }else{ 51 | //第四象限 52 | finalPoint = CGPoint.init(x: button.center.x - 0, y: button.center.y - 0) 53 | } 54 | }else{ 55 | if (btnRect.origin.y < (toVC.view.bounds.size.height / 2)) { 56 | //第二象限 57 | finalPoint = CGPoint.init(x: button.center.x - toVC.view.bounds.maxX, y: button.center.y - toVC.view.bounds.maxY+30) 58 | }else{ 59 | //第三象限 60 | finalPoint = CGPoint.init(x: button.center.x - toVC.view.bounds.maxX, y: button.center.y - 0) 61 | } 62 | } 63 | let radius:CGFloat = sqrt(finalPoint.x * finalPoint.x + finalPoint.y * finalPoint.y) 64 | 65 | let startPath:UIBezierPath = UIBezierPath.init(ovalIn:btnRect.insetBy(dx: -radius, dy: -radius) ) 66 | 67 | let maskLayer:CAShapeLayer = CAShapeLayer() 68 | 69 | maskLayer.path = finalPath.cgPath 70 | 71 | fromVC.view.layer.mask = maskLayer; 72 | 73 | let pushAnimation:CABasicAnimation = CABasicAnimation.init(keyPath: "path") 74 | 75 | pushAnimation.fromValue = startPath.cgPath 76 | 77 | pushAnimation.toValue = finalPath.cgPath 78 | 79 | pushAnimation.duration = self.transitionDuration(using: transitionContext) 80 | 81 | pushAnimation.timingFunction = CAMediaTimingFunction.init(name: kCAMediaTimingFunctionEaseInEaseOut) 82 | 83 | pushAnimation.delegate = self 84 | 85 | maskLayer.add(pushAnimation, forKey: "animation") 86 | 87 | } 88 | 89 | func animationDidStop(_ anim: CAAnimation, finished flag: Bool) { 90 | 91 | TransitionContext?.completeTransition(!(TransitionContext?.transitionWasCancelled)!) 92 | TransitionContext?.viewController(forKey: UITransitionContextViewControllerKey.from)?.view.layer.mask = nil 93 | TransitionContext?.viewController(forKey: UITransitionContextViewControllerKey.to)?.view.layer.mask = nil; 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /chat/views/ChatListViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChatListViewCell.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/8. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ChatListViewCell: UITableViewCell { 12 | 13 | 14 | private lazy var iconImage = UIImageView() 15 | 16 | private lazy var nameLabel = UILabel() 17 | 18 | private lazy var detailLabel = UILabel() 19 | 20 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) { 21 | super.init(style: style, reuseIdentifier: reuseIdentifier) 22 | 23 | prepareUI() 24 | 25 | } 26 | 27 | required init?(coder aDecoder: NSCoder) { 28 | fatalError("init(coder:) has not been implemented") 29 | } 30 | 31 | private func prepareUI() { 32 | 33 | addSubview(iconImage) 34 | 35 | addSubview(nameLabel) 36 | 37 | addSubview(detailLabel) 38 | 39 | layout() 40 | 41 | initSomething() 42 | } 43 | 44 | private func initSomething() { 45 | 46 | iconImage.backgroundColor = UIColor.orange 47 | iconImage.layer.cornerRadius = 5.0; 48 | iconImage.layer.masksToBounds = true; 49 | iconImage.image = UIImage.init(named: "1") 50 | 51 | 52 | nameLabel.font = UIFont.systemFont(ofSize: 17) 53 | nameLabel.text = "和路飞的聊天" 54 | nameLabel.textColor = UIColor.gray 55 | 56 | 57 | detailLabel.font = UIFont.systemFont(ofSize: 14) 58 | detailLabel.textColor = UIColor .lightGray 59 | detailLabel.text = "左划可以删除哦" 60 | 61 | } 62 | 63 | private func layout() { 64 | 65 | iconImage.translatesAutoresizingMaskIntoConstraints = false; 66 | addConstraint(NSLayoutConstraint(item: iconImage, attribute: NSLayoutAttribute.top, relatedBy: NSLayoutRelation.equal, toItem: self, attribute: NSLayoutAttribute.top, multiplier: 1.0, constant: 10)) 67 | addConstraint(NSLayoutConstraint(item: iconImage, attribute: NSLayoutAttribute.left, relatedBy: NSLayoutRelation.equal, toItem: self, attribute: NSLayoutAttribute.left, multiplier: 1.0, constant: 10)) 68 | addConstraint(NSLayoutConstraint(item: iconImage, attribute: NSLayoutAttribute.width, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.width, multiplier: 1.0, constant: 60)) 69 | addConstraint(NSLayoutConstraint(item: iconImage, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.height, multiplier: 1.0, constant: 60)) 70 | 71 | 72 | nameLabel.translatesAutoresizingMaskIntoConstraints = false; 73 | addConstraint(NSLayoutConstraint(item: nameLabel, attribute: NSLayoutAttribute.top, relatedBy: NSLayoutRelation.equal, toItem: self, attribute: NSLayoutAttribute.top, multiplier: 1.0, constant: 5)) 74 | addConstraint(NSLayoutConstraint(item: nameLabel, attribute: NSLayoutAttribute.left, relatedBy: NSLayoutRelation.equal, toItem: iconImage, attribute: NSLayoutAttribute.right, multiplier: 1.0, constant: 10)) 75 | addConstraint(NSLayoutConstraint(item: nameLabel, attribute: NSLayoutAttribute.width, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.width, multiplier: 1.0, constant: 200)) 76 | addConstraint(NSLayoutConstraint(item: nameLabel, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.height, multiplier: 1.0, constant: 30)) 77 | 78 | 79 | detailLabel.frame = CGRect.init(x: 75, y: 50, width: screenW - 60, height: 20) 80 | 81 | } 82 | } 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /category/UIView+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Extension.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/22. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIView { 12 | 13 | // x 14 | var x : CGFloat { 15 | 16 | get { 17 | 18 | return frame.origin.x 19 | } 20 | 21 | set(newVal) { 22 | 23 | var tmpFrame : CGRect = frame 24 | tmpFrame.origin.x = newVal 25 | frame = tmpFrame 26 | } 27 | } 28 | 29 | // y 30 | var y : CGFloat { 31 | 32 | get { 33 | 34 | return frame.origin.y 35 | } 36 | 37 | set(newVal) { 38 | 39 | var tmpFrame : CGRect = frame 40 | tmpFrame.origin.y = newVal 41 | frame = tmpFrame 42 | } 43 | } 44 | 45 | // height 46 | var height : CGFloat { 47 | 48 | get { 49 | 50 | return frame.size.height 51 | } 52 | 53 | set(newVal) { 54 | 55 | var tmpFrame : CGRect = frame 56 | tmpFrame.size.height = newVal 57 | frame = tmpFrame 58 | } 59 | } 60 | 61 | // width 62 | var width : CGFloat { 63 | 64 | get { 65 | 66 | return frame.size.width 67 | } 68 | 69 | set(newVal) { 70 | 71 | var tmpFrame : CGRect = frame 72 | tmpFrame.size.width = newVal 73 | frame = tmpFrame 74 | } 75 | } 76 | 77 | // left 78 | var left : CGFloat { 79 | 80 | get { 81 | 82 | return x 83 | } 84 | 85 | set(newVal) { 86 | 87 | x = newVal 88 | } 89 | } 90 | 91 | // right 92 | var right : CGFloat { 93 | 94 | get { 95 | 96 | return x + width 97 | } 98 | 99 | set(newVal) { 100 | 101 | x = newVal - width 102 | } 103 | } 104 | 105 | // top 106 | var top : CGFloat { 107 | 108 | get { 109 | 110 | return y 111 | } 112 | 113 | set(newVal) { 114 | 115 | y = newVal 116 | } 117 | } 118 | 119 | // bottom 120 | var bottom : CGFloat { 121 | 122 | get { 123 | 124 | return y + height 125 | } 126 | 127 | set(newVal) { 128 | 129 | y = newVal - height 130 | } 131 | } 132 | 133 | var centerX : CGFloat { 134 | 135 | get { 136 | 137 | return center.x 138 | } 139 | 140 | set(newVal) { 141 | 142 | center = CGPoint(x: newVal, y: center.y) 143 | } 144 | } 145 | 146 | var centerY : CGFloat { 147 | 148 | get { 149 | 150 | return center.y 151 | } 152 | 153 | set(newVal) { 154 | 155 | center = CGPoint(x: center.x, y: newVal) 156 | } 157 | } 158 | 159 | var middleX : CGFloat { 160 | 161 | get { 162 | 163 | return width / 2 164 | } 165 | } 166 | 167 | var middleY : CGFloat { 168 | 169 | get { 170 | 171 | return height / 2 172 | } 173 | } 174 | 175 | var middlePoint : CGPoint { 176 | 177 | get { 178 | 179 | return CGPoint(x: middleX, y: middleY) 180 | } 181 | } 182 | 183 | } 184 | -------------------------------------------------------------------------------- /chat/views/LiuqsChatMessageCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LiuqsChatMessageCell.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/23. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class LiuqsChatMessageCell: UITableViewCell { 12 | 13 | private var iconImageView:UIButton = UIButton() 14 | 15 | private var nameLabel:UILabel = UILabel() 16 | 17 | private var messageLabel:UIButton = UIButton() 18 | 19 | private var gifimageView = UIImageView() 20 | 21 | static func cellWithTableView(tableView:UITableView) ->LiuqsChatMessageCell { 22 | 23 | let ID:String = "LiuqsChatMessageCell" 24 | 25 | let cell:LiuqsChatMessageCell = tableView.dequeueReusableCell(withIdentifier: ID) as! LiuqsChatMessageCell 26 | 27 | return cell 28 | 29 | } 30 | 31 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) { 32 | super.init(style: style, reuseIdentifier: reuseIdentifier) 33 | 34 | prepareUI() 35 | } 36 | 37 | required init?(coder aDecoder: NSCoder) { 38 | fatalError("init(coder:) has not been implemented") 39 | } 40 | 41 | func prepareUI() { 42 | 43 | self.backgroundColor = BACKGROUND_Color 44 | 45 | //头像 46 | iconImageView.layer.cornerRadius = 5 47 | iconImageView.layer.masksToBounds = true 48 | contentView.addSubview(iconImageView) 49 | 50 | //消息 51 | messageLabel.titleLabel?.numberOfLines = 0 52 | contentView.addSubview(messageLabel) 53 | 54 | contentView.addSubview(gifimageView) 55 | 56 | //名字 57 | nameLabel.font = UIFont.systemFont(ofSize: 16) 58 | nameLabel.textColor = UIColor.orange 59 | contentView.addSubview(nameLabel) 60 | 61 | } 62 | 63 | var chatCellFrame:LiuqsChatCellFrame? { 64 | 65 | didSet { 66 | 67 | let type:Bool = chatCellFrame?.message?.currentUserType == userType.me 68 | 69 | //头像 70 | let iconName:String = chatCellFrame?.message?.currentUserType == userType.me ? "1" : "2" 71 | iconImageView.setImage(UIImage.init(named: iconName), for: UIControlState.normal) 72 | iconImageView.frame = (chatCellFrame?.iconFrame)! 73 | //名字 74 | nameLabel.text = chatCellFrame?.message?.userName 75 | nameLabel.frame = (chatCellFrame?.nameFrame)! 76 | nameLabel.textAlignment = type ? NSTextAlignment.left : NSTextAlignment.right 77 | 78 | if chatCellFrame?.message?.messageType == 0 { 79 | 80 | //消息内容 81 | messageLabel.setAttributedTitle(chatCellFrame?.message?.attMessage, for: UIControlState.normal) 82 | messageLabel.frame = (chatCellFrame?.textFrame)! 83 | let messageImageName:String = type ? "chat_receive_nor" : "chat_send_nor" 84 | let messageImageNameP:String = type ? "chat_receive_p" : "chat_send_p" 85 | messageLabel.setBackgroundImage(UIImage.resizebleImage(imageName: messageImageName), for: UIControlState.normal) 86 | messageLabel.setBackgroundImage(UIImage.resizebleImage(imageName: messageImageNameP), for: UIControlState.highlighted) 87 | messageLabel.titleEdgeInsets = type ? UIEdgeInsetsMake(7, 13, 5, 5) : UIEdgeInsetsMake(5, 7, 5, 13) 88 | gifimageView.frame = CGRect() 89 | 90 | }else if chatCellFrame?.message?.messageType == 1 { 91 | 92 | let path:String = Bundle.main.path(forResource: chatCellFrame?.message?.gifName, ofType: "gif")! 93 | 94 | let data = NSData.init(contentsOf: NSURL.init(fileURLWithPath: path) as URL) 95 | 96 | let animationImage = UIImage.animationImageWithData(data: data); 97 | 98 | gifimageView.image = animationImage; 99 | 100 | gifimageView.frame = (chatCellFrame?.imageViewFrame)! 101 | 102 | messageLabel.frame = CGRect() 103 | } 104 | 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /category/UIImage+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Extension.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/16. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import ImageIO 11 | 12 | extension UIImage { 13 | 14 | ///用颜色创建一张图片 15 | static func createImageWithColor(color:UIColor) -> UIImage { 16 | 17 | let rect:CGRect = CGRect.init(x: 0.0, y: 0.0, width: 1.0, height: 1.0) 18 | 19 | UIGraphicsBeginImageContext(rect.size) 20 | 21 | let context:CGContext = UIGraphicsGetCurrentContext()! 22 | 23 | context.setFillColor(color.cgColor) 24 | 25 | context.fill(rect) 26 | 27 | let image:UIImage = UIGraphicsGetImageFromCurrentImageContext()! 28 | 29 | UIGraphicsEndImageContext() 30 | 31 | return image 32 | } 33 | //拉伸一张图片 34 | static func resizebleImage(imageName:String) -> UIImage { 35 | 36 | var imageNor = UIImage.init(named: imageName) 37 | 38 | let w = imageNor?.size.width 39 | 40 | let h = imageNor?.size.height 41 | 42 | imageNor = imageNor?.resizableImage(withCapInsets: UIEdgeInsetsMake(w! * 0.5, h! * 0.5, w! * 0.5, h! * 0.5), resizingMode: UIImageResizingMode.stretch) 43 | 44 | return imageNor! 45 | } 46 | 47 | //gif图片解析 48 | static func animationImageWithData(data:NSData?) -> UIImage { 49 | 50 | if data != nil { 51 | 52 | let source:CGImageSource = CGImageSourceCreateWithData(data as! CFData, nil)! 53 | 54 | let count:size_t = CGImageSourceGetCount(source) 55 | 56 | var animatedImage:UIImage? 57 | 58 | if count <= 1 { 59 | 60 | animatedImage = UIImage.init(data: data as! Data) 61 | 62 | }else { 63 | 64 | var images = [UIImage]() 65 | 66 | var duration:TimeInterval = 0.0; 67 | 68 | for i:size_t in size_t(0.0) ..< count { 69 | 70 | let image:CGImage? = CGImageSourceCreateImageAtIndex(source, i, nil)! 71 | 72 | if image == nil { 73 | 74 | continue 75 | } 76 | duration = TimeInterval(frameDuration(index: i, source: source)) + duration; 77 | 78 | images.append(UIImage.init(cgImage: image!)) 79 | } 80 | if (duration == 0.0) { 81 | 82 | duration = Double(1.0 / 10.0) * Double(count); 83 | } 84 | animatedImage = UIImage.animatedImage(with: images, duration: 2.0); 85 | } 86 | 87 | return animatedImage! 88 | }else { 89 | 90 | return UIImage() 91 | } 92 | 93 | } 94 | 95 | static func frameDuration(index:Int,source:CGImageSource) -> Float { 96 | 97 | 98 | var frameDuration:Float = 0.1; 99 | 100 | let cfFrameProperties:CFDictionary = CGImageSourceCopyPropertiesAtIndex(source, index, nil)! 101 | 102 | let frameProperties:NSDictionary = cfFrameProperties as CFDictionary 103 | 104 | let gifProperties:NSDictionary = frameProperties.object(forKey: kCGImagePropertyGIFDictionary as NSString) as! NSDictionary 105 | 106 | let delayTimeUnclampedProp:NSNumber? = gifProperties.object(forKey: kCGImagePropertyGIFUnclampedDelayTime as NSString) as? NSNumber 107 | 108 | if delayTimeUnclampedProp != nil { 109 | 110 | frameDuration = (delayTimeUnclampedProp?.floatValue)! 111 | }else { 112 | 113 | let delayTimeProp:NSNumber? = gifProperties.object(forKey: kCGImagePropertyGIFDelayTime as NSString) as? NSNumber 114 | 115 | if delayTimeProp != nil { 116 | 117 | frameDuration = (delayTimeProp?.floatValue)! 118 | } 119 | 120 | if frameDuration < 0.011{ 121 | 122 | frameDuration = 0.100; 123 | } 124 | } 125 | return frameDuration 126 | } 127 | } 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift.xcodeproj/xcuserdata/Liuqs.xcuserdatad/xcschemes/LiuqsChatEmotionSwift.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /LiuqsChatEmotionSwift/tabBarController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // tabBarController.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/8. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol LiuqsTabBarDelegate { 12 | 13 | func composeBtnClicked() 14 | } 15 | 16 | class tabBarController: UITabBarController,UITabBarControllerDelegate, UIViewControllerTransitioningDelegate { 17 | 18 | var composeRect:CGRect = CGRect() 19 | 20 | var Delegate:LiuqsTabBarDelegate? 21 | 22 | override func viewWillAppear(_ animated: Bool) { 23 | 24 | super.viewWillAppear(true) 25 | 26 | self.transitioningDelegate = self 27 | } 28 | 29 | override func viewDidLoad() { 30 | 31 | super.viewDidLoad() 32 | 33 | addChildViewControllers() 34 | 35 | addcomposedBtn() 36 | 37 | configureNav() 38 | 39 | } 40 | 41 | func configureNav() { 42 | 43 | self.navigationItem.title = "聊天" 44 | 45 | self.automaticallyAdjustsScrollViewInsets = false 46 | } 47 | 48 | /// 中间按钮的点击事件 49 | func clickcomposedBtn() { 50 | 51 | let addVC = AddViewController() 52 | 53 | addVC.transitioningDelegate = self 54 | 55 | self.present(addVC, animated: true, completion: {}) 56 | 57 | } 58 | 59 | /// 添加中间按钮 60 | private func addcomposedBtn() { 61 | 62 | let composedBtnW = tabBar.bounds.width / CGFloat(viewControllers!.count) 63 | 64 | composedBtn.frame = CGRect(x:2 * composedBtnW, y: 0, width:composedBtnW , height: tabBar.bounds.height) 65 | 66 | composeRect = CGRect.init(x: composedBtn.frame.origin.x, y: composedBtn.frame.origin.y + screenH - 44, width: composedBtn.frame.size.height, height: composedBtn.frame.size.height) 67 | 68 | self.tabBar.addSubview(composedBtn) 69 | } 70 | 71 | /// 批量添加子控制器 72 | private func addChildViewControllers() { 73 | 74 | addChildViewController(ChatViewController(), title: "聊天", itemIcon: "tabbar_message_center") 75 | 76 | addChildViewController(HomeTableViewController(), title: "首页", itemIcon: "tabbar_home") 77 | 78 | addChildViewController(UIViewController(), title: "compose", itemIcon: "4") 79 | 80 | addChildViewController(DiscoverTableViewController(), title: "发现", itemIcon: "tabbar_discover") 81 | 82 | addChildViewController(PersonalViewController(), title: "我", itemIcon: "tabbar_profile") 83 | } 84 | 85 | 86 | 87 | /// 添加视图控制; 88 | private func addChildViewController(_ vc:UIViewController,title:String,itemIcon:String) { 89 | 90 | 91 | vc.title = title //== vc.navigationItem.title = title vc.tabBarItem.title = title 92 | 93 | vc.tabBarItem.image = UIImage(named: itemIcon) 94 | 95 | if title == "compose" {vc.tabBarItem.isEnabled = false; vc.title = ""} 96 | 97 | let dic = [NSForegroundColorAttributeName:UIColor.white] 98 | 99 | let nav = UINavigationController(rootViewController: vc) 100 | 101 | nav.navigationBar.barStyle = UIBarStyle.black 102 | 103 | nav.navigationBar.titleTextAttributes = dic 104 | 105 | addChildViewController(nav) 106 | 107 | } 108 | 109 | /// 懒加载中间按钮 110 | lazy private var composedBtn:UIButton = { 111 | 112 | let composedBtn = UIButton() 113 | 114 | composedBtn.setImage(UIImage(named: "tabbar_compose_icon_add"), for: UIControlState()) 115 | composedBtn.setImage(UIImage(named: "tabbar_compose_icon_add_highlighted"), for: UIControlState.highlighted) 116 | 117 | composedBtn.setBackgroundImage(UIImage(named: "tabbar_compose_button"), for: UIControlState()) 118 | composedBtn.setBackgroundImage(UIImage(named: "tabbar_compose_button_highlighted"), for: UIControlState.highlighted) 119 | 120 | composedBtn.addTarget(self, action: #selector(self.clickcomposedBtn), for: UIControlEvents.touchUpInside) 121 | 122 | return composedBtn 123 | }() 124 | 125 | func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { 126 | 127 | let pushTran:LiuqsPushTransition = LiuqsPushTransition() 128 | 129 | pushTran.btnRect = CGRect.init(x: (screenW - 44) * 0.5, y: screenH - 44, width: 44, height: 44) 130 | 131 | return pushTran 132 | } 133 | 134 | func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { 135 | 136 | let pushTran:LiuqsPopTransition = LiuqsPopTransition() 137 | 138 | pushTran.btnRect = CGRect.init(x: (screenW - 44) * 0.5, y: screenH - 44, width: 44, height: 44) 139 | 140 | return pushTran 141 | 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /LiuqsEmotions/LiuqsChageEmotionStrTool.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LiuqsChageEmotionStrTool.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/29. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class LiuqsChageEmotionStrTool: NSObject { 12 | 13 | static private let checkStr = "\\[[a-zA-Z0-9\\u4e00-\\u9fa5]+\\]" 14 | 15 | static private var _emotionSize = CGSize() 16 | 17 | static private var _font = UIFont() 18 | 19 | static private var _textColor = UIColor() 20 | 21 | static private var _matches = NSArray() 22 | 23 | static private var _string = String() 24 | 25 | static private var _emojiImages = NSDictionary() 26 | 27 | static private var _imageDataArray = NSMutableArray() 28 | 29 | static private var _attStr = NSMutableAttributedString() 30 | 31 | static private var _resultStr = NSMutableAttributedString() 32 | 33 | 34 | static func changeStr(string:String, font:UIFont, textColor:UIColor) -> NSMutableAttributedString { 35 | 36 | _font = font 37 | 38 | _string = string 39 | 40 | _textColor = textColor 41 | //初始化 42 | initProperty() 43 | //获取匹对结果 44 | executeMatch() 45 | //遍历查询结果并保存 46 | setImageDataArray() 47 | //执行替换过程 48 | setResultStrUseReplace() 49 | //返回结果 50 | return _resultStr; 51 | } 52 | 53 | static func initProperty() { 54 | 55 | //读取对照表 56 | let path:String = Bundle.main.path(forResource: "LiuqsEmoji", ofType: "plist")! 57 | 58 | _emojiImages = NSDictionary.init(contentsOfFile: path)! 59 | //设置字体属性 60 | let paragraphStyle:NSMutableParagraphStyle = NSMutableParagraphStyle(); 61 | 62 | let attstrDic = [NSForegroundColorAttributeName:_textColor,NSFontAttributeName:_font,NSParagraphStyleAttributeName:paragraphStyle] as [String : Any] 63 | 64 | let maxsize:CGSize = CGSize.init(width: screenW, height: screenH) 65 | 66 | let str:String = "/" 67 | //根据字体获取单个表情的大小 68 | let emojiRect:CGRect = str.boundingRect(with: maxsize, options: NSStringDrawingOptions.usesLineFragmentOrigin, attributes: attstrDic, context: nil) 69 | 70 | _emotionSize = emojiRect.size 71 | 72 | _attStr = NSMutableAttributedString.init(string: _string, attributes:attstrDic) 73 | } 74 | 75 | static func executeMatch() { 76 | 77 | var regex:NSRegularExpression = NSRegularExpression(); 78 | 79 | do { regex = try NSRegularExpression.init(pattern: checkStr, options: .caseInsensitive)} catch{} 80 | 81 | let totalRange:NSRange = NSRange.init(location: 0, length: _string.characters.count) 82 | 83 | _matches = regex.matches(in: _string, options: [], range: totalRange) as NSArray 84 | 85 | } 86 | 87 | static func setImageDataArray() { 88 | 89 | let imageDataArray:NSMutableArray = NSMutableArray() 90 | 91 | for i:Int in 0..<_matches.count { 92 | 93 | let record:NSMutableDictionary = NSMutableDictionary() 94 | 95 | let attachMent:LiuqsTextAttachment = LiuqsTextAttachment() 96 | 97 | attachMent.emojiSize = CGSize.init(width: _emotionSize.height, height: _emotionSize.height) 98 | 99 | let match:NSTextCheckingResult = _matches.object(at: i) as! NSTextCheckingResult 100 | 101 | let matchRange:NSRange = match.range 102 | 103 | let str:NSString = _string as NSString 104 | 105 | let tagString:String = String(str.substring(with: matchRange)) 106 | 107 | let imageName:String? = _emojiImages.object(forKey: tagString) as? String 108 | 109 | if (imageName == nil) {continue}; 110 | 111 | let image:UIImage = UIImage.init(named: imageName!)! 112 | 113 | attachMent.image = image 114 | 115 | let imageStr:NSAttributedString = NSAttributedString.init(attachment: attachMent) 116 | 117 | record.setObject(NSValue.init(range: matchRange), forKey: "range" as NSCopying) 118 | 119 | record.setObject(imageStr, forKey: "image" as NSCopying) 120 | 121 | imageDataArray.add(record) 122 | 123 | } 124 | _imageDataArray = imageDataArray 125 | } 126 | 127 | //这里必须倒着替换,不然会崩溃 128 | static func setResultStrUseReplace() { 129 | 130 | let result:NSMutableAttributedString = _attStr 131 | 132 | for i:Int in 0..<_imageDataArray.count { 133 | 134 | let imageDic:NSDictionary = _imageDataArray.object(at: _imageDataArray.count - i - 1) as! NSDictionary 135 | 136 | let range:NSRange = imageDic.object(forKey: "range") as! NSRange 137 | 138 | let imageStr:NSMutableAttributedString = imageDic.object(forKey: "image") as! NSMutableAttributedString 139 | 140 | print(range.location,range.length,result.length) 141 | 142 | result.replaceCharacters(in: range, with: imageStr) 143 | } 144 | _resultStr = result; 145 | } 146 | 147 | } 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /chat/controllers/ChatDetailViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChatDetailViewController.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/8. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ChatDetailViewController: UIViewController ,LiuqsToolBarDelegate ,UITextViewDelegate ,UITableViewDelegate,UITableViewDataSource, LiuqsEmotionKeyBoardDelegate, UIGestureRecognizerDelegate, UINavigationControllerDelegate{ 12 | 13 | var toolBarView:LiuqsToolBarView = LiuqsToolBarView.init(frame: CGRect()) 14 | 15 | var keyBoardH:CGFloat = CGFloat() 16 | 17 | var dataSource:NSMutableArray = NSMutableArray() 18 | 19 | var tableView:UITableView = UITableView() 20 | 21 | lazy private var emotionview:LiuqsEmotionKeyBoard = { 22 | 23 | let emotionview = LiuqsEmotionKeyBoard.init(frame: CGRect.init(x: 0, y: screenH, width: screenW, height: EMOJI_KEYBOARD_HEIGHT)) 24 | 25 | emotionview.delegate = self 26 | 27 | return emotionview 28 | }() 29 | 30 | 31 | override func viewWillAppear(_ animated: Bool) { 32 | 33 | super.viewWillAppear(true) 34 | 35 | self.navigationController?.delegate = self 36 | 37 | ScrollTableViewToBottom() 38 | 39 | } 40 | 41 | override func viewDidAppear(_ animated: Bool) { 42 | 43 | self.view.addSubview(self.emotionview) 44 | 45 | self.emotionview.KeyTextView = self.toolBarView.textView; 46 | 47 | } 48 | 49 | override func viewDidLoad() { 50 | super.viewDidLoad() 51 | 52 | createExampleData() 53 | 54 | initSomething() 55 | 56 | addObsevers() 57 | 58 | creatToolBarView() 59 | 60 | initChatTableView() 61 | } 62 | 63 | func createExampleData() { 64 | 65 | for i: Int in 0...3 { 66 | 67 | let chatCellFrame:LiuqsChatCellFrame = LiuqsChatCellFrame() 68 | 69 | let message:LiuqsChatMessage = LiuqsChatMessage() 70 | 71 | var messageText = String() 72 | 73 | if i == 0 { 74 | 75 | message.currentUserType = userType.other 76 | message.userName = "鸣人" 77 | message.messageType = 0 78 | messageText = "在村里,Lz辈分比较大,在我还是小屁孩的时候就有大人喊我叔了,这不算糗[委屈]。 成年之后,鼓起勇气向村花二丫深情表白了(当然是没有血缘关系的)[害羞],结果她一脸淡定的回绝了:“二叔!别闹……”[尴尬]" 79 | }else if i == 2 { 80 | 81 | message.currentUserType = userType.me 82 | message.userName = "路飞" 83 | message.messageType = 0; 84 | messageText = "小学六年级书法课后不知是哪个用红纸写了张六畜兴旺贴教室门上,上课语文老师看看门走了,过了一会才来,过了几天去办公室交作业听见语文老师说:看见那几个字我本来是不想进去的,但是后来一想养猪的也得进去喂猪" 85 | }else if i == 1 { 86 | 87 | message.currentUserType = userType.other 88 | message.userName = "鸣人" 89 | message.messageType = 1 90 | message.gifName = "2_4" 91 | }else if i == 3 { 92 | 93 | message.currentUserType = userType.me 94 | message.userName = "路飞" 95 | message.messageType = 1 96 | message.gifName = "2_8" 97 | } 98 | 99 | message.message = messageText 100 | 101 | chatCellFrame.message = message 102 | 103 | dataSource.add(chatCellFrame) 104 | } 105 | } 106 | 107 | // 初始化一些数据 108 | func initSomething() { 109 | 110 | self.view.backgroundColor = BACKGROUND_Color 111 | 112 | self.automaticallyAdjustsScrollViewInsets = false 113 | 114 | self.title = "路飞" 115 | } 116 | 117 | //创建tabbleView 118 | func initChatTableView() { 119 | 120 | tableView = UITableView.init(frame: CGRect.init(x: 0, y: 64, width: screenW, height: screenH - toobarH - 64)) 121 | 122 | tableView.backgroundColor = BACKGROUND_Color 123 | 124 | tableView.showsVerticalScrollIndicator = false 125 | 126 | tableView.separatorStyle = UITableViewCellSeparatorStyle.none 127 | 128 | tableView.dataSource = self 129 | 130 | tableView.delegate = self 131 | 132 | tableView.register(LiuqsChatMessageCell.self, forCellReuseIdentifier: "LiuqsChatMessageCell") 133 | 134 | self.view.addSubview(tableView) 135 | 136 | //单击手势,用于退出键盘 137 | let tap:UITapGestureRecognizer = UITapGestureRecognizer.init(target: self, action: #selector(tapTable)) 138 | 139 | tap.delegate = self 140 | 141 | tableView.addGestureRecognizer(tap) 142 | } 143 | 144 | //手势事件 145 | func tapTable() { 146 | 147 | if toolBarView.textView.isFirstResponder { 148 | 149 | toolBarView.textView.resignFirstResponder() 150 | } 151 | 152 | toolBarView.toolBarEmotionBtn.isSelected = false 153 | 154 | if toolBarView.textView.text.characters.count == 0 { 155 | 156 | UIView.animate(withDuration: emotionTipTime, animations: { 157 | 158 | self.emotionview.frame = emotionDownFrame 159 | 160 | self.toolBarView.frame = toolBarFrameDown 161 | 162 | self.resetChatList() 163 | }) 164 | 165 | }else { 166 | 167 | UIView.animate(withDuration: emotionTipTime, animations: { 168 | 169 | self.emotionview.frame = emotionDownFrame 170 | 171 | self.toolBarView.frame = CGRect.init(x: 0, y: screenH - self.toolBarView.frame.size.height, width: screenW, height: self.toolBarView.frame.size.height) 172 | 173 | self.resetChatList() 174 | }) 175 | } 176 | } 177 | 178 | //注册监听 179 | func addObsevers() { 180 | 181 | NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(noti:)), name: NSNotification.Name.UIKeyboardWillHide, object: nil) 182 | 183 | NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(noti:)), name: NSNotification.Name.UIKeyboardWillShow, object: nil) 184 | } 185 | 186 | //键盘出现 187 | func keyboardWillShow(noti:NSNotification) { 188 | 189 | let userInfo:NSDictionary = noti.userInfo! as NSDictionary 190 | 191 | let begin:CGRect = (((userInfo.object(forKey: UIKeyboardFrameBeginUserInfoKey)) as? NSValue)?.cgRectValue)! 192 | 193 | let keyBoardFrame:CGRect = (((userInfo.object(forKey: UIKeyboardFrameEndUserInfoKey)) as? NSValue)?.cgRectValue)! 194 | 195 | //处理三方键盘走多次 196 | if begin.size.height > 0 && begin.origin.y - keyBoardFrame.origin.y > 0 { 197 | 198 | HandleKeyBoardShow(keyBoardFrame: keyBoardFrame) 199 | 200 | self.keyBoardH = keyBoardFrame.size.height; 201 | } 202 | } 203 | 204 | //键盘隐藏的通知事件 205 | func keyboardWillHide(noti:NSNotification) { 206 | 207 | self.keyBoardH = 0; 208 | 209 | HandleKeyBoardHide() 210 | } 211 | 212 | 213 | //处理键盘弹出 214 | func HandleKeyBoardShow(keyBoardFrame:CGRect) { 215 | 216 | //键盘弹出 217 | UIView.animate(withDuration: emotionTipTime, animations: { 218 | 219 | self.toolBarView.toolBarEmotionBtn.isSelected = false 220 | 221 | self.toolBarView.frame = CGRect.init(x: 0, y: screenH - self.toolBarView.height - keyBoardFrame.size.height , width: screenW, height: self.toolBarView.height) 222 | 223 | self.resetChatList() 224 | 225 | }) { (Bool) in 226 | 227 | self.emotionview.frame = emotionUpFrame 228 | } 229 | } 230 | 231 | //处理键盘收起 232 | func HandleKeyBoardHide() { 233 | 234 | //键盘收起 235 | self.toolBarView.toolBarEmotionBtn.isSelected = true 236 | 237 | UIView.animate(withDuration: emotionTipTime, animations: { 238 | 239 | self.toolBarView.frame = CGRect.init(x: 0, y: screenH - self.toolBarView.height - self.emotionview.height, width: screenW, height: self.toolBarView.height) 240 | 241 | self.resetChatList() 242 | }) 243 | } 244 | 245 | //创建工具条 246 | func creatToolBarView() { 247 | 248 | toolBarView.delegate = self 249 | 250 | toolBarView.textView.delegate = self 251 | 252 | self.view.addSubview(toolBarView) 253 | } 254 | 255 | //tableview 256 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 257 | 258 | return dataSource.count 259 | } 260 | 261 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 262 | 263 | let cell = LiuqsChatMessageCell.cellWithTableView(tableView: tableView) 264 | 265 | cell.selectionStyle = UITableViewCellSelectionStyle.none 266 | 267 | let chatCellFrame:LiuqsChatCellFrame = dataSource.object(at: indexPath.row) as! LiuqsChatCellFrame 268 | 269 | cell.chatCellFrame = chatCellFrame 270 | 271 | return cell 272 | } 273 | 274 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 275 | 276 | tableView.deselectRow(at: indexPath, animated: true) 277 | 278 | self.navigationController?.pushViewController(ChatDetailViewController(), animated: true) 279 | } 280 | 281 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 282 | 283 | let chatCellFrame:LiuqsChatCellFrame = dataSource.object(at: indexPath.row) as! LiuqsChatCellFrame 284 | 285 | return chatCellFrame.cellHeight; 286 | } 287 | 288 | func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { 289 | 290 | tapTable() 291 | } 292 | 293 | //toolBar代理 294 | func ToolbarEmotionBtnDidClicked(emotionBtn: UIButton) { 295 | 296 | if emotionBtn.isSelected { 297 | 298 | emotionBtn.isSelected = false; 299 | 300 | toolBarView.textView.becomeFirstResponder() 301 | 302 | }else { 303 | 304 | toolBarView.textView.resignFirstResponder() 305 | 306 | emotionBtn.isSelected = true 307 | 308 | UIView.animate(withDuration: emotionTipTime, animations: { 309 | 310 | self.emotionview.frame = emotionUpFrame 311 | 312 | self.toolBarView.frame = CGRect.init(x: 0, y: screenH - self.toolBarView.height - self.emotionview.height, width: screenW, height: self.toolBarView.height) 313 | print(self.toolBarView.frame.origin.y) 314 | self.resetChatList() 315 | }) 316 | } 317 | } 318 | 319 | //重设tabbleview的frame并根据是否在底部来执行滚动到底部的动画(不在底部就不执行,在底部才执行) 320 | func resetChatList() { 321 | 322 | let offSetY:CGFloat = tableView.contentSize.height - tableView.height; 323 | //判断是否滚动到底部,会有一个误差值 324 | if tableView.contentOffset.y > offSetY - 5 || tableView.contentOffset.y > offSetY + 5 { 325 | 326 | self.tableView.frame = CGRect.init(x: 0, y: self.tableView.y, width: screenW, height: self.toolBarView.y - 64) 327 | 328 | ScrollTableViewToBottom() 329 | 330 | }else { 331 | 332 | self.tableView.frame = CGRect.init(x: 0, y: self.tableView.y, width: screenW, height: self.toolBarView.y - 64) 333 | } 334 | } 335 | 336 | //滚动到底部 337 | func ScrollTableViewToBottom() { 338 | 339 | let indexPath:NSIndexPath = NSIndexPath.init(row: self.dataSource.count - 1, section: 0) 340 | 341 | self.tableView.scrollToRow(at: indexPath as IndexPath, at: UITableViewScrollPosition.bottom, animated: false) 342 | } 343 | 344 | //textView代理事件 345 | func textViewDidChange(_ textView: UITextView) { 346 | 347 | if (self.toolBarView.textView.contentSize.height <= TextViewH) { 348 | 349 | self.toolBarView.textView.height = TextViewH; 350 | 351 | }else if (self.toolBarView.textView.contentSize.height >= 90) { 352 | 353 | self.toolBarView.textView.height = 90; 354 | 355 | }else { 356 | 357 | self.toolBarView.textView.height = self.toolBarView.textView.contentSize.height; 358 | } 359 | 360 | self.toolBarView.height = screenW * 10 / 320 + self.toolBarView.textView.height; 361 | 362 | if (self.keyBoardH < self.emotionview.height) { 363 | 364 | self.toolBarView.y = screenH - self.toolBarView.height - self.emotionview.height; 365 | 366 | }else { 367 | 368 | self.toolBarView.y = screenH - self.toolBarView.height - self.keyBoardH; 369 | } 370 | if (textView.text.characters.count > 0) { 371 | 372 | self.emotionview.sendBtn.isSelected = true; 373 | 374 | }else { 375 | 376 | self.emotionview.sendBtn.isSelected = false; 377 | } 378 | 379 | self.tableView.height = self.toolBarView.y - 64 380 | } 381 | 382 | func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { 383 | 384 | if text == "\n" { 385 | 386 | sendMessage() 387 | 388 | return false 389 | } 390 | 391 | return true; 392 | } 393 | 394 | //keyBoard代理 395 | func emotionView_sBtnDidClick(btn:UIButton) { 396 | 397 | textViewDidChange(toolBarView.textView) 398 | 399 | if btn.tag == 44 {//发送按钮 400 | 401 | sendMessage() 402 | } 403 | } 404 | 405 | func gifBtnClick(btn:UIButton) { 406 | 407 | print("动态按钮\(btn.tag)"); 408 | 409 | let gifName = "2_\(btn.tag)" 410 | 411 | sendGifmessage(gifname: gifName) 412 | } 413 | 414 | func sendGifmessage(gifname:String){ 415 | 416 | let cellFrame = LiuqsChatCellFrame() 417 | 418 | let message = LiuqsChatMessage() 419 | 420 | message.messageType = 1 421 | 422 | message.message = "" 423 | 424 | message.userName = "鸣人" 425 | 426 | message.gifName = gifname 427 | 428 | message.currentUserType = userType.other 429 | 430 | cellFrame.message = message 431 | 432 | dataSource.add(cellFrame) 433 | 434 | refreshChatList() 435 | } 436 | 437 | //发送消息 438 | func sendMessage() { 439 | 440 | var messageText = String() 441 | 442 | if toolBarView.textView.textStorage.length != 0 { 443 | 444 | messageText = toolBarView.textView.textStorage.getPlainString() 445 | }else { 446 | 447 | messageText = "[憨笑]彩笔,怎么可以输入空格呢?[得意]" 448 | } 449 | 450 | createDataSource(text: messageText) 451 | 452 | refreshChatList() 453 | 454 | } 455 | 456 | //创建一条数据 457 | func createDataSource(text:String) { 458 | 459 | let cellFrame = LiuqsChatCellFrame() 460 | 461 | let message = LiuqsChatMessage() 462 | 463 | message.message = text 464 | 465 | message.messageType = 0 466 | 467 | message.userName = "鸣人" 468 | 469 | message.currentUserType = userType.other 470 | 471 | cellFrame.message = message 472 | 473 | dataSource.add(cellFrame) 474 | 475 | } 476 | 477 | //刷新UI 478 | func refreshChatList() { 479 | 480 | toolBarView.textView.text = "" 481 | 482 | textViewDidChange(toolBarView.textView) 483 | 484 | let indexPath:NSIndexPath = NSIndexPath.init(row: dataSource.count - 1, section: 0) 485 | 486 | tableView.insertRows(at: [indexPath as IndexPath], with: UITableViewRowAnimation.none) 487 | 488 | self.tableView.scrollToRow(at: indexPath as IndexPath, at: UITableViewScrollPosition.bottom, animated: true) 489 | } 490 | 491 | } 492 | 493 | 494 | 495 | 496 | 497 | 498 | -------------------------------------------------------------------------------- /LiuqsEmotions/LiuqsEmotionKeyBoard.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LiuqsEmotionKeyBoard.swift 3 | // LiuqsChatEmotionSwift 4 | // 5 | // Created by 刘全水 on 16/8/15. 6 | // Copyright © 2016年 刘全水. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public protocol LiuqsEmotionKeyBoardDelegate { 12 | 13 | func emotionView_sBtnDidClick(btn:UIButton) 14 | 15 | func gifBtnClick(btn:UIButton) 16 | } 17 | 18 | class LiuqsEmotionKeyBoard: UIImageView ,UIScrollViewDelegate { 19 | 20 | //公有属性 21 | var sendBtn:UIButton = UIButton() 22 | 23 | var emojiBtn:UIButton = UIButton() 24 | 25 | var delegate:LiuqsEmotionKeyBoardDelegate? 26 | 27 | //私有固定常量 28 | private let rows:Int = 3 29 | 30 | private let pages:Int = 7 31 | 32 | private let rowCount:Int = 7 33 | 34 | private let gifCount:Int = 18 35 | 36 | private let emojicount:Int = 21 37 | 38 | private let gifRowCount:Int = 4 39 | 40 | private let emotionBtnsCount:Int = 2 41 | 42 | private let gifW:CGFloat = screenW * 0.15625 43 | 44 | private let gifH:CGFloat = screenW * 0.22 45 | 46 | private let emotionW:CGFloat = screenW * 0.0875 47 | 48 | //对照表 49 | private var _emotionGifTitle:NSDictionary = NSDictionary() 50 | 51 | private var _emojiStaticImages:NSDictionary = NSDictionary() 52 | 53 | private var _emojiTags:NSArray = NSArray() 54 | 55 | 56 | //私有属性和控件 57 | private var font:UIFont = UIFont() 58 | 59 | private var gap: CGFloat = 0.0 60 | 61 | private var EMOJI_MAX_SIZE:CGFloat = 0.0 62 | 63 | private var btnsBar:UIButton = UIButton() 64 | 65 | private var springBtn:UIButton = UIButton() 66 | 67 | private var emotionBtn:UIButton = UIButton() 68 | 69 | private var pageView:UIScrollView = UIScrollView() 70 | 71 | private var scrollBtnsView:UIScrollView = UIScrollView() 72 | 73 | private var pageControl: UIPageControl = UIPageControl() 74 | 75 | private var emotonViewPageOne: UIImageView = UIImageView() 76 | 77 | private var emotonViewPageTwo: UIImageView = UIImageView() 78 | 79 | private var emotonViewPageThree: UIImageView = UIImageView() 80 | 81 | private var emotonViewPageFour: UIImageView = UIImageView() 82 | 83 | private var emotonViewPageFive: UIImageView = UIImageView() 84 | 85 | private var emotonViewPageSix: UIImageView = UIImageView() 86 | 87 | private var emotonViewPageSeven: UIImageView = UIImageView() 88 | 89 | private var emotonViewPageEight: UIImageView = UIImageView() 90 | 91 | var KeyTextView:UITextView? { 92 | 93 | didSet {setSomeProperty()} 94 | } 95 | 96 | func setSomeProperty() { 97 | 98 | if (KeyTextView!.font == nil) { 99 | 100 | KeyTextView?.font = UIFont.systemFont(ofSize: 17) 101 | } 102 | font = (KeyTextView?.font!)! 103 | 104 | EMOJI_MAX_SIZE = heightWithFont(font: font) 105 | } 106 | 107 | override init(frame: CGRect) { 108 | super.init(frame: frame) 109 | 110 | self.backgroundColor = UIColor.white 111 | 112 | initEmojiDatas() 113 | 114 | createScorllView() 115 | 116 | createEmotionViews() 117 | 118 | createPageControl() 119 | 120 | creatPageViewOneBtns() 121 | 122 | ceartPageViewTwoBtns() 123 | 124 | ceartPageViewFourBtns() 125 | 126 | ceartPageViewThreeBtns() 127 | 128 | creatGifBtns() 129 | 130 | creatBottomBar() 131 | } 132 | 133 | required init?(coder aDecoder: NSCoder) { 134 | 135 | fatalError("初始化失败") 136 | } 137 | 138 | 139 | func initEmojiDatas() { 140 | 141 | sendBtn.isEnabled = false 142 | 143 | self.isUserInteractionEnabled = true 144 | 145 | gap = (screenW - (CGFloat(rowCount) * emotionW)) / (CGFloat(rowCount) + 1) 146 | 147 | let staPath:String = Bundle.main.path(forResource: "LiuqsEmoji", ofType: "plist")! 148 | 149 | let gifPath:String = Bundle.main.path(forResource: "LiuqsGifEmoji", ofType: "plist")! 150 | 151 | let tagPath:String = Bundle.main.path(forResource: "LiuqsEmotionTags", ofType: "plist")! 152 | 153 | _emojiTags = NSArray.init(contentsOfFile: tagPath)! 154 | 155 | _emotionGifTitle = NSDictionary.init(contentsOfFile: gifPath)! 156 | 157 | _emojiStaticImages = NSDictionary.init(contentsOfFile: staPath)! 158 | 159 | } 160 | 161 | func createScorllView() { 162 | 163 | let frame:CGRect = CGRect.init(x: 0, y: 0, width: screenW, height: (CGFloat(rows) * emotionW + CGFloat(rows + 1) * self.gap)) 164 | 165 | let pageView:UIScrollView = UIScrollView.init(frame: frame) 166 | 167 | pageView.backgroundColor = UIColor.clear 168 | 169 | pageView.bounces = false 170 | 171 | pageView.isPagingEnabled = true 172 | 173 | pageView.showsVerticalScrollIndicator = false 174 | 175 | pageView.showsHorizontalScrollIndicator = false 176 | 177 | pageView.contentSize = CGSize.init(width: screenW * CGFloat(pages), height: 0) 178 | 179 | pageView.delaysContentTouches = true 180 | 181 | pageView.delegate = self 182 | 183 | self.pageView = pageView 184 | 185 | self.addSubview(pageView) 186 | 187 | } 188 | 189 | func createEmotionViews() { 190 | 191 | for i:Int in 0..= 12) { 435 | btn.isUserInteractionEnabled = false; 436 | } 437 | 438 | self.emotonViewPageFour.addSubview(btn) 439 | } 440 | } 441 | 442 | //动态图按钮 443 | 444 | func creatGifBtns() { 445 | 446 | let Vgap:CGFloat = (self.emotonViewPageSeven.frame.size.height - gifH * 2) / 2 447 | 448 | let Lgap:CGFloat = (screenW - gifW * CGFloat(gifRowCount)) / 5 449 | 450 | var row:CGFloat 451 | 452 | var page:CGFloat 453 | 454 | for i:Int in 0..= 0 && i < 8) { 493 | 494 | self.emotonViewPageFive.addSubview(btn) 495 | }else if (i >= 8 && i < 16) 496 | { 497 | self.emotonViewPageSix.addSubview(btn) 498 | }else if (i >= 16 && i < 24) 499 | { 500 | self.emotonViewPageSeven.addSubview(btn) 501 | }else if (i >= 20 && i < 32) 502 | { 503 | self.emotonViewPageEight.addSubview(btn) 504 | } 505 | } 506 | } 507 | 508 | func createPageControl() { 509 | 510 | let pagecontrol:UIPageControl = UIPageControl.init(frame: CGRect.init(x: 0, y: self.emotonViewPageOne.frame.size.height, width: screenW, height: 15)) 511 | 512 | pagecontrol.numberOfPages = 4 513 | 514 | pagecontrol.currentPage = 0 515 | 516 | pagecontrol.pageIndicatorTintColor = UIColor.lightGray 517 | 518 | pagecontrol.currentPageIndicatorTintColor = UIColor.orange 519 | 520 | pagecontrol.hidesForSinglePage = false 521 | 522 | pagecontrol.backgroundColor = UIColor.clear 523 | 524 | self.pageControl = pagecontrol 525 | 526 | self.addSubview(pagecontrol) 527 | } 528 | 529 | func creatBottomBar() { 530 | 531 | cteateBottomBtnBar() 532 | 533 | createSendBtn() 534 | 535 | createEmotionBtns() 536 | 537 | } 538 | 539 | func cteateBottomBtnBar() { 540 | 541 | let line:UIView = UIView.init(frame: CGRect.init(x: 0, y: self.emotonViewPageOne.frame.size.height + 15, width: screenW, height: 1)) 542 | 543 | line.backgroundColor = BACKGROUND_Color 544 | 545 | self.addSubview(line) 546 | 547 | let btnsBar:UIButton = UIButton.init(frame: CGRect.init(x: 0, y: self.emotonViewPageOne.frame.size.height + 16, width: screenW, height: emotionW + 5)) 548 | 549 | self.btnsBar = btnsBar 550 | 551 | btnsBar.isUserInteractionEnabled = true 552 | 553 | btnsBar.backgroundColor = UIColor.white 554 | 555 | self.addSubview(btnsBar) 556 | 557 | } 558 | 559 | func createSendBtn() { 560 | 561 | let sendBtn:UIButton = UIButton.init(frame: CGRect.init(x: screenW * 6 / 7, y: 0, width: screenW / 7, height: btnsBar.frame.size.height)) 562 | 563 | sendBtn.setTitle("发送", for: UIControlState.normal) 564 | 565 | sendBtn.titleLabel?.font = UIFont.systemFont(ofSize: 16) 566 | 567 | sendBtn.setBackgroundImage(UIImage.createImageWithColor(color: BLUE_Color), for: UIControlState.selected) 568 | 569 | sendBtn.setBackgroundImage(UIImage.createImageWithColor(color: UIColor.lightGray), for: UIControlState.normal) 570 | 571 | sendBtn.isSelected = true 572 | 573 | sendBtn.tag = 44 574 | 575 | sendBtn.addTarget(self, action: #selector(emotionBtnDidClick(btn:)), for: UIControlEvents.touchUpInside) 576 | 577 | btnsBar.addSubview(sendBtn) 578 | 579 | } 580 | 581 | func createEmotionBtns() { 582 | 583 | for i:Int in 0..CGFloat { 654 | 655 | let dict = [NSFontAttributeName:font] 656 | 657 | let option = NSStringDrawingOptions.usesLineFragmentOrigin 658 | 659 | let text: NSString = "/" 660 | 661 | let rect:CGRect = text.boundingRect(with: CGSize.init(width: 100, height: 1000), options: option, attributes: dict, context: nil) 662 | 663 | return rect.size.height 664 | } 665 | 666 | func deleteBtnClick(btn:UIButton) { 667 | 668 | self.KeyTextView?.deleteBackward() 669 | 670 | emotionBtnDidClick(btn: btn) 671 | } 672 | 673 | //静态表情的按钮事件 674 | func insertEmoji(btn:UIButton) { 675 | 676 | emotionBtnDidClick(btn: btn) 677 | 678 | let emojiTextAttachment:LiuqsTextAttachment = LiuqsTextAttachment() 679 | 680 | emojiTextAttachment.emojiTag = _emojiTags[btn.tag - 1] as! String 681 | 682 | let imageName:String = _emojiStaticImages.object(forKey: emojiTextAttachment.emojiTag)! as! String 683 | 684 | emojiTextAttachment.image = UIImage.init(named: imageName) 685 | 686 | emojiTextAttachment.emojiSize = CGSize.init(width: EMOJI_MAX_SIZE, height: EMOJI_MAX_SIZE); 687 | 688 | let attstr:NSAttributedString = NSAttributedString.init(attachment: emojiTextAttachment) 689 | 690 | KeyTextView?.textStorage.insert(attstr, at: (KeyTextView?.selectedRange.location)!) 691 | 692 | KeyTextView?.selectedRange = NSRange.init(location: (KeyTextView?.selectedRange.location)! + 1, length: (KeyTextView?.selectedRange.length)!) 693 | 694 | emotionBtnDidClick(btn: btn) 695 | 696 | resetTextStyle() 697 | 698 | } 699 | 700 | func resetTextStyle() { 701 | 702 | let wholeRange:NSRange = NSRange.init(location: 0, length: (KeyTextView?.textStorage.length)!) 703 | 704 | KeyTextView?.textStorage.removeAttribute(NSFontAttributeName, range: wholeRange) 705 | 706 | KeyTextView?.textStorage.addAttributes([NSFontAttributeName:font], range: wholeRange) 707 | 708 | KeyTextView?.scrollRectToVisible(CGRect.init(x: 0, y: 0, width: (KeyTextView?.contentSize.width)!, height: (KeyTextView?.contentSize.height)!), animated: true) 709 | 710 | } 711 | 712 | //gif表情按钮点击事件 713 | func emotionGifClick(btn:UIButton) { 714 | 715 | self.delegate?.gifBtnClick(btn: btn) 716 | } 717 | 718 | //发送,删除,表情等按钮的事件,用来处理按钮状态 719 | func emotionBtnDidClick(btn:UIButton) { 720 | 721 | self.delegate?.emotionView_sBtnDidClick(btn: btn) 722 | 723 | } 724 | 725 | //底部按钮条上的表情按钮,切换不同类型表情 726 | func emotionBtnsClick(btn:UIButton) { 727 | 728 | self.emotionBtn.isSelected = false; 729 | 730 | self.emotionBtn = btn; 731 | 732 | btn.isSelected = !btn.isSelected; 733 | 734 | if (btn.tag == 0) { 735 | 736 | var point:CGPoint = self.pageView.contentOffset; 737 | 738 | point.x = 0; 739 | 740 | UIView.animate(withDuration: 0, animations: { 741 | 742 | self.pageView.contentOffset = point; 743 | }) 744 | 745 | }else if (btn.tag == 1) { 746 | 747 | var point:CGPoint = self.pageView.contentOffset; 748 | 749 | point.x = screenW * 4; 750 | 751 | UIView.animate(withDuration: 0, animations: { 752 | 753 | self.pageView.contentOffset = point; 754 | }) 755 | } 756 | 757 | } 758 | 759 | } 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | --------------------------------------------------------------------------------