Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Someone want to see wiki page with useful code for iOS platform?

    Mobile and Embedded
    4
    6
    1024
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      shav last edited by

      Hi everyone!

      I have a small class for work with iOS device (get a information about device and application). For example to detect device type (iPad or iPhone) you could user this code (in *.mm file):

      bool flag = false;
      if([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone)
      {
          return true;
      }
      
      return flag;
      

      In you *.pro file you need add:

      CONFIG += objective_c
      

      I have a few useful methods for work with iOS device. And if someone needs this I can create wiki page.

      P.S. Sorry if I created a post in incorrect forum.

      Mac OS and iOS Developer

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Sure, go on. Just take the time to check if there's not already a page with on or the other snippet you would like to provide (e.g. how to start a phone call already exists).

        Note that you don't need CONFIG += objective_c but use OBJECTIVE_SOURCES += your_code.mm

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • S
          shav last edited by

          Ok, I'll start to work on wiki page I think it's will be two pages: the first one for hardware info and the second one for application info.

          P.S. How I can create 'code' tag with formatted style for c++ or objective-c? In documentation I can't find any information about this.

          Mac OS and iOS Developer

          1 Reply Last reply Reply Quote 0
          • M
            mcosta last edited by

            Hi,

            the wiki.qt.io has by default C++/Qt syntax enabled (it works well also for Objective-C).

            Once your problem is solved don't forget to:

            • Mark the thread as SOLVED using the Topic Tool menu
            • Vote up the answer(s) that helped you to solve the issue

            You can embed images using (http://imgur.com/) or (http://postimage.org/)

            1 Reply Last reply Reply Quote 0
            • M
              marco_piccolino Qt Champions 2017 last edited by

              Hi,

              me and other mobile application developers are aiming to revamp the Mobile wiki portal so that it becomes a good starting point for those willing to develop on current mobile platforms.

              @shav if you want to contribute with more useful pieces of information, there is currently a trello board to plan out the portal's structure. Just post your Trello handle here and I will add you.

              https://trello.com/b/kCCQ7B9V/qtwiki-mobile-portal

              1 Reply Last reply Reply Quote 0
              • S
                shav last edited by

                Hi everyone!

                I created two wiki pages Qt Device Info and Qt Application Info.

                @marco_piccolino said:

                @shav if you want to contribute with more useful pieces of information, there is currently a trello board to plan out the portal's structure. Just post your Trello handle here and I will add you.

                https://trello.com/b/kCCQ7B9V/qtwiki-mobile-portal

                Thanks! You can add me with this handle @andrewshapovalov

                Mac OS and iOS Developer

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post