Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DDVD233 committed Aug 15, 2020
1 parent 2d4fdbe commit 9e46c91
Show file tree
Hide file tree
Showing 13 changed files with 543 additions and 17 deletions.
106 changes: 103 additions & 3 deletions Laffey.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 52;
objects = {

/* Begin PBXBuildFile section */
Expand All @@ -14,6 14,14 @@
E43AC76C24E6681E00F548F1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E43AC76B24E6681E00F548F1 /* Assets.xcassets */; };
E43AC76F24E6681E00F548F1 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E43AC76E24E6681E00F548F1 /* Preview Assets.xcassets */; };
E43AC77224E6681E00F548F1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E43AC77024E6681E00F548F1 /* LaunchScreen.storyboard */; };
E43AC78A24E7566A00F548F1 /* LoginAndRegister.swift in Sources */ = {isa = PBXBuildFile; fileRef = E43AC78924E7566A00F548F1 /* LoginAndRegister.swift */; };
E4A75D3424E76DD0007095D7 /* RegistrationForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4A75D3324E76DD0007095D7 /* RegistrationForm.swift */; };
E4A75D3624E77487007095D7 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4A75D3524E77487007095D7 /* Extensions.swift */; };
E4A75D3924E7A02E007095D7 /* Moya in Frameworks */ = {isa = PBXBuildFile; productRef = E4A75D3824E7A02E007095D7 /* Moya */; };
E4A75D3B24E7A053007095D7 /* LaffeyAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4A75D3A24E7A053007095D7 /* LaffeyAPI.swift */; };
E4A75D3D24E7A819007095D7 /* LoginResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4A75D3C24E7A819007095D7 /* LoginResponse.swift */; };
E4A75D3F24E7ACBE007095D7 /* Preferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4A75D3E24E7ACBE007095D7 /* Preferences.swift */; };
E4A75D4324E7B2B6007095D7 /* RegisterResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4A75D4224E7B2B6007095D7 /* RegisterResponse.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -26,13 34,22 @@
E43AC76E24E6681E00F548F1 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
E43AC77124E6681E00F548F1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
E43AC77324E6681E00F548F1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E43AC78924E7566A00F548F1 /* LoginAndRegister.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginAndRegister.swift; sourceTree = "<group>"; };
E4A75D3324E76DD0007095D7 /* RegistrationForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegistrationForm.swift; sourceTree = "<group>"; };
E4A75D3524E77487007095D7 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
E4A75D3A24E7A053007095D7 /* LaffeyAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaffeyAPI.swift; sourceTree = "<group>"; };
E4A75D3C24E7A819007095D7 /* LoginResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginResponse.swift; sourceTree = "<group>"; };
E4A75D3E24E7ACBE007095D7 /* Preferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Preferences.swift; sourceTree = "<group>"; };
E4A75D4124E7AEBD007095D7 /* Laffey.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Laffey.entitlements; sourceTree = "<group>"; };
E4A75D4224E7B2B6007095D7 /* RegisterResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterResponse.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
E43AC75C24E6681C00F548F1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E4A75D3924E7A02E007095D7 /* Moya in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -58,6 75,9 @@
E43AC76124E6681C00F548F1 /* Laffey */ = {
isa = PBXGroup;
children = (
E4A75D4124E7AEBD007095D7 /* Laffey.entitlements */,
E4A75D3224E76DBF007095D7 /* Models */,
E43AC79424E7678500F548F1 /* Views */,
E43AC76224E6681C00F548F1 /* AppDelegate.swift */,
E43AC76424E6681C00F548F1 /* SceneDelegate.swift */,
E43AC76924E6681C00F548F1 /* ContentView.swift */,
Expand All @@ -66,6 86,7 @@
E43AC77324E6681E00F548F1 /* Info.plist */,
E43AC76624E6681C00F548F1 /* Laffey.xcdatamodeld */,
E43AC76D24E6681E00F548F1 /* Preview Content */,
E4A75D3524E77487007095D7 /* Extensions.swift */,
);
path = Laffey;
sourceTree = "<group>";
Expand All @@ -78,6 99,26 @@
path = "Preview Content";
sourceTree = "<group>";
};
E43AC79424E7678500F548F1 /* Views */ = {
isa = PBXGroup;
children = (
E43AC78924E7566A00F548F1 /* LoginAndRegister.swift */,
);
path = Views;
sourceTree = "<group>";
};
E4A75D3224E76DBF007095D7 /* Models */ = {
isa = PBXGroup;
children = (
E4A75D3324E76DD0007095D7 /* RegistrationForm.swift */,
E4A75D3A24E7A053007095D7 /* LaffeyAPI.swift */,
E4A75D3C24E7A819007095D7 /* LoginResponse.swift */,
E4A75D3E24E7ACBE007095D7 /* Preferences.swift */,
E4A75D4224E7B2B6007095D7 /* RegisterResponse.swift */,
);
path = Models;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -88,12 129,16 @@
E43AC75B24E6681C00F548F1 /* Sources */,
E43AC75C24E6681C00F548F1 /* Frameworks */,
E43AC75D24E6681C00F548F1 /* Resources */,
E4A75D4024E7ADA8007095D7 /* ShellScript */,
);
buildRules = (
);
dependencies = (
);
name = Laffey;
packageProductDependencies = (
E4A75D3824E7A02E007095D7 /* Moya */,
);
productName = Laffey;
productReference = E43AC75F24E6681C00F548F1 /* Laffey.app */;
productType = "com.apple.product-type.application";
Expand Down Expand Up @@ -122,6 167,9 @@
Base,
);
mainGroup = E43AC75624E6681C00F548F1;
packageReferences = (
E4A75D3724E7A02E007095D7 /* XCRemoteSwiftPackageReference "Moya" */,
);
productRefGroup = E43AC76024E6681C00F548F1 /* Products */;
projectDirPath = "";
projectRoot = "";
Expand All @@ -144,15 192,42 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
E4A75D4024E7ADA8007095D7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nagvtool next-version -all\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
E43AC75B24E6681C00F548F1 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E43AC76324E6681C00F548F1 /* AppDelegate.swift in Sources */,
E4A75D4324E7B2B6007095D7 /* RegisterResponse.swift in Sources */,
E43AC78A24E7566A00F548F1 /* LoginAndRegister.swift in Sources */,
E4A75D3F24E7ACBE007095D7 /* Preferences.swift in Sources */,
E4A75D3D24E7A819007095D7 /* LoginResponse.swift in Sources */,
E4A75D3424E76DD0007095D7 /* RegistrationForm.swift in Sources */,
E4A75D3B24E7A053007095D7 /* LaffeyAPI.swift in Sources */,
E43AC76824E6681C00F548F1 /* Laffey.xcdatamodeld in Sources */,
E43AC76A24E6681C00F548F1 /* ContentView.swift in Sources */,
E43AC76524E6681C00F548F1 /* SceneDelegate.swift in Sources */,
E4A75D3624E77487007095D7 /* Extensions.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -288,7 363,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Laffey/Laffey.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_ASSET_PATHS = "\"Laffey/Preview Content\"";
DEVELOPMENT_TEAM = HWH6G9P2V2;
ENABLE_PREVIEWS = YES;
Expand All @@ -297,18 374,21 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.dwei.Laffey;
PRODUCT_BUNDLE_IDENTIFIER = works.dd.Laffey;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
E43AC77824E6681E00F548F1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Laffey/Laffey.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_ASSET_PATHS = "\"Laffey/Preview Content\"";
DEVELOPMENT_TEAM = HWH6G9P2V2;
ENABLE_PREVIEWS = YES;
Expand All @@ -317,10 397,11 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.dwei.Laffey;
PRODUCT_BUNDLE_IDENTIFIER = works.dd.Laffey;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
Expand All @@ -347,6 428,25 @@
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
E4A75D3724E7A02E007095D7 /* XCRemoteSwiftPackageReference "Moya" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Moya/Moya.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 14.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
E4A75D3824E7A02E007095D7 /* Moya */ = {
isa = XCSwiftPackageProductDependency;
package = E4A75D3724E7A02E007095D7 /* XCRemoteSwiftPackageReference "Moya" */;
productName = Moya;
};
/* End XCSwiftPackageProductDependency section */

