Initial Commit

This commit is contained in:
Nikita Vilunov 2024-06-14 00:58:15 +02:00
commit 4fdf4e2c14
11 changed files with 647 additions and 0 deletions

View File

@ -0,0 +1,346 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 56;
objects = {
/* Begin PBXBuildFile section */
11993EBD2C1BB1050042C150 /* LavinaApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11993EBC2C1BB1050042C150 /* LavinaApp.swift */; };
11993EBF2C1BB1050042C150 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11993EBE2C1BB1050042C150 /* ContentView.swift */; };
11993EC12C1BB1070042C150 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 11993EC02C1BB1070042C150 /* Assets.xcassets */; };
11993EC42C1BB1070042C150 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 11993EC32C1BB1070042C150 /* Preview Assets.xcassets */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
11993EB92C1BB1050042C150 /* Lavina.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Lavina.app; sourceTree = BUILT_PRODUCTS_DIR; };
11993EBC2C1BB1050042C150 /* LavinaApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LavinaApp.swift; sourceTree = "<group>"; };
11993EBE2C1BB1050042C150 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
11993EC02C1BB1070042C150 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
11993EC32C1BB1070042C150 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
11993EC52C1BB1070042C150 /* Lavina.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Lavina.entitlements; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
11993EB62C1BB1050042C150 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
11993EB02C1BB1050042C150 = {
isa = PBXGroup;
children = (
11993EBB2C1BB1050042C150 /* Lavina */,
11993EBA2C1BB1050042C150 /* Products */,
);
sourceTree = "<group>";
};
11993EBA2C1BB1050042C150 /* Products */ = {
isa = PBXGroup;
children = (
11993EB92C1BB1050042C150 /* Lavina.app */,
);
name = Products;
sourceTree = "<group>";
};
11993EBB2C1BB1050042C150 /* Lavina */ = {
isa = PBXGroup;
children = (
11993EBC2C1BB1050042C150 /* LavinaApp.swift */,
11993EBE2C1BB1050042C150 /* ContentView.swift */,
11993EC02C1BB1070042C150 /* Assets.xcassets */,
11993EC52C1BB1070042C150 /* Lavina.entitlements */,
11993EC22C1BB1070042C150 /* Preview Content */,
);
path = Lavina;
sourceTree = "<group>";
};
11993EC22C1BB1070042C150 /* Preview Content */ = {
isa = PBXGroup;
children = (
11993EC32C1BB1070042C150 /* Preview Assets.xcassets */,
);
path = "Preview Content";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
11993EB82C1BB1050042C150 /* Lavina */ = {
isa = PBXNativeTarget;
buildConfigurationList = 11993EC82C1BB1070042C150 /* Build configuration list for PBXNativeTarget "Lavina" */;
buildPhases = (
11993EB52C1BB1050042C150 /* Sources */,
11993EB62C1BB1050042C150 /* Frameworks */,
11993EB72C1BB1050042C150 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = Lavina;
productName = Lavina;
productReference = 11993EB92C1BB1050042C150 /* Lavina.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
11993EB12C1BB1050042C150 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1540;
LastUpgradeCheck = 1540;
TargetAttributes = {
11993EB82C1BB1050042C150 = {
CreatedOnToolsVersion = 15.4;
};
};
};
buildConfigurationList = 11993EB42C1BB1050042C150 /* Build configuration list for PBXProject "Lavina" */;
compatibilityVersion = "Xcode 14.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 11993EB02C1BB1050042C150;
productRefGroup = 11993EBA2C1BB1050042C150 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
11993EB82C1BB1050042C150 /* Lavina */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
11993EB72C1BB1050042C150 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
11993EC42C1BB1070042C150 /* Preview Assets.xcassets in Resources */,
11993EC12C1BB1070042C150 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
11993EB52C1BB1050042C150 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
11993EBF2C1BB1050042C150 /* ContentView.swift in Sources */,
11993EBD2C1BB1050042C150 /* LavinaApp.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
11993EC62C1BB1070042C150 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 14.5;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
11993EC72C1BB1070042C150 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 14.5;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
};
name = Release;
};
11993EC92C1BB1070042C150 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Lavina/Lavina.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"Lavina/Preview Content\"";
DEVELOPMENT_TEAM = 4G6BW6A6BT;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = me.vilunov.Lavina;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
11993ECA2C1BB1070042C150 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Lavina/Lavina.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"Lavina/Preview Content\"";
DEVELOPMENT_TEAM = 4G6BW6A6BT;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = me.vilunov.Lavina;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
11993EB42C1BB1050042C150 /* Build configuration list for PBXProject "Lavina" */ = {
isa = XCConfigurationList;
buildConfigurations = (
11993EC62C1BB1070042C150 /* Debug */,
11993EC72C1BB1070042C150 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
11993EC82C1BB1070042C150 /* Build configuration list for PBXNativeTarget "Lavina" */ = {
isa = XCConfigurationList;
buildConfigurations = (
11993EC92C1BB1070042C150 /* Debug */,
11993ECA2C1BB1070042C150 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 11993EB12C1BB1050042C150 /* Project object */;
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Lavina.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,58 @@
{
"images" : [
{
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

171
Lavina/ContentView.swift Normal file
View File

@ -0,0 +1,171 @@
import SwiftUI
enum Selector: Hashable {
case overview
case room(String)
case direct(String)
}
struct Room: Identifiable {
var id: String { name }
let name: String
}
struct Direct: Identifiable {
var id: String { name }
let name: String
}
struct ContentView: View {
let rooms = ["Core Dev", "Rust", "Ads"].map { Room(name: $0) }
let directs = ["Jeroen", "Ilnur"].map { Direct(name: $0) }
@State private var selected: Selector = .overview;
var body: some View {
NavigationSplitView {
List(selection: $selected) {
Text("Overview").tag(Selector.overview)
Section("Rooms") {
ForEach(rooms) { it in
Text(it.name).tag(Selector.room(it.id))
}
}
Section("Directs") {
ForEach(directs) { it in
Text(it.name).tag(Selector.direct(it.id))
}
}
}
} detail: {
switch selected {
case .overview:
Overview()
case .room(_):
TopicListView()
case .direct(_):
MessageListView()
}
}
}
}
struct Overview: View {
var body: some View {
Text("welcome")
}
}
struct MessageListView: View {
@State var newMessage: String = ""
@ObservedObject var viewModel: TopicViewModel = TopicViewModel(messages: [
Message(author: "Jeroen", body: "Hello everyone!"),
Message(author: "Jeroen", body: "Hoe gaat het?"),
Message(author: "Ilnur", body: "Normalno"),
Message(author: "Jeroen", body: "Zbs!"),
])
var body: some View {
ScrollView {
Text("Start of the conversation")
VStack(alignment: .leading) {
ForEach(viewModel.messages) { it in
Divider()
MessageBatchView(
author: it.author,
messages: [it.body]
)
}
}
}
.contentMargins(5)
.defaultScrollAnchor(.bottom)
.background(.white)
HStack {
TextField(text: $newMessage) {
Text("New message")
}.textFieldStyle(.roundedBorder)
Button(action: {}) {
Text("Send")
}
}.padding(5)
}
}
struct MessageBatchView: View {
let author: String
let messages: [String]
var body: some View {
Text("\(author):").bold()
ForEach(messages, id: \.hash) { it in
Text(it)
}
}
}
struct TopicListView: View {
@State var topicTitle: String = ""
var body: some View {
ScrollView {
VStack(alignment: .leading) {
TextField(text: $topicTitle) {
Text("A new topic!")
}
Divider()
TopicSlugView(
title: "How do I patch KDE3 for FreeBSD?",
numberOfReplies: 5,
openedWhen: "Opened 5 days ago"
)
TopicSlugView(
title: "Our coffee machine is broken, pls fix",
numberOfReplies: 133,
openedWhen: "Opened yesterday"
)
}
.padding(5)
}
}
}
struct TopicSlugView: View {
let title: String
let numberOfReplies: Int
let openedWhen: String
var body: some View {
Button {
} label: {
VStack(alignment: .leading) {
Text(title).bold()
HStack {
Text("\(numberOfReplies) replies")
Spacer()
Text(openedWhen)
}
}
}
}
}
class TopicViewModel: ObservableObject {
@Published var messages: [Message]
init(messages: [Message]) {
self.messages = messages
}
}
struct Message: Identifiable {
let id: UUID = UUID()
var author: String
var body: String
}
#Preview {
ContentView()
}

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>

10
Lavina/LavinaApp.swift Normal file
View File

@ -0,0 +1,10 @@
import SwiftUI
@main
struct LavinaApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}