Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions apps/expo-go/ios/Client/EXRootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,6 @@ - (BOOL)isNuxFinished

- (void)appDidFinishLoadingSuccessfully:(EXKernelAppRecord *)appRecord
{
// show nux if needed
if (!self.isNuxFinished && appRecord == [EXKernel sharedInstance].visibleApp) {
[DevMenuManager.shared openMenu];
}

// Re-apply the default orientation after the app has been loaded (eq. after a reload)
[self _applySupportedInterfaceOrientations];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,9 @@ - (BOOL)requiresValidManifests

- (void)showDevMenu
{
if ([self enablesDeveloperTools]) {
dispatch_async(dispatch_get_main_queue(), ^{
[[DevMenuManager shared] toggleMenu];
});
}
dispatch_async(dispatch_get_main_queue(), ^{
[[DevMenuManager shared] toggleMenu];
});
}

- (void)reloadApp
Expand Down
4 changes: 2 additions & 2 deletions apps/expo-go/ios/Exponent/Supporting/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>55.0.5</string>
<string>55.0.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down Expand Up @@ -61,7 +61,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>55.0.5</string>
<string>55.0.6</string>
<key>FacebookAdvertiserIDCollectionEnabled</key>
<false/>
<key>FacebookAppID</key>
Expand Down
2 changes: 1 addition & 1 deletion apps/expo-go/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4724,7 +4724,7 @@ SPEC CHECKSUMS:
GoogleAppMeasurement: 8a82b93a6400c8e6551c0bcd66a9177f2e067aed
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
hermes-engine: 5fe31775fd37ae963dff271e227decb44d08e843
hermes-engine: d7a9424b7191b73c5c774d04fc2e147dd400e67f
libavif: 84bbb62fb232c3018d6f1bab79beea87e35de7b7
libdav1d: 23581a4d8ec811ff171ed5e2e05cd27bad64c39f
libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8
Expand Down
6 changes: 6 additions & 0 deletions packages/expo-dev-menu/ios/DevMenuManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ open class DevMenuManager: NSObject {
manifestSubject.eraseToAnyPublisher()
}

private let menuWillShowSubject = PassthroughSubject<Void, Never>()
public var menuWillShowPublisher: AnyPublisher<Void, Never> {
menuWillShowSubject.eraseToAnyPublisher()
}

@objc
public private(set) var currentManifest: Manifest? {
didSet {
Expand Down Expand Up @@ -358,6 +363,7 @@ open class DevMenuManager: NSObject {
return false
}
if visible {
menuWillShowSubject.send()
setCurrentScreen(screen)
DispatchQueue.main.async {
#if os(macOS)
Expand Down
16 changes: 16 additions & 0 deletions packages/expo-dev-menu/ios/SwiftUI/DevMenuColors.swift
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
import SwiftUI
import ExpoModulesCore

#if os(macOS)
import AppKit
#else
import UIKit
#endif

struct DevMenuColors {
let colorScheme: ColorScheme

// Tip colors (blue.11 and blue.3)
var tipBlue: Color {
#if os(macOS)
let darkColor = NSColor(displayP3Red: 0.49, green: 0.72, blue: 1.0, alpha: 1.0)
let lightColor = NSColor(displayP3Red: 0.15, green: 0.44, blue: 0.84, alpha: 1.0)
#else
let darkColor = UIColor(displayP3Red: 0.49, green: 0.72, blue: 1.0, alpha: 1.0)
let lightColor = UIColor(displayP3Red: 0.15, green: 0.44, blue: 0.84, alpha: 1.0)
#endif
return Color(colorScheme == .dark ? darkColor : lightColor)
}

var tipBackground: Color {
#if os(macOS)
let darkColor = NSColor(displayP3Red: 0.078, green: 0.154, blue: 0.27, alpha: 1.0)
let lightColor = NSColor(displayP3Red: 0.912, green: 0.956, blue: 0.991, alpha: 1.0)
#else
let darkColor = UIColor(displayP3Red: 0.078, green: 0.154, blue: 0.27, alpha: 1.0)
let lightColor = UIColor(displayP3Red: 0.912, green: 0.956, blue: 0.991, alpha: 1.0)
#endif
return Color(colorScheme == .dark ? darkColor : lightColor)
}
}
2 changes: 2 additions & 0 deletions packages/expo-dev-menu/ios/SwiftUI/DevMenuMainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ struct DevMenuMainView: View {
}
.environmentObject(viewModel)
.navigationTitle("Dev Menu")
#if !os(macOS)
.navigationBarHidden(true)
#endif
}
}
12 changes: 11 additions & 1 deletion packages/expo-dev-menu/ios/SwiftUI/DevMenuRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import SwiftUI

struct DevMenuRootView: View {
@StateObject private var viewModel = DevMenuViewModel()
@State private var navigationId = UUID()

var body: some View {
let mainView = VStack(spacing: 0) {
Expand All @@ -24,11 +25,20 @@ struct DevMenuRootView: View {
#if !os(macOS)
NavigationView {
mainView
}.navigationViewStyle(.stack)
}
.navigationViewStyle(.stack)
.id(navigationId)
.onReceive(DevMenuManager.shared.menuWillShowPublisher) { _ in
navigationId = UUID()
}
#else
NavigationStack {
mainView
}
.id(navigationId)
.onReceive(DevMenuManager.shared.menuWillShowPublisher) { _ in
navigationId = UUID()
}
#endif
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/expo-dev-menu/ios/SwiftUI/DevMenuViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class DevMenuViewModel: ObservableObject {
}

func copyToClipboard(_ content: String) {
#if !os(tvOS)
#if !os(tvOS) && !os(macOS)
UIPasteboard.general.string = content
hostUrlCopiedMessage = "Copied!"

Expand All @@ -120,7 +120,7 @@ class DevMenuViewModel: ObservableObject {
}

func copyAppInfo() {
#if !os(tvOS)
#if !os(tvOS) && !os(macOS)
guard let appInfo = appInfo else {
return
}
Expand Down
30 changes: 29 additions & 1 deletion packages/expo-dev-menu/ios/SwiftUI/HeaderView.swift
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
import SwiftUI
import ExpoModulesCore

#if os(macOS)
import AppKit
typealias PlatformImage = NSImage
#else
import UIKit
typealias PlatformImage = UIImage
#endif

struct HeaderView: View {
@EnvironmentObject var viewModel: DevMenuViewModel
@State private var appIcon: UIImage? = nil
@State private var appIcon: PlatformImage? = nil

var body: some View {
HStack(spacing: 12) {
#if os(macOS)
if let icon = appIcon {
Image(nsImage: icon)
.resizable()
.scaledToFit()
.frame(width: 38, height: 38)
.clipShape(RoundedRectangle(cornerRadius: 16))
}
#else
if let icon = appIcon {
Image(uiImage: icon)
.resizable()
.scaledToFit()
.frame(width: 38, height: 38)
.clipShape(RoundedRectangle(cornerRadius: 16))
}
#endif

versionInfo

Expand Down Expand Up @@ -55,13 +73,23 @@ struct HeaderView: View {
}

if url.isFileURL {
#if os(macOS)
appIcon = NSImage(contentsOfFile: url.path)
#else
appIcon = UIImage(contentsOfFile: url.path)
#endif
} else {
do {
let (data, _) = try await URLSession.shared.data(from: url)
#if os(macOS)
if let loadedImage = NSImage(data: data) {
appIcon = loadedImage
}
#else
if let loadedImage = UIImage(data: data) {
appIcon = loadedImage
}
#endif
} catch {
appIcon = nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ struct SourceMapExplorerView: View {
}
}
.navigationTitle("Source Code Explorer")
#if !os(macOS)
.navigationBarTitleDisplayMode(.inline)
#endif
.searchable(text: $viewModel.searchText, placement: .automatic, prompt: "Search files")
.task {
await viewModel.loadSourceMap()
Expand Down Expand Up @@ -101,8 +103,11 @@ struct FolderListView: View {
}
}
}
#if !os(macOS)
.listStyle(.insetGrouped)
#endif
.navigationTitle(isSearching ? "Search Results" : title)
#if !os(macOS)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Expand All @@ -116,6 +121,7 @@ struct FolderListView: View {
}
}
}
#endif
}
}

Expand Down Expand Up @@ -216,7 +222,9 @@ struct CodeFileView: View {
}
.background(theme.background)
.navigationTitle(node.name)
#if !os(macOS)
.navigationBarTitleDisplayMode(.inline)
#endif
.task(id: colorScheme) {
highlightedLines = await SyntaxHighlighter.highlightLines(lines, theme: theme)
}
Expand Down
Loading