/* Begin XCVersionGroup section */
E43AC76624E6681C00F548F1 /* Laffey.xcdatamodeld */ = {
isa = XCVersionGroup;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions Laffey/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -11,9 12,9 @@
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<color key="backgroundColor" red="0.99999600649999998" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
Expand Down
22 changes: 16 additions & 6 deletions Laffey/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 2,7 @@
// ContentView.swift
// Laffey
//
// Created by 戴元平 on 8/14/20.
// Created by DDavid on 8/14/20.
// Copyright © 2020 Wei Dai. All rights reserved.
//

Expand All @@ -13,15 13,25 @@ struct ContentView: View {

var body: some View {
TabView(selection: $selection){
Text("First View")
.font(.title)
.tabItem {
Group {
HStack{
VStack {
Image("first")
Text("First")
Text("Laffey")
.font(.title)
Text("Laffey 2")
.font(.callout)
}
Text("Laffey 3 ")
}

.tabItem {
VStack {
Image("first")
Text("First")
}
}
.tag(0)
}
Text("Second View")
.font(.title)
.tabItem {
Expand Down
56 changes: 56 additions & 0 deletions Laffey/Extensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 1,56 @@
//
// Extensions.swift
// Laffey
//
// Created by 戴元平 on 8/15/20.
// Copyright © 2020 Wei Dai. All rights reserved.
//

import SwiftUI

public extension Color {
static let salmon = Color(rgb: 0xFF7E79)

init(red: Int, green: Int, blue: Int) {
assert(red >= 0 && red <= 255, "Invalid red component")
assert(green >= 0 && green <= 255, "Invalid green component")
assert(blue >= 0 && blue <= 255, "Invalid blue component")

self.init(red: Double(red) / 255.0, green: Double(green) / 255.0, blue: Double(blue) / 255.0)
}

init(rgb: Int) {
self.init(
red: (rgb >> 16) & 0xFF,
green: (rgb >> 8) & 0xFF,
blue: rgb & 0xFF
)
}
}

struct KeyboardResponsiveModifier: ViewModifier {
@State private var offset: CGFloat = 0

func body(content: Content) -> some View {
content
.padding(.bottom, offset)
.onAppear {
NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillShowNotification, object: nil, queue: .main) { notif in
let value = notif.userInfo![UIResponder.keyboardFrameEndUserInfoKey] as! CGRect
let height = value.height
let bottomInset = UIApplication.shared.windows.first?.safeAreaInsets.bottom
self.offset = height - (bottomInset ?? 0)
}

NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillHideNotification, object: nil, queue: .main) { notif in
self.offset = 0
}
}
}
}

extension View {
func keyboardResponsive() -> ModifiedContent<Self, KeyboardResponsiveModifier> {
return modifier(KeyboardResponsiveModifier())
}
}
2 changes: 1 addition & 1 deletion Laffey/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 17,7 @@
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>8</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
Expand Down
Loading

0 comments on commit 9e46c91

Please sign in to comment.