Skip to content

Commit

Permalink
Add settle up and multiple split option support
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-amisha-i committed Jul 5, 2024
1 parent 2c9f48a commit 43a990a
Show file tree
Hide file tree
Showing 134 changed files with 7,145 additions and 1,853 deletions.
104 changes: 59 additions & 45 deletions .github/workflows/Deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ on:
jobs:
deploy:
runs-on: macos-13
env:
APP_STORE_APP_ID: ${{ secrets.APP_STORE_APP_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_PRIVATE_KEY: ${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY }}
APP_STORE_CONNECT_KEY_IDENTIFIER: ${{ secrets.APP_STORE_CONNECT_KEY_IDENTIFIER }}
DIST_CERTIFICATE: ${{ secrets.DIST_CERTIFICATE }}
DIST_CERTIFICATE_PASSWORD: ${{ secrets.DIST_CERTIFICATE_PASSWORD }}
DIST_PROFILE: ${{ secrets.DIST_PROFILE }}
DIST_PROFILE_UUID: ${{ secrets.DIST_PROFILE_UUID }}

steps:
- name: Checkout Repository
Expand All @@ -24,27 +33,6 @@ jobs:
- name: Display Xcode Version
run: /usr/bin/xcodebuild -version

- name: Install Apple Certificate and Provisioning Profile
env:
BUILD_CERTIFICATE_KEY: ${{ secrets.BUILD_CERTIFICATE_KEY }}
BUILD_CERTIFICATE_PASSWORD: ${{ secrets.BUILD_CERTIFICATE_PASSWORD }}
BUILD_PROVISION_PROFILE: ${{ secrets.BUILD_PROVISION_PROFILE }}
BUILD_PROVISION_UUID: ${{ secrets.BUILD_PROVISION_UUID }}
BUILD_KEYCHAIN: ${{ secrets.BUILD_KEYCHAIN }}
BUILD_KEYCHAIN_PASSWORD: ${{ secrets.BUILD_KEYCHAIN_PASSWORD }}
run: |
chmod +x install_dist_certs.sh && ./install_dist_certs.sh
chmod +x install_dist_profile.sh && ./install_dist_profile.sh
- name: Cache DerivedData
uses: actions/cache@v2
with:
path: |
DerivedData
key: ${{ runner.os }}-derived-data-${{ hashFiles('**/*.xcworkspace') }}
restore-keys: |
${{ runner.os }}-derived-data-

- name: Cache CocoaPods
uses: actions/cache@v2
Expand Down Expand Up @@ -72,8 +60,42 @@ jobs:
echo "No Swift files changed. Skipping SwiftLint."
fi
- name: Get Build Version
- name: Install Codemagic CLI tools
run: pip install codemagic-cli-tools

- name: Set up keychain
run: keychain initialize

- name: Set up Provisioning profiles
run: |
PROFILES_HOME="$HOME/Library/MobileDevice/Provisioning Profiles"
mkdir -p "$PROFILES_HOME"
PROFILE_PATH="$(mktemp "$PROFILES_HOME"/${DIST_PROFILE_UUID}.mobileprovision)"
echo ${DIST_PROFILE} | base64 --decode > "$PROFILE_PATH"
- name: Set up signing certificate
run: |
echo $DIST_CERTIFICATE | base64 --decode > /tmp/certificate.p12
keychain add-certificates --certificate /tmp/certificate.p12 --certificate-password $DIST_CERTIFICATE_PASSWORD
- name: Set up code signing settings on the Xcode project
run: xcode-project use-profiles

- name: Retrieve secrets and decode plist files
env:
SECRETS_CONFIG_FILE: ${{ secrets.SECRETS_CONFIG_FILE_BASE64 }}
EXPORT_OPTIONS_PLIST: ${{ secrets.EXPORT_OPTIONS_PLIST_BASE64 }}
GOOGLE_SERVICE_INFO_PLIST: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST_BASE64 }}
run: |
echo "$SECRETS_CONFIG_FILE" | base64 --decode > Splito/Secrets.xcconfig
echo "$EXPORT_OPTIONS_PLIST" | base64 --decode > ExportOptions.plist
echo "$GOOGLE_SERVICE_INFO_PLIST" | base64 --decode > Splito/Plist/GoogleService-Info.plist
- name: Upload app to App Store Connect
env:
GOOGLE_REVERSE_CLIENT_ID: ${{ secrets.GOOGLE_REVERSE_CLIENT_ID }}
run: |
# Get Build Version
file='Splito/VERSION'
fileData=`cat $file`
IFS='.'
Expand All @@ -83,29 +105,21 @@ jobs:
buildName="${versionValue[0]}.${versionValue[1]}.${{ github.run_number }}"
echo "Uploading build $buildName"
- name: Build and Archive Project
run: |
ARCHIVE_PATH=$RUNNER_TEMP/Splito.xcarchive
xcodebuild app_version_code=${buildNumber} app_version_name=${buildName} -workspace Splito.xcworkspace -scheme "Splito" -archivePath $ARCHIVE_PATH -destination generic/platform=iOS clean archive | xcpretty --color
# Update Version Information in Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $buildName" Splito/Plist/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" Splito/Plist/Info.plist
- name: Export Archive
run: |
EXPORT_PATH=$RUNNER_TEMP/Splito/build
xcodebuild -exportArchive -archivePath $ARCHIVE_PATH -exportPath $EXPORT_PATH -exportOptionsPlist ExportOptions.plist | xcpretty --color
# Update CFBundleURLSchemes with Reverse Client ID
/usr/libexec/PlistBuddy -c "Set :CFBundleURLTypes:0:CFBundleURLSchemes:0 $GOOGLE_REVERSE_CLIENT_ID" Splito/Plist/Info.plist
- name: Store IPA
run: |
echo "Collecting artifacts.."
cp -R "$ARCHIVE_PATH/dSYMs" .
IPA="${EXPORT_PATH}Splito.ipa"
echo $IPA
# Build and Archive Project
ARCHIVE_PATH=$RUNNER_TEMP/Splito.xcarchive
xcodebuild clean archive -workspace Splito.xcworkspace -scheme "Splito" -archivePath "$ARCHIVE_PATH" -destination generic/platform=iOS | xcpretty --color
- name: Deploy to App Store Connect
env:
ITC_USER_NAME: ${{ secrets.ITC_USER_NAME }}
ITC_USER_PASSWORD: ${{ secrets.ITC_USER_PASSWORD }}
run: |
rm -rf $ARCHIVE_PATH
rm -rf $EXPORT_PATH
echo "Uploading app to iTC..."
xcrun altool --upload-app -t ios -f $IPA -u $ITC_USER_NAME -p $ITC_USER_PASSWORD
# Export Archive
EXPORT_PATH=$RUNNER_TEMP/build
xcodebuild -exportArchive -archivePath "$ARCHIVE_PATH" -exportOptionsPlist "$(pwd)/ExportOptions.plist" -exportPath "$EXPORT_PATH" | xcpretty --color
# Upload to App Store Connect
APP_FILE=$(find "$EXPORT_PATH" -name "*.ipa")
app-store-connect publish --path "$APP_FILE"
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,10 @@ fastlane/test_output.DS_Store
node_modules/
package-lock.json

