Home Blog

ios – Learn how to repair the gestureRecognizer over PDFKit breaking the paging within the new ios26 model?


I had mission going nice, the place i wanted to do stuff with pdfs, drawing on prime them and so on. Since apple is all closed sourced i wanted to turn out to be a bit hacky. In any case, i’ve an issue because the new ios 26 replace which breaks the behaviour. I simplified the code very a lot right into a demo mission, the place you possibly can rapidly see what’s mistaken.

When swiping left to go to the subsequent web page, it does change the web page and so on within the pdf Doc, however visually nothing occurs. I’m caught on the primary web page. I dont know what to do, tried plenty of issues, however nothing works. Anybody expert sufficient to assist me out?

import UIKit
import PDFKit
import SwiftUI

class PDFViewController: UIViewController {
    
    var pdfView: PDFView!
    var gestureHandler: GestureHandler!

    override func viewDidLoad() {
        tremendous.viewDidLoad()
        setupPDFView()
        setupGestureHandler()
        loadPDF()
    }
    
    personal func setupPDFView() {
        pdfView = PDFView(body: view.bounds)
        
        // Your actual configuration
        pdfView.autoScales = true
        pdfView.pageShadowsEnabled = false
        pdfView.backgroundColor = .white
        pdfView.displayMode = .singlePage
        
        view.addSubview(pdfView)
        
        // Setup constraints
        pdfView.translatesAutoresizingMaskIntoConstraints = false
        NSLayoutConstraint.activate([
            pdfView.topAnchor.constraint(equalTo: view.topAnchor),
            pdfView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
            pdfView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
            pdfView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
        ])
    }
  
  personal func setupGestureHandler() {
          gestureHandler = GestureHandler(pdfView: pdfView)
          gestureHandler.setupSwipeGestures(on: view)
      }
    
    personal func loadPDF() {
        if let path = Bundle.principal.path(forResource: "sonate12", ofType: "pdf"),
           let doc = PDFDocument(url: URL(fileURLWithPath: path)) {
            pdfView.doc = doc
        } else {
            print("Couldn't discover sonate12.pdf in bundle")
        }
    }
}


class GestureHandler {
    
    personal weak var pdfView: PDFView?
    
    init(pdfView: PDFView) {
        self.pdfView = pdfView
    }
    
