Giter VIP home page Giter VIP logo

swiftui-wechat's Introduction

SwiftUI-WeChat

codebeat badge


Overview

  • I will continue to follow the development of technology, the goal is to bring SwiftUI-WeChat to an infinitely close WeChat experience. When you want to implement a function similar to WeChat, you can quickly find out how to implement this function in this project, so I believe this project will help someone.

  • The plan will be perfected until the popularity of SwiftUI, update occasionally. If you have questions about the implementation, or have better ideas, please feel free to communicate with me in issue

  • Your ★ Star is my biggest motivation

Features

  • All based on SwiftUI2 (SwiftUI1 Version).
  • The navigation bar changes when the homepage switches. TabView is hidden in the details page.
  • Timeline: Picture layout. Play online video. The status bar navigation bar changes as you scroll through the list.
  • Full support for Dark Mode

Screenshots

Light Mode Dark Mode
HomeView HomeView
ChatView ChatView
ContactView ContactView
DiscoverView DiscoverView
MomentView MomentView
MeView MeView

TODO

  • Homepage: Support left slide to delete chat content
  • Chat: keyboard processing, multi-line text box height, send content, more media types, emoji, voice, etc.
  • Timeline: pull-down refresh, pull-up loading, full-screen preview of pictures and videos, comments, likes, etc.
  • Search interface

Requirements

  • iOS 14+
  • Xcode 12+
  • Swift 5.3+

Contributors

Create by 森仔

Banner Design by @aduqin

License

SwiftUI-WeChat is released under the MIT license. See LICENSE for details.


中文

SwiftUI-WeChat

codebeat badge


项目概览

  • 我将持续关注 SwiftUI 技术的发展,目标是将 SwiftUI-WeChat 更新至无限接近微信的体验。每个人都熟悉微信,因此当您想实现类似于微信的功能时,可以通过此项目了解实现思路,因此我相信这个项目会对大家有帮助。

  • 此项目计划维护到 SwiftUI 真正流行为止。如果您对实现有疑问,或者有更好的想法,请随时在 issue 中与我交流,或者提交 PR。

  • 你的 ★ Star 是我最大的动力

功能特性

  • 全部基于 SwiftUI2(SwiftUI1 版本传送门)。
  • 底部导航切换时顶部导航更新,进入二级界面时底部导航隐藏。
  • 朋友圈:多种宫格布局、可播放在线视频、状态栏导航栏随列表滚动变化。
  • 完全支持夜间模式。
  • 特殊处理、知识点中文注释

屏幕截图

Light Mode Dark Mode
HomeView HomeView
ChatView ChatView
ContactView ContactView
DiscoverView DiscoverView
MomentView MomentView
MeView MeView

项目依赖

  • iOS 14+
  • Xcode 12+
  • Swift 5.3+

贡献者

作者 森仔

Banner 设计 @aduqin

开源许可

SwiftUI-WeChat is released under the MIT license. See LICENSE for details.

swiftui-wechat's People

Contributors

wxxsw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swiftui-wechat's Issues

你好,编译运行报错了

Showing Recent Messages
Couldn’t get revision ‘3c5b9531ee20e34d3a86142ca2c076a5b99afdb2^{commit}’:

Showing Recent Messages
The operation couldn’t be completed. (SwiftPM.SPMRepositoryError error 5.)

Moment: ForEach(), Index out of range

感谢分享,
ForEach<Range<Int>, Int, ModifiedContent<ModifiedContent<ModifiedContent<Image, _AspectRatioLayout>, _FrameLayout>, _ClipEffect<Rectangle>>> count (2) != its initial count (3). ForEach(:content:)should only be used for *constant* data. Instead conform data toIdentifiableor useForEach(🆔content:)and provide an explicitid!

我在真机上运行发现朋友圈View下拉会导致数组越界,在ForEach里面加上id参数可以解决这个问题。
e.g.
ForEach(0 ..< rows, id: \.self)

How to build this project?

Hey bro,

After fresh checkout the code doesn't really build in Xcode, it can not find Refresh and VideoPlayer package, is there any specific command I need to run?
I'm using Xcode version 13.2 (13C90), which is the latest one

