How can I access files stored in the `user_data_dir` directory on an iOS device from Kivy?

I save a PDF file in the user data directory in an iOS app with this code

c = canvas.Canvas(Main.get_running_app().user_data_dir+"/"+filename)
c.save()

However, I'm not sure that it really works because I can not find a way to open the file on an iOS device.

I've already checked the Files application in iOS and the PDF is not there. I've also tried to open the file with code using Webbrowser:
wb.open_new(Main.get_running_app().user_data_dir) But that does not work either. Any help would be greatly appreciated.

ios – UITableView error – Stack overflow

Gentlemen, how are you?
I have problems with UITableView and UITableViewCell, when I try to pass information from a selected UITableViewCell to another screen gives me this error

'NSInternalInconsistencyException', reason: '-(UITableViewController 
loadView) instantiated view controller with identifier 
"WorldCupViewController" from storyboard "Main", but didn't get a 
UITableView.'

FistViewController

class FistTableViewController: UITableViewController {

var infosCups: (WordCop) = ()
override func viewDidLoad() {
    super.viewDidLoad()
    loadWordCups()
    // Uncomment the following line to preserve selection between 
    presentations

}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    let vc =  segue.destination as! WorldCupViewController
    let worldCup = worldCups(tableView.indexPathForSelectedRow!.row)
    vc.worldCupTeste = worldCup
}

func loadWordCups(){
    let fileURL = Bundle.main.url(forResource: "winners.json", withExtension: nil)!
    let jsonData = try! Data(contentsOf: fileURL)
    do {
        worldCups = try JSONDecoder().decode((WordCop).self, from: jsonData)
    }catch{
        print(error.localizedDescription)
    }
}
// MARK: - Table view data source

override func numberOfSections(in tableView: UITableView) -> Int {
    // #warning Incomplete implementation, return the number of sections
    return 1
}

override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    // #warning Incomplete implementation, return the number of rows
    return worldCups.count
}


override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! WorldCupTableViewCell

    // Configure the cell...
    let worldCup = worldCups(indexPath.row)
    cell.prepare(with: worldCup)
    return cell
}
}

SegundTableViewController

class WorldCupViewController: UITableViewController{


var worldCupTeste: WordCop!

override func viewDidLoad() {
    super.viewDidLoad()
    print(worldCupTeste.country)


}

// MARK: - Table view data source

override func numberOfSections(in tableView: UITableView) -> Int {
    // #warning Incomplete implementation, return the number of sections
    return 1
}

override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    // #warning Incomplete implementation, return the number of rows
    return 1
}

}

TableViewCell

class WorldCupTableViewCell: UITableViewCell {

@IBOutlet weak var lbYear: UILabel!
@IBOutlet weak var ivWinner: UIImageView!
@IBOutlet weak var ivVice: UIImageView!
@IBOutlet weak var lbWinner: UILabel!
@IBOutlet weak var lbVice: UILabel!
@IBOutlet weak var lbWinnerScore: UILabel!
@IBOutlet weak var lbViceScore: UILabel!
@IBOutlet weak var lbCountry: UILabel!



override func awakeFromNib() {
    super.awakeFromNib()
    // Initialization code
}

override func setSelected(_ selected: Bool, animated: Bool) {
    super.setSelected(selected, animated: animated)

    // Configure the view for the selected state
}
func prepare(with cup: WordCop ){
    lbYear.text = "(cup.year)"
    ivWinner.image = UIImage(named: cup.winner)
    ivVice.image = UIImage(named: cup.vice)
    lbWinner.text = String(cup.winner)
    lbVice.text = cup.vice
    lbWinnerScore.text = cup.winnerScore
    lbViceScore.text = cup.viceScore
    lbCountry.text = cup.country
}

}

Where can I go wrong?

Is there a single, free version of the iPhone XR or iOS 12 Guidebook?

Is there a free, downloadable, single file version of the iPhone XR or iOS 12 manual with which it is installed? I mean downloadable for example as a .pdf file and without being connected to an Apple server from a real iPhone XR.

ios – The ARFaceAnchor geometry does not change immediately after the start of tracking a new face

I write an application on the latest iPad Pro and it must access the geometry of the face in order to interact only with the first user detected. Unfortunately, the geometry of the faces has a long adjustment time: each time a new face appears, the geometry of the last is used for the next five seconds, before an update finally "matches" it to the new face. The second user can interact with the application in the meantime, which is undesirable.

