Code Monkey home page Code Monkey logo

uidevicecomplete's Introduction

Mostly Open Source, Mostly Harmless

Trying to make software development less painful and more fun one repository at a time.

If you have any questions or would like to get in contact please feel free to open an issue or find me on twitter.

uidevicecomplete's People

Contributors

arasu01 avatar danramteke avatar dmace2 avatar jminutaglio avatar matsune avatar nevil avatar nirma avatar pahnev avatar tsukisa avatar vacaballo avatar vincentneo avatar wilsongramer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uidevicecomplete's Issues

iPhone 12(s)

Gents,

Would you work your magic for the 12's? I think they ship Oct 23rd...

The profiles are in Xcode Version 12.1 (12A7403)

TY in advance - you all are awesomeness.

:)

Minor Update Required to be Swift 4 compliant

In identifier.swift lines 47 and 49 need to be changed to the following to be compliant with Swift 4:

let type = identifierString.prefix(while: { !numericCharacters.contains(String($0))})

let version = identifierString.suffix(from: type.endIndex)

'characters' has been deprecated.

Xcode 13 Archive things

Seen a couple of reports and first-hand experience that seems to suggest that libraries can no longer support iOS 11 and below in order to successfully be archived for app submission.

Have not tested on this library so I won't make any changes until I have done so.

Warnings when running in Xcode 12

The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99.

Compiling it by integrating it directly as source code not referencing using pod creates a compilation error!

Hi,

This is a great libary, I am not referencing it as a pod but integrating it as a Library but for some reason its creating a compilation issue for the first line in this function saying :

Ambiguous use of 'dc'

    func ipadSize1024() -> Double {
        let deviceModel = UIDevice().dc.deviceModel // the error is on this line
        switch deviceModel {
        case .iPadMini, .iPadMini2, .iPadMini3, .iPadMini4, .iPadMini5: return 7.9
        case .iPadPro10_5Inch: return 10.5
        case .iPadSevenGen: return 10.2
        default: return 9.7
        }
    }

Is there any way of fixing this and yes I would like to use it directly not as a pod please :)

Thank you,

Wael

iPhone 14 Series

new phones are:

iPhone 14 -> iPhone14,7
iPhone 14 Plus -> iPhone14,8
iPhone 14 Pro	->  iPhone15,2
iPhone 14 Pro Max -> iPhone15,3

I'll make a PR.

Also: there perhaps should be a new indicator, similar to has hasNotch for the new 'not notch'; perhaps hasDigitalIsland

Xcode 12 fixes

@vincentneo This pull request was just sent over #51

Maybe we should check everything and make sure there are no other existing issues for XCode 12.

If there are no further issues then lets put out a new release!

Typo on README

UIdevice.current.dc.commonDeviceName // iPad Pro (12.9 inch, Wi-Fi+LTE)

UIdevice -> UIDevice

iPhone 13 Family + iPad 9th gen + iPad mini 6th gen

Xcode Version 13.0 (13A233) has the simulators for the new devices - can we get them added, please?

I think some of these are shipping in a week so eager to get them ID'd with UIDeviceComplete!!!

Appreciate you all! & ty in advance!

iPhone ProMax & Mini Screen sizes

Regarding:

// MARK: - Detecting Screen size in Inches
extension Screen {
    public var sizeInches: Double? {
        switch (height, scale) {
        case (480, _): return 3.5
        case (568, _): return 4.0
        case (667, 3.0), (736, _): return 5.5
        case (667, 1.0), (667, 2.0): return 4.7
        case (812, 3.0): return 5.8
        case (896, 2.0): return 6.1
        case (896, 3.0): return 6.5
        case (1024, _): return ipadSize1024()
        case (1080, _): return 10.2
        case (1112, _): return 10.5
        case (1133, _): return 8.3
        case (1180, _): return 10.9
        case (1194, _): return 11.0
        case (1366, _): return 12.9
        default: return nil
        }
    }

    func ipadSize1024() -> Double {
        let deviceModel = UIDevice().dc.deviceModel
        switch deviceModel {
        case .iPadMini, .iPadMini2, .iPadMini3, .iPadMini4, .iPadMini5: return 7.9
        case .iPadPro10_5Inch: return 10.5
        default: return 9.7
        }
    }
}

