Skip to content

Commit

Permalink
Merge pull request #415 from PermanentOrg/feature/VSP-1379-Add-tablet…
Browse files Browse the repository at this point in the history
…-support

VSP-1379[IOS] Add tablet support
  • Loading branch information
luciancerbu-vsp authored Feb 26, 2024
2 parents da825ba + c1e4fd6 commit 60b600e
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 30 deletions.
40 changes: 24 additions & 16 deletions Permanent.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5257,7 +5257,7 @@
CODE_SIGN_ENTITLEMENTS = Permanent/Resources/Assets/Entitlements/Permanent.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
ENV_VARS_FILENAME = "env-vars.sh";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
Expand All @@ -5272,6 +5272,8 @@
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.PermanentArchive;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
Expand All @@ -5286,7 +5288,7 @@
CODE_SIGN_ENTITLEMENTS = Permanent/Resources/Assets/Entitlements/PermanentRelease.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
ENV_VARS_FILENAME = "env-vars.sh";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
Expand All @@ -5300,6 +5302,8 @@
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.PermanentArchive;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
Expand All @@ -5311,7 +5315,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -5332,7 +5336,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -5353,7 +5357,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -5374,7 +5378,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -5494,7 +5498,7 @@
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtensionDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -5528,7 +5532,7 @@
CODE_SIGN_ENTITLEMENTS = "ShareExtension/ShareExtensionDEV-Debug.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -5562,7 +5566,7 @@
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtensionRelease.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -5596,7 +5600,7 @@
CODE_SIGN_ENTITLEMENTS = "ShareExtension/ShareExtensionDEV-Release.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -5691,7 +5695,7 @@
CODE_SIGN_ENTITLEMENTS = "Permanent/Resources/Assets/Entitlements/PermanentDEV-Debug.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
ENV_VARS_FILENAME = "env-vars-staging.sh";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
Expand All @@ -5706,6 +5710,8 @@
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.permanent.staging;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
Expand Down Expand Up @@ -5774,7 +5780,7 @@
CODE_SIGN_ENTITLEMENTS = "Permanent/Resources/Assets/Entitlements/Permanent-Staging.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
ENV_VARS_FILENAME = "env-vars-staging.sh";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
Expand All @@ -5789,6 +5795,8 @@
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.permanent.staging;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
Expand All @@ -5800,7 +5808,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
INFOPLIST_FILE = PushExtension/Info.plist;
Expand All @@ -5825,7 +5833,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
INFOPLIST_FILE = PushExtension/Info.plist;
Expand All @@ -5850,7 +5858,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
INFOPLIST_FILE = PushExtension/Info.plist;
Expand All @@ -5875,7 +5883,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 116;
CURRENT_PROJECT_VERSION = 119;
DEVELOPMENT_TEAM = C8YKZNBVWT;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
INFOPLIST_FILE = PushExtension/Info.plist;
Expand Down
4 changes: 1 addition & 3 deletions Permanent/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,7 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
}

extension AppDelegate {
static var orientationLock = UIInterfaceOrientationMask.all

func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
return AppDelegate.orientationLock
return Constants.Design.orientationLock
}
}
4 changes: 3 additions & 1 deletion Permanent/Common/Constants/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct Constants {
struct AccountStatus {}
struct InviteStatus {}
struct NotificationType {}
struct Locations{}
struct Locations {}
}

struct Design {}
Expand Down Expand Up @@ -99,6 +99,8 @@ extension Constants.Design {
static let avatarRadius: CGFloat = 17.0
static let shortNotificationBarAnimationDuration: Double = 0.8
static let longNotificationBarAnimationDuration: Double = 2.2
static let orientationLock: UIInterfaceOrientationMask = UIDevice.current.userInterfaceIdiom == .phone ? .portrait : .landscape
static let currentPlatform = UIDevice.current.userInterfaceIdiom
}

extension Constants.API {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1043,8 +1043,13 @@ extension MainViewController: FABViewDelegate {
return
}

actionSheet.delegate = self
navigationController?.display(viewController: actionSheet, modally: true)
///To Do: for iPad another presentation mode for this menu should be implemented
if Constants.Design.currentPlatform == .phone {
actionSheet.delegate = self
navigationController?.display(viewController: actionSheet, modally: true)
} else {
return
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ class NavigationController: UINavigationController {
}

override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return UIDevice.current.userInterfaceIdiom == .phone ? [.portrait] : [.all]
return Constants.Design.currentPlatform == .phone ? [.portrait] : [.landscape]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1285,9 +1285,13 @@ extension SharesViewController: FABViewDelegate {
showAlert(title: .error, message: .errorMessage)
return
}

actionSheet.delegate = self
navigationController?.display(viewController: actionSheet, modally: true)
///To Do: for iPad another presentation mode for this menu should be implemented
if Constants.Design.currentPlatform == .phone {
actionSheet.delegate = self
navigationController?.display(viewController: actionSheet, modally: true)
} else {
return
}
}
}

Expand Down
4 changes: 0 additions & 4 deletions Permanent/Resources/Assets/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,9 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
Expand Down

0 comments on commit 60b600e

Please sign in to comment.