LXFWeChat

Swift 3.0 mimics wechat

Two test accounts: LXF LQR password is 123456

The source address

Yards cloud git.oschina.net/LinXunFeng/…

Making github.com/LinXunFeng/…

This is to provide the complete project stored in Baidu Cloud [high imitation wechat] – Baidu Cloud hope you can contribute a precious Star in my project, thank you

From December 2016 to now, although this project seems small, there are a lot of training places, such as sorting contacts in the wechat address book according to pinyin, paging scrolling in the custom emoticon keyboard, picture display in the wechat chat interface, animation of voice messages, etc. Challenges a variety of requirements, I will also encounter the problem solution to do a record and tidy up, hoping to bring help to iOS programmers compatriots. At present, the basic chat has been completed, and some personal information has been modified. I will improve the function as soon as possible!

Imitate the navigation bar of wechat

Add a view with a gradient layer at the bottom of the navigationBar

let blurBackView = UIView()
blurBackView.frame = CGRect(x: 0, y: -20, width: kScreenW, height: 64)
let gradintLayer = CAGradientLayer()
gradintLayer.frame = CGRect(x: 0, y: 0, width: kScreenW, height: 64)
gradintLayer.colors = [
    UIColor.hexInt(0x040012).withAlphaComponent(0.76).cgColor,
    UIColor.hexInt(0x040012).withAlphaComponent(0.28).cgColor
]
gradintLayer.startPoint = CGPoint(x: 0, y: 0)
gradintLayer.endPoint = CGPoint(x: 0, y: 1.0)
blurBackView.layer.addSublayer(gradintLayer)
blurBackView.isUserInteractionEnabled = false
blurBackView.alpha = 0.5

// Set the navigation bar style
navigationBar.barStyle = .black
navigationBar.insertSubview(blurBackView, at: 0)
Copy the code

Emoticon panel and more panels

The problems encountered are summarized, and you can refer to the following summary of the article

Ios-swift UICollectionView Horizontal page scrolling, Cell left and right typeset

Ios-swift UICollectionView Horizontal Paging Problem

Chat screen

Ios-swift Imitation wechat chat picture display

IOS – Swift UITableView scrollToRow pit

Ios-swift UIButton animationImages of ImageView darken after animation

Home page

Ios-swift Imitation wechat Red Dot (no number)

Currently completed functions

WeChat interface

  1. The menu in the upper right corner is displayed
  2. Display recent contacts
  3. Unread display of recent contact information

Address book interface

  1. Sorting contacts
  2. Total Number of Contacts display

Found that the interface

  1. Dynamic red dot display
  2. Shopping options link jump

I interface

  1. Upload and set the personal profile picture, and save the profile picture
  2. My TWO-DIMENSIONAL code interface display and two-dimensional code save

Chat screen

  1. Small video recording and sending
  2. Small video playback
  3. Chat of time
  4. Send and display pictures
  5. Failed to send the retransmission function
  6. Recording and sending of voice
  7. Dynamic effect of voice playback

A known BUG

  • Small videos and images cannot be updated immediately after being sent to show thumbnails
  • The e replacement head simulator test is normal, the real machine is invalid.

The 2017-07-24 update

Related blog: iOS – to add live chat function to high imitation wechat needs to use the compiled B station open source library ijkPlayer, because the packaged file is too large, can not be uploaded, so you need to compile and integrate into it.

rendering

Dynamic figure

Static figure