    func setupSwipeGestures(on view: UIView) {
        // Left swipe - go to subsequent web page
        let leftSwipe = UISwipeGestureRecognizer(goal: self, motion: #selector(handleSwipe(_:)))
        leftSwipe.route = .left
        view.addGestureRecognizer(leftSwipe)
        
        // Proper swipe - go to earlier web page
        let rightSwipe = UISwipeGestureRecognizer(goal: self, motion: #selector(handleSwipe(_:)))
        rightSwipe.route = .proper
        view.addGestureRecognizer(rightSwipe)
    }
    
    @objc personal func handleSwipe(_ gesture: UISwipeGestureRecognizer) {
        guard let pdfView = pdfView,
              let doc = pdfView.doc,
              let currentPage = pdfView.currentPage else {
            print("🚫 No PDF view, doc, or present web page out there")
            return
        }
        
        let currentIndex = doc.index(for: currentPage)
        let totalPages = doc.pageCount
        
        print("πŸ“„ Present state: Web page (currentIndex + 1) of (totalPages)")
        print("πŸ‘† Swipe route: (gesture.route == .left ? "LEFT (subsequent)" : "RIGHT (earlier)")")
        
        swap gesture.route {
        case .left:
            // Subsequent web page
            guard currentIndex < doc.pageCount - 1 else {
                print("🚫 Already on final web page ((currentIndex + 1)), can not go ahead")
                return
            }
            
            let nextPage = doc.web page(at: currentIndex + 1)
            if let web page = nextPage {
                print("➑️ Going to web page (currentIndex + 2)")
                pdfView.go(to: web page)
              pdfView.setNeedsDisplay()
              pdfView.layoutIfNeeded()
                // Test if navigation truly labored
                DispatchQueue.principal.asyncAfter(deadline: .now() + 0.1) {
                    if let newCurrentPage = pdfView.currentPage {
                        let newIndex = doc.index(for: newCurrentPage)
                        print("βœ… Navigation consequence: Now on web page (newIndex + 1)")
                        if newIndex == currentIndex {
                            print("⚠️ WARNING: Web page did not change visually!")
                        }
                    }
                }
            } else {
                print("🚫 Couldn't get subsequent web page object")
            }
            
        case .proper:
            // Earlier web page
            guard currentIndex > 0 else {
                print("🚫 Already on first web page (1), can not return")
                return
            }
            
            let previousPage = doc.web page(at: currentIndex - 1)
            if let web page = previousPage {
                print("⬅️ Going to web page (currentIndex)")
                pdfView.go(to: web page)
              pdfView.setNeedsDisplay()
              pdfView.layoutIfNeeded()
              let bounds = pdfView.bounds
              pdfView.bounds = CGRect(x: bounds.origin.x, y: bounds.origin.y, width: bounds.width + 0.01, peak: bounds.peak)
              pdfView.bounds = bounds

                
                // Test if navigation truly labored
                DispatchQueue.principal.asyncAfter(deadline: .now() + 0.1) {
                    if let newCurrentPage = pdfView.currentPage {
                        let newIndex = doc.index(for: newCurrentPage)
                        print("βœ… Navigation consequence: Now on web page (newIndex + 1)")
                        if newIndex == currentIndex {
                            print("⚠️ WARNING: Web page did not change visually!")
                        }
                    }
                }
            } else {
                print("🚫 Couldn't get earlier web page object")
            }
            
        default:
            print("πŸ€·β€β™‚οΈ Unknown swipe route")
            break
        }
    }
}


struct PDFViewerRepresentable: UIViewControllerRepresentable {
    func makeUIViewController(context: Context) -> PDFViewController {
        return PDFViewController()
    }
    
    func updateUIViewController(_ uiViewController: PDFViewController, context: Context) {
        // No updates wanted
    }
}

You may take a look at the code right here as effectively: https://github.com/vallezw/swift-bug-ios26

goal c – iOS Dylib crashes when printed to testflight with CODESIGNING 2 Invalid Web page


It is a prolonged one. I’ve mainly compiled a Rust binary right into a dylib and packaged right into a .xcframework that incorporates per arch .frameworks. This hundreds accurately when run from Xcode into an actual iOS gadget. Nonetheless, when deployed to TestFlight the app crashes.

Here’s what is a bit completely different, the dylib just isn’t absolutely self-contained. It tries to succeed in in an use C features I’ve uncovered in my library code. Calling features which can be simply inside the dylib and simply return works tremendous, however the second it tries to name one of many uncovered features it crashes.

A full in-depth step-by-step of how I packaged the binaries might be present in my web site:

https://ospfranco.com/complete-guide-to-dylibs-in-ios-and-android

After I have a look at the TestFlight crash report there aren’t any symbols however the termination trigger by way of WatchDog is:

Termination Purpose: CODESIGNING 2 Invalid Web page

I’ve declared my features as such:

OBJC_EXTERN void ios_prepare_request(const char *url)
#outline EXPORT __attribute__((visibility("default"), used, retain))
 
extern "C" {
 
EXPORT void ios_prepare_request(const char *url) {
  NSString *urlString = [NSString stringWithUTF8String:url];
  request =
      [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]];
}
 
}
 
// Perform used to stop optimization
void force_symbol_registration() {
  // Pressure these symbols to be included within the binary by referencing them
  risky void *ptrs[] = {(void *)ios_prepare_request,};
 
  // Stop compiler from optimizing away the array
  (void)ptrs;
}

And I load my framework as:

  opacity::force_symbol_registration();
 
  // NSBundle *dylib_bundle =
  //     [NSBundle bundleWithIdentifier:@"com.opacitylabs.sdk"];
  // NSString *dylib_path = [dylib_bundle pathForResource:@"sdk" ofType:@""];
 
  // // Load the dynamic library
  // void *deal with = dlopen([dylib_path UTF8String], RTLD_NOW | RTLD_GLOBAL);
  // if (!deal with) {
  //   NSString *errorMessage = [NSString stringWithUTF8String:dlerror()];
  //   *error =
  //       [NSError errorWithDomain:@"OpacitySDKDylibError"
  //                           code:1002
  //                       userInfo:@{NSLocalizedDescriptionKey :
  //                       errorMessage}];
  //   return -1; // or applicable error code
  // }
 
  // Be sure that the principle executable's symbols can be found
  dlopen(NULL, RTLD_NOW | RTLD_GLOBAL);
 
  NSBundle *frameworkBundle =
      [NSBundle bundleWithIdentifier:@"com.opacitylabs.sdk"];
  if (![frameworkBundle isLoaded]) {
    BOOL success = [frameworkBundle load];
    if (!success) {
      NSString *errorMessage = @"Did not load framework";
      *error =
          [NSError errorWithDomain:@"OpacitySDKDylibError"
                              code:1002
                          userInfo:@{NSLocalizedDescriptionKey : errorMessage}];
      return -1;
    }
  }
  • As you may see, I’ve additionally tried dlopen each work when run from Xcode however crash when deployed on testflight.
  • I’ve tried re-signing the xcframework/frameworks on a pre construct step but it surely would not work
  • As acknowledged, I can name the features contained in the dylib, however as soon as they attempt to name my uncovered code it crashes

Is that this achievable in any respect or only a limitation of the iOS sandbox?

ios – Flutter construct fails when operating flutter from distant machine


Replace:
I attempted to explicitly permit the script entry to the keychain. I additionally briefly tried to provide entry to all customers. Each did not change something

I am at present establishing my dev atmosphere for creating an app with flutter. I attempted to set it up in order that i can develop(code) on home windows whereas testing the app on IOS. The movement I am attempting to get working is as follows:

  • code on home windows
  • git commit -> git push
  • `ssh me@my-mac ‘run_flutter.sh’
  • app builds on my mac and begins on my iphone

I at present am capable of construct the app on my mac and it begins on my iphone when i construct straight from my mac, however once I run the very same script by way of ssh from my home windows machine, the construct fails at signing it appears.

When i run the construct with verbose, this will get outputted:

           CodeSign /Customers/me/initiatives/myapp/construct/ios/Debug-iphoneos/Runner.app/Runner.debug.dylib (in goal 'Runner' from undertaking 'Runner')
               cd /Customers/me/initiatives/myapp/ios

               Signing Identification:     "Apple Growth: Me and Myself (A7656WTX4N)"
               Provisioning Profile: "iOS Crew Provisioning Profile: *"
                                     (4647d7e2-7941-45d0-a979-74d3b34f531c)

               /usr/bin/codesign --force --sign 211CD423578576BD70699D85C6340647A7BC686D --timestamp=none --generate-entitlement-der /Customers/me/initiatives/myapp/construct/ios/Debug-iphoneos/Runner.app/Runner.debug.dylib
           /Customers/me/initiatives/myapp/construct/ios/Debug-iphoneos/Runner.app/Runner.debug.dylib: errSecInternalComponent
           Command CodeSign failed with a nonzero exit code


           End result bundle written to path:
                /var/folders/ld/zczp5nks4sv8yffcmxs4thf80000gn/T/flutter_tools.amI6MP/flutter_ios_build_temp_dirNWMU5p/temporary_xcresult_bundle


           ** BUILD FAILED **


           The next construct instructions failed:
                CodeSign /Customers/me/initiatives/myapp/construct/ios/Debug-iphoneos/Runner.app/Runner.debug.dylib (in goal 'Runner' from undertaking 'Runner')
                Constructing workspace Runner with scheme Runner and configuration Debug
           (2 failures)
[   +7 ms] Operating Xcode construct... (accomplished in 6,7s)
[        ] Xcode construct carried out.                                            6,7s
[   +2 ms] executing: /usr/bin/arch -arm64e xcrun xcresulttool get --legacy --path /var/folders/ld/zczp5nks4sv8yffcmxs4thf80000gn/T/flutter_tools.amI6MP/flutter_ios_build_temp_dirNWMU5p/temporary_xcresult_bundle --format json

Flutter iOS: “A number of instructions produce .app” error on Xcode 16.4. Even legacy construct system fails


I preserve getting these “A number of instructions produce” errors when constructing my Flutter iOS app. This began after updating to macOS 15.6 and Xcode 16.4.

Error:

Error (Xcode): A number of instructions produce ‘/Customers/tafseerapp/Tafseer/construct/ios/Debug-iphonesimulator/.app’
word: Goal ‘Runner’ (challenge ‘Runner’) has create listing command with output
word: Goal ‘Runner’ (challenge ‘Runner’) has hyperlink command with output

Setting:

macOS: 15.6 (24G84)

Xcode: 16.4 (Construct model 16F6)

Flutter: 3.32.8 (newest secure). Additionally tried beta channel

CocoaPods: 1.16.2

Account: Secondary person account (not admin)

Present Podfile:

platform :ios, '13.0'
set up! 'cocoapods', :disable_input_output_paths => true
set up! 'cocoapods', :disable_input_output_paths => true
set up! 'cocoapods', :disable_input_output_paths => true
set up! 'cocoapods', :disable_input_output_paths => true

# CocoaPods analytics sends community stats synchronously affecting flutter construct latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

challenge 'Runner', {
  'Debug' => :debug,
  'Profile' => :launch,
  'Launch' => :launch,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.be part of('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  until File.exist?(generated_xcode_build_settings_path)
    elevate "#{generated_xcode_build_settings_path} should exist. Should you're working pod set up manually, ensure flutter pub get is executed first"
  finish

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT=(.*)/)
    return matches[1].strip if matches
  finish
  elevate "FLUTTER_ROOT not present in #{generated_xcode_build_settings_path}. Strive deleting Generated.xcconfig, then run flutter pub get"
finish

require File.expand_path(File.be part of('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

goal 'Runner' do
  use_frameworks!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  goal 'RunnerTests' do
    inherit! :search_paths
  finish
finish

post_install do |installer|
  installer.pods_project.targets.every do |goal|
    flutter_additional_ios_build_settings(goal)
  finish
finish

What I’ve Tried:

Legacy Construct System
Firebase SDK downgrade (11.8.0 β†’ 10.x variations);
Flutter beta channel
set up! ‘cocoapods’, :disable_input_output_paths => true
Full pod deintegrate/reinstall
Checked Copy Bundle Sources (no Data.plist duplicates)
flutter create . to regenerate iOS challenge;
Permissions repair: sudo chown -R $USER ~/Library/Developer/Xcode/DerivedData
Created minimal Flutter app (builds efficiently with out Firebase)

Key findings:

Minimal Flutter app with out Firebase builds fantastic
Identical error persists even with legacy construct system
Verbose output reveals gRPC-related warnings (Firebase dependencies)
Construct phases look regular (no apparent duplicates)

What else might trigger “A number of instructions produce” when even legacy construct system fails? This appears to be particular to Firebase + Xcode 16.4 + macOS 15.6 mixture.

Nano structured oxyhalide catalyst delivers document photo voltaic gasoline effectivity


Nano structured oxyhalide catalyst delivers document photo voltaic gasoline effectivity

by Riko Seibo

Tokyo, Japan (SPX) Aug 01, 2025






In a serious stride for solar-driven gasoline era, scientists from the Institute of Science Tokyo have engineered a nanoscale, porous photocatalyst that dramatically boosts hydrogen manufacturing from water and carbon dioxide conversion into formic acid utilizing daylight. The novel material-Pb2Ti2O5.4F1.2 (PTOF)-demonstrated roughly 60 occasions the exercise of beforehand reported oxyhalide photocatalysts.



Photocatalysts allow using daylight to drive chemical reactions. Upon absorbing gentle, they produce electrons and holes, which then provoke reactions resembling hydrogen manufacturing and CO2 conversion. PTOF stands out amongst these supplies as a result of its capability to soak up seen gentle and its resistance to oxidative degradation.



Led by Professors Kazuhiko Maeda of Science Tokyo and Osamu Ishitani of Hiroshima College, the analysis staff created extremely porous PTOF nanoparticles utilizing a microwave-assisted hydrothermal course of. Revealed on-line July 09, 2025 and within the July 18 challenge of ACS Catalysis, their work gives a blueprint for scalable, inexperienced photocatalytic materials design.



“The synthesis technique established on this examine permits world-leading photocatalytic efficiency for H2 manufacturing and the conversion of CO2 into formic acid amongst oxyhalide photocatalysts, utilizing an environmentally pleasant course of,” stated Maeda.



The important thing to their strategy lies in particle measurement and morphology management. By minimizing particle measurement, the staff diminished the journey distance for photogenerated cost carriers, decreasing recombination charges. In contrast to typical strategies that threat structural defects, their method preserved catalytic integrity.



The staff examined totally different water-soluble titanium complexes-based on citric, tartaric, and lactic acids-as titanium sources, alongside lead nitrate and potassium fluoride. The traditional titanium chloride precursor yielded bigger, much less porous particles (~0.5-1 um, floor space ~2.5 m2g-1), whereas the optimized technique produced nanoparticles beneath 100 nm with floor areas round 40 m2g-1.



Catalytic testing confirmed outstanding outcomes. Citric acid-derived PTOF achieved a sixtyfold improve in hydrogen manufacturing in comparison with the TiCl4-based pattern, with a quantum yield of 15% at 420 nm. For CO2-to-formic acid conversion, tartaric acid-derived PTOF reached a ten% quantum yield when mixed with a molecular ruthenium photocatalyst-both values setting new efficiency information for this class of supplies.



Regardless of their smaller measurement correlating with decrease cost mobility, the proximity of floor response websites enhanced total photocatalytic effectivity. This highlights how nanostructuring can overcome typical limitations in photocatalyst design.



The staff’s microwave-assisted synthesis gives a scalable, low-temperature pathway for fabricating high-performance photocatalysts. “This examine underscores the significance of controlling the morphology of oxyhalides to unlock their full potential as photocatalysts for synthetic photosynthesis. These findings are anticipated to considerably contribute to the event of revolutionary supplies that assist tackle international vitality challenges,” Maeda concluded.



Analysis Report:Mesoporous Oxyhalide Aggregates Exhibiting Improved Photocatalytic Exercise for Seen-Mild H2 Evolution and CO2 Discount


Associated Hyperlinks

Institute of Science Tokyo

All About Photo voltaic Vitality at SolarDaily.com