iPhone 12 ProMax & 13 ProMax have a 6.7
iPhone 12 mini & 13 mini have a 5.4

`sizeInches` is innacurate when device is in landscape mode

First of all thanks for your work on this library :)

If I'm not mistaken, since sizeInches only looks at the screen's height, it can be wrong about the device's size in some situations.

For example, a 12.9" iPad Pro in landscape mode happens to have a "height" of 1024, which results in sizeInches returning 9.7.

As another example, a 9.7" iPad in landscape mode has a "height" of 768, which results in sizeInches returning nil.

Is this known or by design? Maybe there's a way of correctly getting device size in landscape mode?

For reference, here's the code computing sizeInches:

extension Screen {
    public var sizeInches: Double? {
        switch (height, scale) {
        case (480, _): return 3.5
        case (568, _): return 4.0
        case (667, 3.0), (736, _): return 5.5
        case (667, 1.0), (667, 2.0): return 4.7
        case (812, 3.0): return 5.8
        case (896, 2.0): return 6.1
        case (896, 3.0): return 6.5
        case (1024, _): return ipadSize1024()
        case (1080, _): return 10.2
        case (1112, _): return 10.5
        case (1133, _): return 8.3
        case (1180, _): return 10.9
        case (1194, _): return 11.0
        case (1366, _): return 12.9
        default: return nil
        }
    }

    func ipadSize1024() -> Double {
        let deviceModel = UIDevice().dc.deviceModel
        switch deviceModel {
        case .iPadMini, .iPadMini2, .iPadMini3, .iPadMini4, .iPadMini5: return 7.9
        case .iPadPro10_5Inch: return 10.5
        default: return 9.7
        }
    }
}

Impossible to add to objc project by default: SWIFT_VERSION not specified

❯ bundle exec pod install
Analyzing dependencies
Downloading dependencies
Installing UIDeviceComplete (2.7.3)
[!] Unable to determine Swift version for the following pods:

- `UIDeviceComplete-library` does not specify a Swift version and none of the targets (`MyTarget`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.

Setting SWIFT_VERSION in my project fixes this. But specifying Swift version in the podspec would be more correct.

Screen size nil for iPad 7th Gen

using:
let screenSize: Double = UIDevice.current.dc.screenSize.sizeInches

on the iPad 7th gen is returning nil instead of the expected 10.2

v2.7.5 isn't available in cocoapods repo

My private pod depends on your library: s.dependency 'UIDeviceComplete', '~> 2.7'

When I install pods, only v2.7.3 is fetched:

❯ bundle exec pod install --repo-update
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing UIDeviceComplete (2.7.3)
...

Temporary workaround is to point to the repo directly in Podfile:

pod 'UIDeviceComplete', :git => 'https://github.com/Nirma/UIDeviceComplete.git', :commit => '7fa25cf6c648a0c5fa4bb8c182fb91c7ded3e861'

XS Family Not Identifying

using:

Xcode 11.1GM (11A1027)
iOS 13.1
Simulator XS

& code:

switch device {
            case .iPhoneXR, .iPhone11:
                print("test:sized for found:", device)
                print("test:adjustments for: XR, 11")
                break
            case .iPhone11Pro, .iPhoneX, .iPhoneXS:
                print("test:sized for found:", device)
                print("test:adjustments for: 11Pro, X, XS")
                break
            default:
                print("test:sized for default:", device)
                break
 }

the output for the XS:
test:sized for default: unknown
Same for the XS Max. other devices seem to be ok. Is this a bug?

Ty

Display Zoom causes sizeInches to be nil (with iPhone 12 mini)

When running on an iPhone 12 mini

UIDevice.current.dc.screenSize.height = 812
UIDevice.current.dc.screenSize.scale = 3
UIDevice.current.dc.screenSize.sizeInches = 5.8

But with Display Zoom turned on I get these values:

UIDevice.current.dc.screenSize.height = 693
UIDevice.current.dc.screenSize.scale = 3

And since there is no match, sizeInches is nil.

iPhone SE 2nd Gen not identifying

Xcode Version 11.4.1 (11E503a)
iOS 13.1.4
Simulator iPhone SE 2nd Gen

& code:

let device = UIDevice.current.dc.deviceModel

Returns "unknown"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.