Posts

Showing posts from August, 2019

Make only one screen landscape , others portal

1. Make project just allow portal 2. In AppDelegate.swift file: add 2 functions func application( _ application: UIApplication , supportedInterfaceOrientationsFor window: UIWindow ?) -> UIInterfaceOrientationMask {         if let rootViewController = self . topViewControllerWithRootViewController (rootViewController: window?. rootViewController ) {             if (rootViewController. responds (to: Selector (( " canRotate " )))) {                 // Unlock landscape view orientations for this view controller                 return . landscapeRight // .allButUpsideDown;             }         }                  // Only allow portrait (standard behaviour)         return . portrait ;     }  ...

Convert string json data to list Object

1. Class: struct LabourCharge : Codable {     var ID : Int !     var CustGroup: String !     var CalloutFee: Double !     var IncludedTime : Double !     var LabourRate: Double !     var PerTime: Double !          init (id: Int , custGroup: String , calloutFee: Double , includedTime: Double , labourRate: Double , perTime: Double ) {         self . ID = id         self . CalloutFee = calloutFee         self . CustGroup = custGroup         self . IncludedTime = includedTime         self . LabourRate = labourRate         self . PerTime = perTime     } } 2. Request - Response:  response json should return like: (         {         CalloutFee = 150;   ...

Creating a PDF in Swift with PDFKit

http://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiMjY0MDEzMCIsImRlbGl2ZXJ5X2lkIjoiNzgwNTQwMzY1MiIsInVybCI6Imh0dHA6Ly93d3cucmF5d2VuZGVybGljaC5jb20vNDAyMzk0MS1jcmVhdGluZy1hLXBkZi1pbi1zd2lmdC13aXRoLXBkZmtpdD91dG1fY2FtcGFpZ249cnctd2Vla2x5LWlzc3VlLTIzMlx1MDAyNnV0bV9tZWRpdW09ZW1haWxcdTAwMjZ1dG1fc291cmNlPXJ3LXdlZWtseVx1MDAyNl9fcz1md3VncGliYTk4ZWltZWFzdHNweiJ9

make a row selection and scroll there

DispatchQueue . main . async { let indexPath = IndexPath ( item : 'item' , section : 'section' ) self . tableView . scrollToRow ( at : indexPath , at : . top , animated : true ) }

Distribute app to Apple store

Image
I.  Distribute to App Store for testing on TestFilght or apple approval 1. Create App ID in Apple Developer: 2. Create profile for the app:  3. Create App in App Store Connect: 4.  Archive app 5. Verify app 6. Distribute app with App store option 7. Upload App to App store: II. Distribute to iTunes for testing (Work for MAC and Window computer) 1. Export app into ipa file with ad-hoc provionsioning 2. Connect device to computer itunes 3. Cmd-C on ipa file  on your computer 4. itunes:, select your device name, select music or st else on your device, Cmd-V That is all

Distribute iOS App via Ad Hoc

Method to install app to users: - Register all devices - Archive app - export app using ad-hoc or development provisioning  profile (IPA file) - Install app on user devices: 1.  Using xcode: max 100 registered devices  ,  User must provide UDID of their device 2. using TestFlight (Apple Configurator 2): 25 devices