*.generated.swift
*.generated.swift

Splito/Secrets.xcconfig

ExportOptions.plist
Splito/Plist/GoogleService-Info.plist

1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ disabled_rules: # rule identifiers to exclude from running
- function_body_length
- orphaned_doc_comment
- void_function_in_ternary
- non_optional_string_data_conversion

file_length:
warning: 400
Expand Down
20 changes: 4 additions & 16 deletions BaseStyle/BaseStyle.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
A40018A9B957803B8105BEA5 /* Pods_BaseStyle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 174198EE4AF2FC82DADEB060 /* Pods_BaseStyle.framework */; };
D82174BE2BBAD86D00DB42C3 /* ProfileImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D82174BD2BBAD86D00DB42C3 /* ProfileImageView.swift */; };
D8302D9C2B9EE1D2005ACA13 /* PrimaryFloatingButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8302D9B2B9EE1D2005ACA13 /* PrimaryFloatingButton.swift */; };
D86632962C2410BB009D3EF5 /* OtpTextInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D86632952C2410BB009D3EF5 /* OtpTextInputView.swift */; };
D887213F2B99992A009DC5BE /* LoaderViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D887213E2B99992A009DC5BE /* LoaderViewModel.swift */; };
D89C933F2BC3C0F800FACD16 /* ForwardIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = D89C933E2BC3C0F800FACD16 /* ForwardIcon.swift */; };
D89C93462BC42DE500FACD16 /* MailComposeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D89C93452BC42DE500FACD16 /* MailComposeView.swift */; };
Expand All @@ -36,8 +37,6 @@
D8D42A6C2B85CDB2009B345D /* Inter-Italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D8D42A612B85CDB2009B345D /* Inter-Italic.ttf */; };
D8D42A6D2B85CDB2009B345D /* inter-semi-bold-italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D8D42A622B85CDB2009B345D /* inter-semi-bold-italic.ttf */; };
D8D42A6E2B85CDB2009B345D /* Inter-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D8D42A632B85CDB2009B345D /* Inter-SemiBold.ttf */; };
D8D42A712B85CDD3009B345D /* Onboard.strings in Resources */ = {isa = PBXBuildFile; fileRef = D8D42A702B85CDD3009B345D /* Onboard.strings */; };
D8D42A732B85CDE0009B345D /* Login.strings in Resources */ = {isa = PBXBuildFile; fileRef = D8D42A722B85CDE0009B345D /* Login.strings */; };
D8D42A772B85CE2A009B345D /* ButtonStyleTapGestureModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8D42A762B85CE2A009B345D /* ButtonStyleTapGestureModifier.swift */; };
D8D42A812B85D07C009B345D /* SecondaryButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8D42A7D2B85D07C009B345D /* SecondaryButton.swift */; };
D8D42A822B85D07C009B345D /* PrimaryButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8D42A7E2B85D07C009B345D /* PrimaryButton.swift */; };
Expand Down Expand Up @@ -74,6 +73,7 @@
CC9EC1F1C0A5A0821118E6CA /* Pods-BaseStyleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BaseStyleTests.debug.xcconfig"; path = "Target Support Files/Pods-BaseStyleTests/Pods-BaseStyleTests.debug.xcconfig"; sourceTree = "<group>"; };
D82174BD2BBAD86D00DB42C3 /* ProfileImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileImageView.swift; sourceTree = "<group>"; };
D8302D9B2B9EE1D2005ACA13 /* PrimaryFloatingButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrimaryFloatingButton.swift; sourceTree = "<group>"; };
D86632952C2410BB009D3EF5 /* OtpTextInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OtpTextInputView.swift; sourceTree = "<group>"; };
D887213E2B99992A009DC5BE /* LoaderViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LoaderViewModel.swift; path = BaseStyle/Views/LoaderViewModel.swift; sourceTree = SOURCE_ROOT; };
D89C933E2BC3C0F800FACD16 /* ForwardIcon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ForwardIcon.swift; sourceTree = "<group>"; };
D89C93452BC42DE500FACD16 /* MailComposeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MailComposeView.swift; sourceTree = "<group>"; };
Expand All @@ -100,8 +100,6 @@
D8D42A612B85CDB2009B345D /* Inter-Italic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Inter-Italic.ttf"; sourceTree = "<group>"; };
D8D42A622B85CDB2009B345D /* inter-semi-bold-italic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "inter-semi-bold-italic.ttf"; sourceTree = "<group>"; };
D8D42A632B85CDB2009B345D /* Inter-SemiBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Inter-SemiBold.ttf"; sourceTree = "<group>"; };
D8D42A702B85CDD3009B345D /* Onboard.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = Onboard.strings; sourceTree = "<group>"; };
D8D42A722B85CDE0009B345D /* Login.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = Login.strings; sourceTree = "<group>"; };
D8D42A762B85CE2A009B345D /* ButtonStyleTapGestureModifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ButtonStyleTapGestureModifier.swift; sourceTree = "<group>"; };
D8D42A782B85CE81009B345D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
D8D42A7D2B85D07C009B345D /* SecondaryButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecondaryButton.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -227,7 +225,6 @@
D89DBE2C2B88828300E5F1BD /* Countries.json */,
D8D42A892B85D525009B345D /* AppColors.swift */,
D8D42A582B85CDB2009B345D /* Fonts */,
D8D42A6F2B85CDB8009B345D /* Localizable */,
);
path = Resource;
sourceTree = "<group>";
Expand All @@ -250,15 +247,6 @@
path = Fonts;
sourceTree = "<group>";
};
D8D42A6F2B85CDB8009B345D /* Localizable */ = {
isa = PBXGroup;
children = (
D8D42A702B85CDD3009B345D /* Onboard.strings */,
D8D42A722B85CDE0009B345D /* Login.strings */,
);
path = Localizable;
sourceTree = "<group>";
};
D8D42A742B85CDF9009B345D /* Extension */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -311,6 +299,7 @@
D8D42AAF2B872E44009B345D /* LoaderView.swift */,
D8D14A4F2BA090F000F45FF2 /* ShareSheetView.swift */,
D89C93452BC42DE500FACD16 /* MailComposeView.swift */,
D86632952C2410BB009D3EF5 /* OtpTextInputView.swift */,
D89DBE3B2B88AA1500E5F1BD /* CustomTextField.swift */,
D82174BD2BBAD86D00DB42C3 /* ProfileImageView.swift */,
D8E244C02B986CD800C6C82A /* ImagePickerView.swift */,
Expand Down Expand Up @@ -415,10 +404,8 @@
buildActionMask = 2147483647;
files = (
D8D42A6E2B85CDB2009B345D /* Inter-SemiBold.ttf in Resources */,
D8D42A712B85CDD3009B345D /* Onboard.strings in Resources */,
D8D42A662B85CDB2009B345D /* inter-heavy-italic.otf in Resources */,
D8D42A6B2B85CDB2009B345D /* Acme-Regular.ttf in Resources */,
D8D42A732B85CDE0009B345D /* Login.strings in Resources */,
D8D42A642B85CDB2009B345D /* Inter-Medium.ttf in Resources */,
D8D42A682B85CDB2009B345D /* Inter-Thin.ttf in Resources */,
D8D42A692B85CDB2009B345D /* Inter-Bold.ttf in Resources */,
Expand Down Expand Up @@ -529,6 +516,7 @@
D8D42AAC2B872A7C009B345D /* ToastView.swift in Sources */,
D8D42A952B85F8A2009B345D /* Bundle+Extension.swift in Sources */,
D89C93462BC42DE500FACD16 /* MailComposeView.swift in Sources */,
D86632962C2410BB009D3EF5 /* OtpTextInputView.swift in Sources */,
D8E244C12B986CD800C6C82A /* ImagePickerView.swift in Sources */,
D89DBE312B8884E300E5F1BD /* SectionHeaderView.swift in Sources */,
D8D42A862B85D08F009B345D /* Font+Extension.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion BaseStyle/BaseStyle/CustomUI/Buttons/PrimaryButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public struct PrimaryButton: View {
.onAppear(perform: loaderModel.onViewAppear)
}

Text(text)
Text(text.localized)
.foregroundStyle(textColor)
}
.frame(maxWidth: .infinity, alignment: .center)
Expand Down
2 changes: 1 addition & 1 deletion BaseStyle/BaseStyle/CustomUI/Buttons/SecondaryButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public struct SecondaryButton: View {
.onAppear(perform: loaderModel.onViewAppear)
}

Text(text)
Text(text.localized)
.font(.buttonText())
.foregroundStyle(.mainPrimary)
}
Expand Down
2 changes: 1 addition & 1 deletion BaseStyle/BaseStyle/CustomUI/CustomTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public struct CustomTextField: UIViewRepresentable {
textField.delegate = context.coordinator
textField.keyboardType = keyboardType
textField.returnKeyType = returnKey
textField.placeholder = placeholder
textField.placeholder = placeholder.localized
textField.tag = tag
textField.textColor = UIColor(primaryText)
textField.textAlignment = textAlignment
Expand Down
61 changes: 61 additions & 0 deletions BaseStyle/BaseStyle/CustomUI/OtpTextInputView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//
// OtpTextInputView.swift
// BaseStyle
//
// Created by Amisha Italiya on 20/06/24.
//

import SwiftUI

public struct OtpTextInputView: View {

private let OTP_TOTAL_CHARACTERS = 6

@Binding var text: String

var isFocused: FocusState<Bool>.Binding
var keyboardType: UIKeyboardType

var onOtpVerify: (() -> Void)?

public init(text: Binding<String>, isFocused: FocusState<Bool>.Binding,
keyboardType: UIKeyboardType = .numberPad, onOtpVerify: ( () -> Void)? = nil) {
self._text = text
self.isFocused = isFocused
self.keyboardType = keyboardType
self.onOtpVerify = onOtpVerify
}

public var body: some View {
VStack(alignment: .center, spacing: 10) {
TextField("", text: $text)
.kerning(16)
.tint(primaryColor)
.font(.subTitle1(34))
.foregroundColor(primaryText)
.multilineTextAlignment(.center)
.keyboardType(keyboardType)
.textContentType(.oneTimeCode)
.disableAutocorrection(true)
.focused(isFocused)
.onChange(of: text) { newValue in
if newValue.count == OTP_TOTAL_CHARACTERS {
onOtpVerify?()
UIApplication.shared.endEditing()
}
}

Divider()
.background(outlineColor)
.padding(.horizontal, 60)
}
.onAppear {
if text.isEmpty {
isFocused.wrappedValue = true
} else {
isFocused.wrappedValue = false
UIApplication.shared.endEditing()
}
}
}
}
38 changes: 31 additions & 7 deletions BaseStyle/BaseStyle/CustomUI/SearchBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,64 @@ import SwiftUI
public struct SearchBar: UIViewRepresentable {

@Binding var text: String
var isFocused: FocusState<Bool>.Binding

var placeholder: String
let placeholder: String
let clearButtonMode: UITextField.ViewMode
let showCancelButton: Bool
let onCancel: (() -> Void)?

public init(text: Binding<String>, placeholder: String) {
public init(text: Binding<String>, isFocused: FocusState<Bool>.Binding, placeholder: String, showCancelButton: Bool = false, clearButtonMode: UITextField.ViewMode = .whileEditing, onCancel: (() -> Void)? = nil) {
self._text = text
self.isFocused = isFocused
self.placeholder = placeholder
self.showCancelButton = showCancelButton
self.clearButtonMode = clearButtonMode
self.onCancel = onCancel
}

public func makeUIView(context: UIViewRepresentableContext<SearchBar>) -> UISearchBar {
let searchBar = UISearchBar(frame: .zero)
searchBar.delegate = context.coordinator
searchBar.placeholder = placeholder
searchBar.autocapitalizationType = .none
searchBar.searchBarStyle = .minimal
searchBar.showsCancelButton = showCancelButton
searchBar.searchTextField.clearButtonMode = clearButtonMode
return searchBar
}

public func updateUIView(_ uiView: UISearchBar, context: UIViewRepresentableContext<SearchBar>) {
uiView.text = text
uiView.text = text.localized
}

public func makeCoordinator() -> SearchBar.Coordinator {
return Coordinator(text: $text)
return Coordinator(text: $text, isFocused: isFocused, onCancel: onCancel)
}

public class Coordinator: NSObject, UISearchBarDelegate {

@Binding var text: String

public init(text: Binding<String>) {
_text = text
var isFocused: FocusState<Bool>.Binding
let onCancel: (() -> Void)?

public init(text: Binding<String>, isFocused: FocusState<Bool>.Binding, onCancel: (() -> Void)?) {
self._text = text
self.isFocused = isFocused
self.onCancel = onCancel
}

public func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
text = searchText
}

public func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
if !text.isEmpty {
text = ""
isFocused.wrappedValue = true
} else {
onCancel?()
}
}
}
}
Loading

0 comments on commit 43a990a

Please sign in to comment.