(I'm an android developer recently started learning iOS)

如何在SwiftUI中实现navigationController.popToRootViewControoler的功能

NavigationLink多个View之后,无法直接返回根视图。
我在您项目的基础上做了个人详情页,想在用户信息页面删除用户后快速返回跟视图,但是没有找到合适的方法。
在微信中ChatView始终只有一个,比如从群聊进入用户页面,再点击发送消息到聊天也,则NavigationController中的其他ChildViewController会被移除,再进入ChatView页面,现在也无法在SwiftUI上实现

请教一个问题,如何像js一样阻止事件向上冒泡

Simulator Screen Shot - iPod touch (7th generation) - 2021-10-21 at 11 32 52
如上图,怎么让只点击红色背景时才关闭弹出菜单,现在是点击菜单边缘也会关闭
`
if commonData.isPopupMenuShow{
VStack(alignment:.trailing, spacing:0){
HStack{
Spacer()
topArrow
.offset(x: -16, y: 0)

                }
                VStack(alignment: .center, spacing: 10){
                    Button("按钮1"){ }
                    Button("按钮2"){ }
                    Button("按钮3"){ }
                }
                .padding(.horizontal,10)
                .padding(.vertical,15)
                .frame(width: 100)
                .background("#333333".toColor())
                .foregroundColor(Color.white)
                .cornerRadius(10)
                Spacer()
            }
            .background(Color.init(.sRGB, red: 0.8, green: 0.1, blue: 0.1, opacity: 0.5))
            .offset(x:-5,y: 0)
            .zIndex(2)
            .onTapGesture {
                commonData.isPopupMenuShow = false
            }
        }

`

presentationMode 问题

你好,我也是在实际项目中使用swiftui,使用你的项目也发现Xcode连接程序时调试presentationMode可以dismissed,但是关闭xcode直接在模拟器允许app时候,presentationMode的dismissed就失效了,自定义导航栏的back就不能用了 请问大神怎么处理这种情况

请教2个问题

你好,我最近在用swiftui做个项目。
碰到2个问题。
1.push后,我想用代码返回,应怎么弄?
2.点击某项tabbarItem 的时候,我想做一些相应的操作,这个又该怎么弄。
如果您知道,有时间,麻烦解答下。非常感谢。

无法dismiss keyboard

在聊天界面的时候无法dismiss 键盘,这个是怎么解决的呢?
Swift UI 有没有相关方法

关于navigationLink的扩展实现

你好,我也是一名新的SwiftUI学习者
我最近在找NavigationLink按下后会有一个全局变浅的效果的解决办法,
很多时候按下的时候我并不期待他要把全部的颜色都改变。

我看到你的项目里写了一个扩展来解决这个问题,但是在preview中我发现点按没有效果,这个是还没有做好的感觉吗?

愿意参与开源项目 OpenIM

愿意参与开源项目吗?OpenIM诚邀技术极客共建开源社区,共同打造开源IM的No1,有兴趣的加我私聊 微信 skiffer

TabView切换问题

TabView切换时,onAppear方法调用的地方出错,导致NavigationView显示混乱(点击发现页面,可能会出现显示的是联系人,超出两个页面来回切换时出现)

Xcode14编译的版本List的头部出现空白间距

你好,谢谢你开源这么优秀的swiftui项目!

我用xcode14 beta5编译出来的版本,在list的section header部分出现了细微的差异。
具体表现在,iOS15的section header一切正常,iOS16的section header却出现了空白间距。

下面截图都是用Xcode14编译的app通讯录界面的效果,你可以看到明显的差异。

iOS16版本的C, F, G, N...上面都会出现空白部分

iOS15 iOS16

通过查看项目代码,我发现有定义过下面内容

// 避免 iOS15 增加的列表顶部空白 UITableView.appearance().sectionHeaderTopPadding = 0

但是上述设置貌似对iOS16不生效。

可能是因为iOS16版本下swiftui的list组件已经不再使用tableview,而是使用了collectionview这个原因吗?

本人swiftui小白,望大神给予解答,多谢!

全局数据问题

你采用的是全局的navigationView,通过更新store的状态去改变navigationView的状态,这个会存在问题,特别是在onAppear里面进行网络请求刷新数据,会导致界面数据丢失。初步看原因就是在因为在onAppear里面更新的store.hiddenNavBar�的状态,导致所有界面多次刷新。

navigationlink 只能跳转一次

我看项目里面列表也有这个问题,点击跳返回后,不能再次点击跳转一定要点击另一条跳转后,才能点击之前的一条数据进行跳转,你有解决这个问题吗

有深度开发的打算嘛

你好!浏览了一下源码,很棒的SwiftUI项目实践,感谢分享,基本完成了微信的基础页面,请问有深度开发的打算嘛,比如相册管理,内容发布,多媒体内容的发送等。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.