How to reset the geometry so that it is created from scratch every time? I have tried to remove the anchor to which the geometry belongs each time the corresponding node is hidden (the face is no longer present) in rendering (method _: didUpdate: for 🙂 but the next face still gets the available geometry before updating its own.

swift – Calendar and iOS navigation

In order to explore the operation of the default calendar application and to experiment container view controllers, I have created the following fictional application. See this post for more information on my motivation for this app. This application only explores basic changes in navigation and calendar orientation.

I chose a design that uses a UINavigationController wherein a container view controller is integrated as the main view in the root view controller. This integrated view controller would be the actual timing of the application. The plan is to use JTAppleCalendar to implement the calendar feature. As it seems that I only need one calendar controller and that I can switch between different calendar layouts (day view, 3 day view, 5 day view, month view) , the main role of the navigation controller is to switch between these different presentations. I've also added a straight bar button and toolbar to push new VCs like a standard navigation controller.

With this application, I am particularly concerned about the button element of the left bar and the segmented control of the title view, as well as by the operation of the portrait and landscape and by the control of the presentation of the calendar .

Like the iOS Calendar app, the item on the left button can be a pseudo "Back" button or a tag. When the orientation becomes landscape, a segmented control is added to the title view of the navigation bar. In landscape mode, the left button element will always be a label because the layout is controlled by the segmented control. I say "nickname" because the back button and the segmented control do not actually push the controllers of the calendar view. It just toggles the layout of the calendar.

In Portrait mode, only views by day and by month are available, and segmented control is hidden. In the monthly view, if the user selects a "cell of the day" (not implemented), the presentation of the calendar becomes the presentation of the day. In the presentation of the day and in portrait, the element of the button of the bar of left changes into button of return. Pressing the Back button returns to the month view, and the button element in the left bar is replaced by a label.

In landscape mode, the layout control is passed to the segmented control.

For this review, I am seeking feedback on my overall strategy and how it is currently being implemented. I'm also afraid that I'm using UINavigationController badly and that the container's view controller, the calendar, becomes too complicated. Moreover, do I use the enumerations and protocols correctly here?

As a note, for the "Add" view controller, I use the "Show details (for example, Replace)" sequence that presents the VC modally. In this view, I added a back button that closes the view. Is it standard if I want the view to be 'added' Or in full screen with the hidden navigation bar?

storyboard
view of the month portrait
month landscape view
day portrait
landscape day view
5 day view landscape

ViewController.swift

// Root view controller

import UIKit

enum CalendarType: CaseIterable {
    case day, threeDay, fiveDay, month
}

protocol CalendarLayoutDelegate {
    func layoutCalendar(layout: CalendarType)
}

class ViewController: UIViewController {

    // When set, the class the must implement the CalendarLayoutDelegate protocol
    var calendarLayoutDelegate: CalendarLayoutDelegate?

    // Reference needed to set CalendarViewController instance to the CalendarLayoutDelegate and,
    // to be able to call the protocal method when currentCalendarLayout changes.
    var calendarViewController: CalendarViewController?

    // Navbar components
    @IBOutlet var leftBackButton: UIButton!
    var leftTitleLabel = UILabel()
    @IBOutlet weak var segmentedControl: UISegmentedControl!

    var currentCalendarLayout: CalendarType? {
        didSet {
            updateLeftBarButtonItem()
            calendarViewController?.layoutCalendar(layout: currentCalendarLayout!)
        }
    }

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if segue.identifier == "CalendarViewSegue" {
            if let calendarVC = segue.destination as? CalendarViewController {
                calendarViewController = calendarVC
                calendarViewController!.dateDelegate = self
                calendarLayoutDelegate = calendarViewController
            }
        }

        if segue.identifier == "AddSegue" {
            print("Prepare segue AddVC")
        }
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        leftTitleLabel.textColor = UIColor.black
        currentCalendarLayout = .month
        updateLeftBarButtonItem()
        layoutNavBar()
    }

    override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) {
        updateLeftBarButtonItem()
        layoutNavBar()
    }

    func layoutNavBar() {

        switch UIDevice.current.orientation {
        case .landscapeLeft, .landscapeRight:
            segmentedControl.isHidden = false

            // Set selected segment, either gonna be .day or .month if transitioning from portrait
            segmentedControl.selectedSegmentIndex = CalendarType.allCases.firstIndex(of: currentCalendarLayout!)!
        case .portrait:
            segmentedControl.isHidden = true

            // In portrait, only .month and .day are allowed.
            if currentCalendarLayout != .month {
                currentCalendarLayout = .day
            }

        default:
            break
        }
    }

    @IBAction func changeCalendarLayout(_ sender: Any) {
        switch segmentedControl.selectedSegmentIndex {
        case 0:
            currentCalendarLayout = .day
        case 1:
            currentCalendarLayout = .threeDay
        case 2:
            currentCalendarLayout = .fiveDay
        case 3:
            currentCalendarLayout = .month
        default:
            break
        }
    }

    @IBAction func backButtonMonthTapped(_ sender: Any) {
        currentCalendarLayout = .month
    }

    func updateLeftBarButtonItem() {
        // if portrait and not .month show back button
        if UIDevice.current.orientation == .portrait && currentCalendarLayout != .month {
            self.navigationItem.leftBarButtonItem = UIBarButtonItem.init(customView: leftBackButton)
        } else {
            self.navigationItem.leftBarButtonItem = UIBarButtonItem.init(customView: leftTitleLabel)
        }
    }
}

extension ViewController: DateDelegate {

    // TODO: Update the UI with the current date selected.
    func setDate(date: Date) {
        let formatter = DateFormatter()
        formatter.dateFormat = "MMMM yyyy"
        let monthYearString = formatter.string(from: date)

        leftTitleLabel.text = monthYearString

        // If back button, just show month and not the year
        leftBackButton.setTitle(monthYearString.components(separatedBy: " ").first, for: .normal)
    }
}

CalendarViewController.swift

import UIKit

protocol DateDelegate {
    func setDate(date: Date)
}

class CalendarViewController: UIViewController {

    // When set, the class the must implement the DateDelegate protocol
    var dateDelegate: DateDelegate?

    @IBOutlet weak var tempLayoutLabel: UILabel!

    var tempText = ""

    override func viewDidLoad() {
        super.viewDidLoad()

        self.dateDelegate?.setDate(date: Date())
        tempLayoutLabel.text = tempText
    }
}

extension CalendarViewController: CalendarLayoutDelegate {
    func layoutCalendar(layout: CalendarType) {
        tempText = "(String(describing: layout)) Calendar"

        if tempLayoutLabel != nil {
            tempLayoutLabel.text = tempText
        }
    }
}

AddViewController.swift

import UIKit

class AddViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    @IBAction func dismissAddViewController(_ sender: Any) {
        self.dismiss(animated: true, completion: nil)
    }
}

How to analyze an iPhone cell, iOS devices with AV?

Regarding iOS, devices and cell phones / watches, iPads, etc.

How can I scan them with an AV?

swift language – The most common code assignments for an iOS developer interview?

Some interviewers ask the candidate to code small tasks in the playground during the job interview.

Is there an online resource where I can find the most common exercises to better prepare for interviews?

Examples of missions would be:

  • Given a URL with JSON, please retrieve the data and print a specific field
  • Given a table with duplicate items, delete the duplicates without changing the order.

ios – How to get the date when the photo is clicked on an Android phone and is transferred to iPhone via Xender?

I've clicked on some pictures of my Android phone a few months ago. Today, when I transferred these photos to my iPhone, the creation date is the same as today. Is there a way in the iPhone to get the actual creation date (the date on which the user clicks on a picture from an Android phone)?

Iframe to full page in iOS

I use a lot of iframes in Wix pages (it's not a problem with Wix code, but an HTML code problem) to have maps and files other elements. The problem was always that the content could not go full page, a few months ago, a guy has developed a way to do it. It works perfectly in Android and the desktop, but not in iOS.

The first thing to keep in mind is that I can not use css to solve the problem because wix iframes are just for html. Java is out of the question too. So I focused on putting the keywords mentioned here in the other answers without a positive result. I used:

  
  
  

This is the code used in the HTML code to get the full screen behavior:

In HTML Iframe ()



  
  
  
  
Awesome font icons
 

  

  

As mentioned, it works perfectly in Android and Desktop, but not at all in iOS … completely lost in this one ….

ios – How can I take a screenshot on an iPhone when guided access is enabled?

I'm trying to take a screenshot of a problem that occurs with guided access on my iPhone. Is it possible?

I was unlucky with the usual method of simultaneously pressing Home and Power buttons. This limitation exists even before I touch the Start button in Guided Access. The simple fact of being in the initial screen prevents the screen capture function from working.

I tried to find an answer to this question via a standard web search, but I did not find anything.

Note: I'm using a beta version of iOS 13, but I guess the same problem exists under iOS 12 and earlier versions.